Business-OnlinePayment-PayConnect-0.02/0042755000175000017500000000000007567417474016556 5ustar ivanivanBusiness-OnlinePayment-PayConnect-0.02/MANIFEST0100644000175000017500000000012707566176105017672 0ustar ivanivanPayConnect.pm Changes MANIFEST Makefile.PL README t/load.t t/bop.t t/lec.t t/bad_lec.t Business-OnlinePayment-PayConnect-0.02/Changes0100644000175000017500000000034307567417403020034 0ustar ivanivanRevision history for Perl extension Business::OnlinePayment::PayConnect. 0.02 Fri Nov 22 04:11:24 PST 2002 -trim trailing newline+CR from response 0.01 Sat Nov 17 21:59:37 PST 2002 -original version; created by ivan 1.0 Business-OnlinePayment-PayConnect-0.02/t/0042755000175000017500000000000007567417474017021 5ustar ivanivanBusiness-OnlinePayment-PayConnect-0.02/t/bad_lec.t0100644000175000017500000000243607566176105020547 0ustar ivanivan#BEGIN { $| = 1; print "1..4\n"; } BEGIN { $| = 1; print "1..3\n"; } use Business::OnlinePayment; my %phone2error = ( '2033500000' => '0130', '2012179746' => '0150', '4083624100' => '0160', #got 0416 (expected 0141)?? #'9044270189' => '0141', ); foreach my $phone (keys %phone2error) { my $tx = new Business::OnlinePayment("PayConnect", partner => 's9Te1', ); $tx->content( type => 'LEC', login => '7001', password => '9PIci', action => 'Authorization Only', description => 'Business::OnlinePayment LEC test', amount => '1.01', invoice_number => '100100', customer_id => 'jsk', first_name => 'Tofu', last_name => 'Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', phone => $phone, ); $tx->test_transaction(1); # test, dont really charge (NOP for this gateway) $tx->submit(); $num++; if($tx->is_success() || $tx->result_code ne $phone2error{$phone} ) { warn "**** got ". $tx->result_code. " (expected $phone2error{$phone}): ". $tx->error_message. " ****\n"; print "not ok $num\n"; } else { print "ok $num\n"; } } Business-OnlinePayment-PayConnect-0.02/t/bop.t0100644000175000017500000000020507566176105017746 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; } END {print "not ok 1\n" unless $loaded;} use Business::OnlinePayment; $loaded = 1; print "ok 1\n"; Business-OnlinePayment-PayConnect-0.02/t/lec.t0100644000175000017500000000203207566176105017731 0ustar ivanivanBEGIN { $| = 1; print "1..2\n"; } use Business::OnlinePayment; foreach my $phone (qw( 4082435901 8107926049 )) { my $tx = new Business::OnlinePayment("PayConnect", partner => 's9Te1', ); $tx->content( type => 'LEC', login => '7001', password => '9PIci', action => 'Authorization Only', description => 'Business::OnlinePayment LEC test', amount => '1.00', invoice_number => '100100', customer_id => 'jsk', name => 'Tofu Beast', first_name => 'Tofu', last_name => 'Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', phone => $phone, ); $tx->test_transaction(1); # test, dont really charge (NOP for this gateway) $tx->submit(); $num++; if($tx->is_success()) { print "ok $num\n"; } else { warn "*******". $tx->error_message. "*******"; print "not ok $num\n"; } } Business-OnlinePayment-PayConnect-0.02/t/load.t0100644000175000017500000000022107566176105020103 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; } END {print "not ok 1\n" unless $loaded;} use Business::OnlinePayment::PayConnect; $loaded = 1; print "ok 1\n"; Business-OnlinePayment-PayConnect-0.02/Makefile.PL0100644000175000017500000000116407566176105020515 0ustar ivanivanuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'Business::OnlinePayment::PayConnect', 'VERSION_FROM' => 'PayConnect.pm', # finds $VERSION 'AUTHOR' => 'Ivan Kohler ', #'NORECURS' => 1, # dont descend into subdirectories 'PREREQ_PM' => { 'Net::SSLeay' => '0', #'Text::CSV_XS' => 0, 'Business::OnlinePayment' => '0', #'Business::CreditCard' => 0.27, }, ); Business-OnlinePayment-PayConnect-0.02/PayConnect.pm0100644000175000017500000001036507567417403021147 0ustar ivanivanpackage Business::OnlinePayment::PayConnect; use strict; use Carp; use Business::OnlinePayment; #use Business::CreditCard; use Net::SSLeay qw( make_form post_https get_https make_headers ); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $DEBUG); require Exporter; @ISA = qw(Exporter AutoLoader Business::OnlinePayment); @EXPORT = qw(); @EXPORT_OK = qw(); $VERSION = '0.02'; $DEBUG = 0; sub set_defaults { my $self = shift; #test $self->server('zavijah.e-ebi.net'); $self->port('443'); $self->path('/rtv/servlet/aio'); $self->build_subs(qw( partner )); } sub revmap_fields { my($self, %map) = @_; my %content = $self->content(); foreach(keys %map) { $content{$_} = ref($map{$_}) ? ${ $map{$_} } : $content{$map{$_}}; } $self->content(%content); } sub submit { my $self = shift; my %content = $self->content(); my $action = lc($content{'action'}); if ( $action eq 'authorization only' ) { } else { croak "$action not (yet) supported"; } my $type = lc($content{'type'}); if ( $type eq 'lec' ) { } else { croak "$type not (yet) supported"; } $content{'zip'} =~ s/\D//g; $content{'zip'} =~ /^(\d{5})(\d*)$/; my($zip, $zip4) = ($1, $2); my $phone = $content{'phone'}; $phone =~ s/\D//g; $self->revmap_fields( ebiinfo => \'AIO-1.0', clientid => 'login', password => 'password', partner => \($self->partner()), #sysid transtype => \'A', #action paytype => \'lec', #type trackid => 'invoice_number', acctid => 'customer_id', billname => 'name', billaddr1 => 'address', #billaddr2 => billcity => 'city', billstate => 'state', billzip => \$zip, billzip4 => \$zip4, amt => 'amount', #LEC #ani btn => \$phone, #dni #traffic #planid #pincode ); my %post_data = $self->get_fields(qw( ebiinfo clientid password partner transtype paytype trackid acctid billname billaddr1 billcity billstate billzip billzip4 amt btn )); my $s = $self->server(); my $p = $self->port(); my $t = $self->path(); my $pd = make_form(%post_data); my($page,$server_response,%headers) = post_https($s,$p,$t,'',$pd); $page =~ s/\r*\n*$//; #warn join('-',%headers); #warn $page; my %response = map { split('=',$_,2) } split(/\|/,$page); #warn "$_: $response{$_}\n" foreach keys %response; if ( $response{'response'} eq '0000' ) { $self->is_success(1); $self->result_code('0000'); $self->authorization($response{'trackid'}); } else { $self->is_success(0); $self->result_code($response{'response'}); $self->error_message($response{'respmsg'}); } } 1; __END__ =head1 NAME Business::OnlinePayment::PayConnect - PaymentOne (formerly eBillit) PayConnect backend for Business::OnlinePayment =head1 SYNOPSIS use Business::OnlinePayment; my $tx = new Business::OnlinePayment("PayConnect", 'partner' => '', ); $tx->content( type => 'LEC', login => 'test', #ClientID password => 'test', action => 'Authorization Only', description => 'Business::OnlinePayment test', amount => '49.95', invoice_number => '100100', name => 'Tofu Beast', phone => '4155554321', ); $tx->submit(); if($tx->is_success()) { print "LEC billing authorized successfully: ".$tx->authorization."\n"; } else { print "LEC billing was rejected: ".$tx->error_message."\n"; } =head1 DESCRIPTION For detailed information see L. =head1 NOTE This module only implements 'LEC' (phone bill billing) functionality at this time. Credit card and ACH transactions are not (yet) supported. =head1 COMPATIBILITY This module implements an interface the "HTTPS AIO Validation Protocol version 3.0" of PaymentOne (formerly eBillit) PayConnect . Unfortunately, no documentation is publicly available. =head1 AUTHOR Ivan Kohler =head1 SEE ALSO perl(1). L =cut Business-OnlinePayment-PayConnect-0.02/README0100644000175000017500000000146007566176105017422 0ustar ivanivanCopyright (c) 2002 Ivan Kohler All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This is Business::OnlinePayment::PayConnect, an Business::OnlinePayment backend module for the PaymentOne (formerly eBillit) PayConnect. It is only useful if you have a merchant account with PaymentOne (formerly eBillit): http://www.paymentone.com/products/paycon.asp Currently, only 'LEC' billing is supported. Eventually credit card and ACH will be supported as well. Ivan Kohler Business::OnlinePayment is a generic interface for processing payments through online credit card processors, online check acceptance houses, etc. (If you like buzzwords, call it an "multiplatform ecommerce-enabling middleware solution").