1 package Business::OnlinePayment::PayConnect;
5 use Business::OnlinePayment;
6 #use Business::CreditCard;
7 use Net::SSLeay qw( make_form post_https get_https make_headers );
8 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $DEBUG);
12 @ISA = qw(Exporter AutoLoader Business::OnlinePayment);
23 $self->server('zavijah.e-ebi.net');
25 $self->path('/rtv/servlet/aio');
27 $self->build_subs(qw( partner ));
32 my %content = $self->content();
34 $content{$_} = ref($map{$_})
38 $self->content(%content);
43 my %content = $self->content();
45 my $action = lc($content{'action'});
46 if ( $action eq 'authorization only' ) {
48 croak "$action not (yet) supported";
51 my $type = lc($content{'type'});
52 if ( $type eq 'lec' ) {
54 croak "$type not (yet) supported";
57 $content{'zip'} =~ s/\D//g;
58 $content{'zip'} =~ /^(\d{5})(\d*)$/;
59 my($zip, $zip4) = ($1, $2);
61 my $phone = $content{'phone'};
65 ebiinfo => \'AIO-1.0',
67 password => 'password',
68 partner => \($self->partner()),
70 transtype => \'A', #action
71 paytype => \'lec', #type
72 trackid => 'invoice_number',
73 acctid => 'customer_id',
75 billaddr1 => 'address',
92 my %post_data = $self->get_fields(qw(
93 ebiinfo clientid password partner transtype paytype trackid acctid
94 billname billaddr1 billcity billstate billzip billzip4 amt btn
97 my $s = $self->server();
98 my $p = $self->port();
99 my $t = $self->path();
101 my $pd = make_form(%post_data);
102 my($page,$server_response,%headers) = post_https($s,$p,$t,'',$pd);
104 $page =~ s/\r*\n*$//;
106 #warn join('-',%headers);
108 my %response = map { split('=',$_,2) } split(/\|/,$page);
109 #warn "$_: $response{$_}\n" foreach keys %response;
111 if ( $response{'response'} eq '0000' ) {
112 $self->is_success(1);
113 $self->result_code('0000');
114 $self->authorization($response{'trackid'});
116 $self->is_success(0);
117 $self->result_code($response{'response'});
118 $self->error_message($response{'respmsg'});
128 Business::OnlinePayment::PayConnect - PaymentOne (formerly eBillit) PayConnect backend for Business::OnlinePayment
132 use Business::OnlinePayment;
134 my $tx = new Business::OnlinePayment("PayConnect",
139 login => 'test', #ClientID
141 action => 'Authorization Only',
142 description => 'Business::OnlinePayment test',
144 invoice_number => '100100',
145 name => 'Tofu Beast',
146 phone => '4155554321',
150 if($tx->is_success()) {
151 print "LEC billing authorized successfully: ".$tx->authorization."\n";
153 print "LEC billing was rejected: ".$tx->error_message."\n";
158 For detailed information see L<Business::OnlinePayment>.
162 This module only implements 'LEC' (phone bill billing) functionality at this
163 time. Credit card and ACH transactions are not (yet) supported.
167 This module implements an interface the "HTTPS AIO Validation Protocol
168 version 3.0" of PaymentOne (formerly eBillit) PayConnect
169 <http://www.paymentone.com/products/paycon.asp>. Unfortunately, no
170 documentation is publicly available.
174 Ivan Kohler <ivan-payconnect@420.am>
178 perl(1). L<Business::OnlinePayment>