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} || '';
26 my @refkey = grep { /txnref/i } keys %{$data}; # @#$%#@%!
27 my $refkey = $refkey[0] || ''; # please don't give me 2
28 $data->{$refkey} || '';
33 my %content = $self->content;
35 my $action = lc($content{'action'});
36 die 'Interswitchng only supports "Authorization Only" and '.
37 '"Post Authorization" transactions'
38 unless $action eq 'authorization only' || $action eq 'post authorization';
40 my @required = qw( login amount reference );
41 unless ($self->transaction_type() eq 'CC' ) {
42 croak("Dummy can't handle transaction type: ".
43 $self->transaction_type());
45 $self->required_fields(@required);
50 reference => 'TXNREF',
52 %content = $self->content;
53 $content{AMT} = $content{amount} * 100;
54 $content{TRANTYPE} = '00';
57 "https://". $self->server().
58 ($self->port != 443 ? ':'. $self->port() : ''). $self->path(). '?'.
59 join( '&', map { "$_=$content{$_}" }
60 qw( CADPID MERTID TXNREF AMT TRANTYPE )
62 $self->popup_url( $url );
72 Business::OnlineThirdPartyPayment::Interswitchng - Interswitchng Webpay backend for Business::OnlineThirdPartyPayment
76 use Business::OnlineThirdPartyPayment;
78 my $tx = new Business::OnlineThirdPartyPayment("Interswitchng");
81 action => 'Normal Authorization',
82 description => 'Business::OnlinePayment test',
84 invoice_number => '100100',
88 if($tx->is_success()) {
89 print "Card processed successfully: ".$tx->authorization."\n";
91 print "Card was rejected: ".$tx->error_message."\n";
96 For detailed information see L<Business::OnlineThirdPartyPayment>.
102 This module implements a payment gateway for Interswitchng's Webpay.
106 Jeff Finucane <interswitchng@weasellips.com>
110 perl(1). L<Business::OnlineThirdPartyPayment>.