Business-OnlinePayment-TransactionCentral-0.06/0000755000175000017500000000000010761403103020255 5ustar ivanivanBusiness-OnlinePayment-TransactionCentral-0.06/Makefile.PL0000644000175000017500000000177310624126125022243 0ustar ivanivanuse 5.005; use 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::TransactionCentral', VERSION_FROM => 'lib/Business/OnlinePayment/TransactionCentral.pm', # finds $VERSION PREREQ_PM => { 'Business::OnlinePayment' => 3, # for HTTPS (maybe it should be a separate dist?) 'URI::Escape' => 0, 'Tie::IxHash' => 0, # 'Net::SSLeay' => 0, # or 'Crypt::SSLeay' => 0, # 'URI }, ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'lib/Business/OnlinePayment/TransactionCentral.pm', # retrieve abstract from module AUTHOR => 'Ivan Kohler ') : ()), ); Business-OnlinePayment-TransactionCentral-0.06/lib/0000755000175000017500000000000010761403103021023 5ustar ivanivanBusiness-OnlinePayment-TransactionCentral-0.06/lib/Business/0000755000175000017500000000000010761403103022616 5ustar ivanivanBusiness-OnlinePayment-TransactionCentral-0.06/lib/Business/OnlinePayment/0000755000175000017500000000000010761403103025400 5ustar ivanivanBusiness-OnlinePayment-TransactionCentral-0.06/lib/Business/OnlinePayment/TransactionCentral.pm0000644000175000017500000001712010761402656031551 0ustar ivanivanpackage Business::OnlinePayment::TransactionCentral; use 5.005; use strict; use Carp; use Business::OnlinePayment 3; use Business::OnlinePayment::HTTPS 0.02; use vars qw($VERSION @ISA $DEBUG); @ISA = qw(Business::OnlinePayment::HTTPS); $VERSION = '0.06'; $DEBUG = 0; sub set_defaults { my $self = shift; $self->server('webservices.primerchants.com'); $self->port('443'); $self->path('/billing/TransactionCentral/'); $self->build_subs(qw( order_number avs_code cvv2_response response_page response_code response_headers )); } sub submit { my($self) = @_; $self->revmap_fields( 'MerchantID' => 'login', 'RegKey' => 'password', 'Amount' => 'amount', # 'CreditAmount' => 'amount', 'AccountNo' => 'card_number', 'NameonAccount' => 'name', 'AVSADDR' => 'address', 'AVSZIP' => 'zip', 'Email' => 'email', 'CCRURL' => \'', 'CVV2' => 'cvv2', 'TransID' => 'order_number', 'TRANSROUTE' => 'routing_code', ); #XXX also set required fields here... my @required_fields = qw(login password); my %content = $self->content(); my $action = $content{'action'}; my $url = $self->path; if ( $content{'type'} =~ /^(cc|visa|mastercard|american express|discover)$/i ) { if ( $action =~ /^\s*normal\s*authorization\s*$/i ) { $url .= 'processCC.asp'; #REFID $content{'REFID'} = int(rand(2**31)); #CCMonth & CCYear $content{'expiration'} =~ /^(\d+)\D+\d*(\d{2})$/ or croak "unparsable expiration ". $content{'expiration'}; my( $month, $year ) = ( $1, $2 ); $month = '0'. $month if $month =~ /^\d$/; $content{'CCMonth'} = $month; $content{'CCYear'} = $year; push @required_fields, qw( amount card_number expiration name address zip ); } elsif ( $action =~ /^\s*authorization\s*only\s*$/i ) { croak "Authorizaiton Only is not supported by Transaction Central"; } elsif ( $action =~ /^\s*post\s*authorization\s*$/i ) { croak "Post Authorizaiton is not supported by Transaction Central"; } elsif ( $action =~ /^\s*(void|credit)\s*$/i ) { $url .= 'voidcreditcconline.asp'; $content{'CreditAmount'} = delete $content{'Amount'}; } else { croak "Unknown action $action"; } } elsif ( $content{'type'} =~ /^e?check$/i ) { if ( $action =~ /^\s*normal\s*authorization\s*$/i ) { $url .= 'processcheckonline.asp'; $content{'AccountNo'} = $content{'account_number'}; $content{'TRANSTYPE'} = ( exists($content{account_type}) && $content{account_type} =~ /^s/i ) ? 'SA' : 'CK'; push @required_fields, qw( amount account_number routing_code name ); } elsif ( $action =~ /^\s*authorization\s*only\s*$/i ) { croak "Authorizaiton Only is not supported by Transaction Central"; } elsif ( $action =~ /^\s*post\s*authorization\s*$/i ) { croak "Post Authorizaiton is not supported by Transaction Central"; } elsif ( $action =~ /^\s*(void|credit)\s*$/i ) { $url .= 'addckcreditupdtonline.asp'; } else { croak "Unknown action $action"; } } else { croak 'Unknown type: '. $content{'type'}; } $self->path($url); $self->content(%content); $self->required_fields(@required_fields); my @fields = qw( MerchantID RegKey Amount REFID AccountNo CCMonth CCYear NameonAccount AVSADDR AVSZIP CCRURL CVV2 USER1 USER2 USER3 USER4 TrackData TransID CreditAmount DESCRIPTION DESCDATE TRANSTYPE TRANSROUTE ); my( $page, $response, %reply_headers ) = $self->https_post( $self->get_fields( @fields ) ); $self->response_code( $response ); $self->response_page( $page ); $self->response_headers( \%reply_headers ); #trim off around the response we want $page =~ s/^[\s\n]*[\s\n]*[\s\n]*//; $page =~ s/[\s\n]*<\/body>[\s\n]*<\/html>[\s\n]*$//; my %return = map { /^(\w+)=(.*)$/ ? ( $1 => $2 ) : () } split(/&/, $page); if ( $DEBUG ) { warn "$_ => $return{$_}\n" foreach keys %return; } #$self->result_code( $return{'AVSCode'} ); $self->avs_code( $return{'AVSCode'} ); $self->cvv2_response( $return{'CVV2ResponseMsg'} ); if ( $return{'Auth'} =~ /^\s*(\w+)\s*$/ && lc($1) ne 'declined' ) { $self->is_success(1); $self->authorization( $return{'Auth'} ); $self->order_number( $return{'TransID'} ); } else { $self->is_success(0); $self->error_message( $return{'Notes'} ); } } sub revmap_fields { my($self, %map) = @_; my %content = $self->content(); foreach(keys %map) { # warn "$_ = ". ( ref($map{$_}) # ? ${ $map{$_} } # : $content{$map{$_}} ). "\n"; $content{$_} = ref($map{$_}) ? ${ $map{$_} } : $content{$map{$_}}; } $self->content(%content); } 1; __END__ =head1 NAME Business::OnlinePayment::TransactionCentral - Transaction Central backend module for Business::OnlinePayment =head1 SYNOPSIS use Business::OnlinePayment; #### # One step transaction, the simple case. #### my $tx = new Business::OnlinePayment("TransactionCentral"); $tx->content( type => 'CC', login => '10011', #MerchantID password => 'KK48NPYEJHMAH6DK', #Regkey action => 'Normal Authorization', description => 'Business::OnlinePayment test', amount => '49.95', name => 'Tofu Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', phone => '420-867-5309', email => 'tofu.beast@example.com', card_number => '4012000000001', expiration => '08/06', cvv2 => '1234', #optional ); $tx->submit(); if($tx->is_success()) { print "Card processed successfully: ".$tx->authorization."\n"; } else { print "Card was rejected: ".$tx->error_message."\n"; } =head1 DESCRIPTION This is a Business::OnlinePayment backend module for the Transaction Central (MerchantAnywhere, PRIMerchants) gateway. It is only useful if you have a merchant account with MerchantAnywhere / PRIMerchants: http://www.merchantanywhere.com/ http://www.merchantanywhere.com/ecshop/TC_elink.htm http://www.primerchants.com/ http://www.primerchants.com/info/transactioncentral.asp =head1 SUPPORTED TRANSACTION TYPES =head2 CC, Visa, MasterCard, American Express, Discover Content required: type, login, password, action, amount, card_number, expiration, name, address, zip. =head2 ECHECK Content required: type, login, password, action, amount, account_number, routing_code, name =head1 PREREQUISITES URI::Escape Net::SSLeay _or_ ( Crypt::SSLeay and LWP ) =head1 DESCRIPTION For detailed information see L. =head1 NOTE The newest publicly available documentation is available at: http://www.merchantanywhere.com/ecshop/TC%20Interface%20NEW.pdf It is somewhat out-of-date and contains a few discrepancies. Google "TCInterfaceGuide" for current documentation. =head1 AUTHOR Ivan Kohler =head1 COPYRIGHT AND LICENSE Copyright (C) 2006 by Ivan Kohler Copyright (C) 2007 Freeside Internet Services, Inc. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO perl(1). L. =cut Business-OnlinePayment-TransactionCentral-0.06/Changes0000644000175000017500000000277410761402656021576 0ustar ivanivanRevision history for Perl extension Business::OnlinePayment::TransactionCentral. 0.06 Wed Feb 27 16:49:17 PST 2008 - update tests with new regkey for TC test account 0.05 Wed Nov 14 13:26:38 PST 2007 - add email->Email mapping 0.04 Wed May 30 11:53:00 PDT 2007 - depend on B:OP v3 - fix a "false success" problem caused by discrepancy between test and live systems: "Auth" field comes back as "Declined" rather than empty 0.03 Sat May 19 15:03:43 PDT 2007 - add/finish ECHECK support (google of TCInterfaceGuide indicated s/processcheck.asp/processcheckonline.asp/) - fix another problem with transactions going through but coming back denied: Returned "Auth" field can have trailing whitespace, wtf! - trim " " tags off of return info. This was preventing TransID (B:OP order_number) from being returned. - add tests: order_number, check, bad_check 0.02 Thu Apr 19 17:48:09 PDT 2007 - updated example in manpage s/Capstone/TransactionCentral/ - add debugging methods response_page, response_code, response_headers - Make sure expiration date has a leading zero - fix problem with transactions going through but coming back denied: Returned "Auth" field can have letters as well as numbers! sheesh 0.01 Wed Nov 23 05:14:43 2005 - original version; created by h2xs 1.23 with options -X -b 5.5.0 -n Business::OnlinePayment::TransactionCentral -v 0.01 Business-OnlinePayment-TransactionCentral-0.06/t/0000755000175000017500000000000010761403103020520 5ustar ivanivanBusiness-OnlinePayment-TransactionCentral-0.06/t/test_account0000644000175000017500000000002710761402656023151 0ustar ivanivan10011 6BK9JNNR6MQY578Y Business-OnlinePayment-TransactionCentral-0.06/t/credit_card.t0000644000175000017500000000250610761402656023167 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; } eval "use Net::SSLeay;"; if ( $@ ) { print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit; } use Business::OnlinePayment; require "t/lib/test_account.pl"; my($login, $regkey) = test_account_or_skip(); my $tx = new Business::OnlinePayment("TransactionCentral"); #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; $tx->content( type => 'VISA', login => $login, password => $regkey, action => 'Normal Authorization', description => 'Business::OnlinePayment::TransactionCentral test', amount => '32', card_number => '4012000000001', expiration => '01/06', cvv2 => '420', name => 'Tofu Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', country => 'US', email => 'ivan-transactioncentral-test@420.am', ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); if($tx->is_success()) { print "ok 1\n"; } else { #warn $tx->server_response."\n"; warn $tx->error_message. "\n"; print "not ok 1\n"; } Business-OnlinePayment-TransactionCentral-0.06/t/credit_card_onedigitmonth.t0000644000175000017500000000250510761402656026116 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; } eval "use Net::SSLeay;"; if ( $@ ) { print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit; } use Business::OnlinePayment; require "t/lib/test_account.pl"; my($login, $regkey) = test_account_or_skip(); my $tx = new Business::OnlinePayment("TransactionCentral"); #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; $tx->content( type => 'VISA', login => $login, password => $regkey, action => 'Normal Authorization', description => 'Business::OnlinePayment::TransactionCentral test', amount => '32', card_number => '4012000000001', expiration => '1/12', cvv2 => '420', name => 'Tofu Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', country => 'US', email => 'ivan-transactioncentral-test@420.am', ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); if($tx->is_success()) { print "ok 1\n"; } else { #warn $tx->server_response."\n"; warn $tx->error_message. "\n"; print "not ok 1\n"; } Business-OnlinePayment-TransactionCentral-0.06/t/lib/0000755000175000017500000000000010761403103021266 5ustar ivanivanBusiness-OnlinePayment-TransactionCentral-0.06/t/lib/test_account.pl0000644000175000017500000000166610761402656024343 0ustar ivanivansub test_account_or_skip { my $suffix = shift; my($login, $password) = test_account($suffix); unless( defined $login ) { #plan skip_all => "No test account"; #not (yet?) using Test::More print "ok 1 # Skipped: No test account\n"; exit; } return($login, $password); } sub test_account { my $suffix = shift || ''; $suffix = "_$suffix" if $suffix; open TEST_ACCOUNT, "t/test_account$suffix" or return; my($login, $password) = ; chomp $login; chomp $password; return($login, $password); } sub expiration_date { my($month, $year) = (localtime)[4,5]; $month += 1; $year++; # So we expire next year. $year %= 100; # y2k? What's that? return sprintf("%02d/%02d", $month, $year); } sub tomorrow { my($day, $month, $year) = (localtime(time+86400))[3..5]; return sprintf("%04d-%02d-%02d", $year+1900, ++$month, $day); } 1; Business-OnlinePayment-TransactionCentral-0.06/t/crypt_bad_card.t0000644000175000017500000000244110761402656023662 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; } print "ok 1 # Skipped: No way to get a decline response out of test account"; exit; eval "use Crypt::SSLeay;"; if ( $@ ) { print "ok 1 # Skipped: Crypt::SSLeay is not installed\n"; exit; } use Business::OnlinePayment; require "t/lib/test_account.pl"; my($login, $regkey) = test_account_or_skip(); my $tx = new Business::OnlinePayment("TransactionCentral"); $tx->content( type => 'VISA', login => $login, password => $regkey, action => 'Normal Authorization', amount => '32.32', #card_number => '4012000000001', card_number => '4342424242424242', expiration => '08/06', cvv2 => '420', name => 'Tofu Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', country => 'US', email => 'ivan-transactioncentral-test@420.am', ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); if($tx->is_success()) { print "not ok 1\n"; } else { #warn $tx->server_response."\n"; #warn $tx->error_message. "\n"; print "ok 1\n"; } Business-OnlinePayment-TransactionCentral-0.06/t/crypt_load.t0000644000175000017500000000057010357107500023052 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; eval "use Crypt::SSLeay;"; if ( $@ ) { print "ok 1 # Skipped: Crypt::SSLeay is not installed\n"; exit; } $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; } END {print "not ok 1\n" unless $loaded;} use Business::OnlinePayment::TransactionCentral; $loaded = 1; print "ok 1\n"; Business-OnlinePayment-TransactionCentral-0.06/t/bop.t0000644000175000017500000000020510357107500021465 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-TransactionCentral-0.06/t/order_number.t0000644000175000017500000000257010761402656023410 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; } eval "use Net::SSLeay;"; if ( $@ ) { print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit; } use Business::OnlinePayment; require "t/lib/test_account.pl"; my($login, $regkey) = test_account_or_skip(); my $tx = new Business::OnlinePayment("TransactionCentral"); #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; $tx->content( type => 'VISA', login => $login, password => $regkey, action => 'Normal Authorization', description => 'Business::OnlinePayment::TransactionCentral test', amount => '32', card_number => '4012000000001', expiration => '01/06', cvv2 => '420', name => 'Tofu Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', country => 'US', email => 'ivan-transactioncentral-test@420.am', ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); if($tx->is_success() && $tx->order_number =~ /^(\w+)$/ ) { print "ok 1\n"; } else { warn "order number: ". $tx->order_number."\n"; #warn $tx->error_message. "\n"; print "not ok 1\n"; } Business-OnlinePayment-TransactionCentral-0.06/t/bad_card.t0000644000175000017500000000263110761402656022442 0ustar ivanivanBEGIN {$| = 1; print "1..1\n"; } print "ok 1 # Skipped: No way to get a decline response out of test account"; exit; eval "use Net::SSLeay;"; if ( $@ ) { print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit; } use Business::OnlinePayment; require "t/lib/test_account.pl"; my($login, $regkey) = test_account_or_skip(); my $tx = new Business::OnlinePayment("TransactionCentral"); #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::HTTPS::DEBUG = 1; $Business::OnlinePayment::TransactionCentral::DEBUG = 1; $Business::OnlinePayment::TransactionCentral::DEBUG = 1; $tx->content( type => 'VISA', login => $login, password => $regkey, action => 'Normal Authorization', amount => '32.32', #card_number => '4012000000001', #card_number => '4342424242424242', card_number => '1', expiration => '08/06', cvv2 => '420', name => 'Tofu Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', country => 'US', email => 'ivan-transactioncentral-test@420.am', ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); if($tx->is_success()) { print "not ok 1\n"; } else { #warn $tx->server_response."\n"; #warn $tx->error_message. "\n"; print "ok 1\n"; } Business-OnlinePayment-TransactionCentral-0.06/t/bad_check.t0000644000175000017500000000226710761402656022613 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; } #print "ok 1 # Skipped: testing account won't accept ACH transactions\n"; exit; #eval "use Net::SSLeay;"; #if ( $@ ) { # print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit; #} use Business::OnlinePayment; require "t/lib/test_account.pl"; my($login, $regkey) = test_account_or_skip(); my $ctx = new Business::OnlinePayment("TransactionCentral"); $ctx->content( type => 'ECHECK', login => $login, password => $regkey, action => 'Normal Authorization', amount => '49.95', invoice_number => '100100', customer_id => 'jsk', name => 'Tofu Beast', account_number => '12345', #routing_code => '026009593', routing_code => 'bad_routing_code', bank_name => 'First National Test Bank', phone => '420-420-5454', #payee => 'Tofu Heavy Enterprises, GmbH', check_number => '420', ); $ctx->test_transaction(1); # test, dont really charge $ctx->submit(); #print $ctx->is_success()."\n"; if($ctx->is_success()) { #warn $ctx->error_message(); print "not ok 1 (".$ctx->error_message().")\n"; } else { print "ok 1\n"; } Business-OnlinePayment-TransactionCentral-0.06/t/credit_card_fs.t0000644000175000017500000000315410761402656023657 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; } eval "use Net::SSLeay;"; if ( $@ ) { print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit; } use Business::OnlinePayment; require "t/lib/test_account.pl"; my($login, $regkey) = test_account_or_skip(); my $tx = new Business::OnlinePayment("TransactionCentral"); #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; $tx->content( type => 'VISA', login => $login, password => $regkey, action => 'Normal Authorization', description => 'Business::OnlinePayment::TransactionCentral test', amount => '32', customer_id => '54', last_name => 'Beast', first_name => 'Tofu', name => 'Tofu Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', country => 'US', referer => 'http://cleanwhisker.420.am/', email => 'ivan-transactioncentral-test@420.am', #email => 'tofubeast@example.com', phone => '530-555-3300', 'customer_ip' => '5.4.3.2', #invoice_number => '420', card_number => '4012000000001', expiration => '01/06', cvv2 => '420', ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); if($tx->is_success()) { print "ok 1\n"; } else { #warn $tx->server_response."\n"; warn $tx->error_message. "\n"; print "not ok 1\n"; } Business-OnlinePayment-TransactionCentral-0.06/t/Business-OnlinePayment-TransactionCentral.t0000644000175000017500000000107310357107500031060 0ustar ivanivan# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Business-OnlinePayment-TransactionCentral.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test; BEGIN { plan tests => 1 }; use Business::OnlinePayment::TransactionCentral; ok(1); # If we made it this far, we're ok. ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. Business-OnlinePayment-TransactionCentral-0.06/t/crypt_credit_card.t0000644000175000017500000000267110761402656024413 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; $Business::OnlinePayment::HTTPS::skip_NetSSLeay=1; } eval "use Crypt::SSLeay;"; if ( $@ ) { print "ok 1 # Skipped: Crypt::SSLeay is not installed\n"; exit; } use Business::OnlinePayment; require "t/lib/test_account.pl"; my($login, $regkey) = test_account_or_skip(); my $tx = new Business::OnlinePayment("TransactionCentral"); #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::HTTPS::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; $tx->content( type => 'VISA', login => $login, password => $regkey, action => 'Normal Authorization', description => 'Business::OnlinePayment::TransactionCentral test', amount => '54.01', card_number => '4012000000001', expiration => '08/06', cvv2 => '420', name => 'Tofu Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', country => 'US', email => 'ivan-transactioncentral-test@420.am', ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); if($tx->is_success()) { print "ok 1\n"; } else { #warn $tx->server_response."\n"; warn $tx->error_message. "\n"; print "not ok 1\n"; } Business-OnlinePayment-TransactionCentral-0.06/t/load.t0000644000175000017500000000041310357107500021625 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; eval "use Net::SSLeay;"; if ( $@ ) { print "ok 1 # Skipped: Net::SSLeay is not installed\n"; exit; } } END {print "not ok 1\n" unless $loaded;} use Business::OnlinePayment::TransactionCentral; $loaded = 1; print "ok 1\n"; Business-OnlinePayment-TransactionCentral-0.06/t/check.t0000644000175000017500000000234010761402656021775 0ustar ivanivanBEGIN { $| = 1; print "1..1\n"; } use Business::OnlinePayment; require "t/lib/test_account.pl"; my($login, $regkey) = test_account_or_skip(); my $ctx = Business::OnlinePayment->new("TransactionCentral"); #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; #$Business::OnlinePayment::TransactionCentral::DEBUG = 1; $ctx->content( type => 'CHECK', login => $login, password => $regkey, action => 'Normal Authorization', amount => '49.95', invoice_number => '100100', customer_id => 'jsk', name => 'Tofu Beast', account_number => '12345', routing_code => '111000025', # BoA in Texas taken from Wikipedia bank_name => 'First National Test Bank', account_type => 'Checking', license_num => '12345678', license_state => 'OR', license_dob => '1975-05-21', ); $ctx->test_transaction(1); # test, dont really charge $ctx->submit(); if($ctx->is_success()) { print "ok 1\n"; } else { warn "error message : ". $ctx->error_message(). "\n"; warn "response code : ". $ctx->response_code(). "\n"; warn "response page : ". $ctx->response_page(). "\n"; print "not ok 1 (".$ctx->error_message().")\n"; } Business-OnlinePayment-TransactionCentral-0.06/README0000644000175000017500000000147310600332346021144 0ustar ivanivanCopyright (c) 2006 Ivan Kohler Copyright (c) 2007 Freeside Internet Services, Inc. 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::TransactionCentral, a Business::OnlinePayment backend module for the MerchantAnywhere Transaction Central gateway. It is only useful if you have a merchant account with MerchantAnywhere: http://www.merchantanywhere.com/ http://www.merchantanywhere.com/ecshop/TC_elink.htm http://www.merchantanywhere.com/ecshop/TC%20Interface%20NEW.pdf 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"). Business-OnlinePayment-TransactionCentral-0.06/MANIFEST0000644000175000017500000000050310623672345021421 0ustar ivanivanChanges Makefile.PL MANIFEST README lib/Business/OnlinePayment/TransactionCentral.pm t/Business-OnlinePayment-TransactionCentral.t t/load.t t/bad_card.t t/bad_check.t t/bop.t t/check.t t/credit_card.t t/crypt_bad_card.t t/crypt_credit_card.t t/crypt_load.t t/credit_card_fs.t t/credit_card_onedigitmonth.t t/order_number.t