1 package Business::OnlineThirdPartyPayment::Interswitchng;
5 use Business::OnlineThirdPartyPayment 3;
6 use Business::CreditCard;
7 use vars qw($VERSION @ISA $DEBUG);
9 @ISA = qw(Business::OnlineThirdPartyPayment);
17 $self->server('webpay.interswitchng.com') unless $self->server;
18 $self->port('443') unless $self->port;
19 $self->path('/webpay_pilot/purchase.aspx') unless $self->path;
24 my ($self, $data) = @_;
25 $data->{TXNREF} || '';
30 my %content = $self->content;
32 my $action = lc($content{'action'});
33 die 'Interswitchng only supports "Authorization Only" and '.
34 '"Post Authorization" transactions'
35 unless $action eq 'authorization only' || $action eq 'post authorization';
37 my @required = qw( login amount reference );
38 unless ($self->transaction_type() eq 'CC' ) {
39 croak("Dummy can't handle transaction type: ".
40 $self->transaction_type());
42 $self->required_fields(@required);
47 reference => 'TXNREF',
49 %content = $self->content;
50 $content{AMT} = $content{amount} * 100;
53 "https://". $self->server(). ':'. $self->port(). $self->path(). '?'.
54 join( '&', map { "$_=$content{$_}" } qw( CADPID MERTID TXNREF AMT ) );
55 $self->popup_url( $url );
65 Business::OnlineThirdPartyPayment::Interswitchng - Interswitchng Webpay backend for Business::OnlineThirdPartyPayment
69 use Business::OnlineThirdPartyPayment;
71 my $tx = new Business::OnlineThirdPartyPayment("Interswitchng");
74 action => 'Normal Authorization',
75 description => 'Business::OnlinePayment test',
77 invoice_number => '100100',
81 if($tx->is_success()) {
82 print "Card processed successfully: ".$tx->authorization."\n";
84 print "Card was rejected: ".$tx->error_message."\n";
89 For detailed information see L<Business::OnlineThirdPartyPayment>.
95 This module implements a payment gateway for Interswitchng's Webpay.
99 Jeff Finucane <interswitchng@weasellips.com>
103 perl(1). L<Business::OnlineThirdPartyPayment>.