Business-OnlinePayment-AuthorizeNet-3.23/0000755000175000017500000000000012635614671017122 5ustar ivanivanBusiness-OnlinePayment-AuthorizeNet-3.23/META.yml0000644000175000017500000000134112635614671020372 0ustar ivanivan--- abstract: unknown author: - 'Ivan Kohler ' build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.150005' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Business-OnlinePayment-AuthorizeNet no_index: directory: - t - inc requires: Business::OnlinePayment: '3' Business::OnlinePayment::HTTPS: '0' Net::HTTPS::Any: '0' Test::More: '0.42' Text::CSV_XS: '0' Tie::IxHash: '0' XML::Simple: '0' XML::Writer: '0' version: '3.23' x_serialization_backend: 'CPAN::Meta::YAML version 0.012' Business-OnlinePayment-AuthorizeNet-3.23/MANIFEST0000644000175000017500000000077712635614671020266 0ustar ivanivanAuthorizeNet/AIM.pm AuthorizeNet/AIM/ErrorCodes.pm AuthorizeNet/ARB.pm AuthorizeNet.pm Changes MANIFEST Makefile.PL README t/00load.t t/card_arb.t t/credit_card.t t/check.t t/bop.t t/capture.t t/errorcodes.t t/load.t t/mixed_operation.t t/test_account t/test_account_ach t/test_account_arb t/lib/test_account.pl t/lib/Business/FraudDetect/_Fake.pm META.yml Module meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) Business-OnlinePayment-AuthorizeNet-3.23/META.json0000644000175000017500000000227612635614671020552 0ustar ivanivan{ "abstract" : "unknown", "author" : [ "Ivan Kohler " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.150005", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Business-OnlinePayment-AuthorizeNet", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Business::OnlinePayment" : "3", "Business::OnlinePayment::HTTPS" : "0", "Net::HTTPS::Any" : "0", "Test::More" : "0.42", "Text::CSV_XS" : "0", "Tie::IxHash" : "0", "XML::Simple" : "0", "XML::Writer" : "0" } } }, "release_status" : "stable", "version" : "3.23", "x_serialization_backend" : "JSON::PP version 2.27203" } Business-OnlinePayment-AuthorizeNet-3.23/AuthorizeNet.pm0000644000175000017500000004033512635614100022071 0ustar ivanivanpackage Business::OnlinePayment::AuthorizeNet; use strict; use Carp; use Business::OnlinePayment; use vars qw($VERSION @ISA $me); @ISA = qw(Business::OnlinePayment); $VERSION = '3.23'; $me = 'Business::OnlinePayment::AuthorizeNet'; sub set_defaults { my $self = shift; $self->build_subs(qw( order_number md5 avs_code cvv2_response cavv_response )); } sub _map_processor { my($self) = @_; my %content = $self->content(); my %processors = ('recurring authorization' => 'ARB', 'modify recurring authorization' => 'ARB', 'cancel recurring authorization' => 'ARB', ); $processors{lc($content{'action'})} || 'AIM'; } sub submit { my($self) = @_; my $processor = $me. "::". $self->_map_processor(); eval "use $processor"; croak("unknown processor $processor ($@)") if $@; my $object = bless $self, $processor; $object->set_defaults(); $object->submit(); bless $self, $me; } 1; __END__ =head1 NAME Business::OnlinePayment::AuthorizeNet - AuthorizeNet backend for Business::OnlinePayment =head1 SYNOPSIS use Business::OnlinePayment; #### # One step transaction, the simple case. #### my $tx = new Business::OnlinePayment("AuthorizeNet"); $tx->content( type => 'VISA', login => 'testdrive', password => '', #password or transaction key action => 'Normal Authorization', description => 'Business::OnlinePayment test', amount => '49.95', invoice_number => '100100', customer_id => 'jsk', email => 'jason@example.com', first_name => 'Jason', last_name => 'Kohles', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', country => 'US', card_number => '4007000000027', expiration => '09/02', cvv2 => '1234', #optional referer => 'http://valid.referer.url/', ); $tx->submit(); if($tx->is_success()) { print "Card processed successfully: ".$tx->authorization."\n"; } else { print "Card was rejected: ".$tx->error_message."\n"; } #### # Two step transaction, authorization and capture. # If you don't need to review order before capture, you can # process in one step as above. #### my $tx = new Business::OnlinePayment("AuthorizeNet"); $tx->content( type => 'VISA', login => 'testdrive', password => '', #password or transaction key action => 'Authorization Only', description => 'Business::OnlinePayment test', amount => '49.95', invoice_number => '100100', customer_id => 'jsk', email => 'jason@example.com', first_name => 'Jason', last_name => 'Kohles', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', country => 'US', card_number => '4007000000027', expiration => '09/02', cvv2 => '1234', #optional referer => 'http://valid.referer.url/', ); $tx->submit(); if($tx->is_success()) { # get information about authorization $authorization = $tx->authorization $ordernum = $tx->order_number; $avs_code = $tx->avs_code; # AVS Response Code $cvv2_response = $tx->cvv2_response; # CVV2/CVC2/CID Response Code $cavv_response = $tx->cavv_response; # Cardholder Authentication # Verification Value (CAVV) Response # Code # now capture transaction my $capture = new Business::OnlinePayment("AuthorizeNet"); $capture->content( type => 'CC', action => 'Post Authorization', login => 'YOURLOGIN password => 'YOURPASSWORD', #or transaction key order_number => $ordernum, amount => '49.95', ); $capture->submit(); if($capture->is_success()) { print "Card captured successfully: ".$capture->authorization."\n"; } else { print "Card was rejected: ".$capture->error_message."\n"; } } else { print "Card was rejected: ".$tx->error_message."\n"; } #### # One step subscription, the simple case. #### my $tx = new Business::OnlinePayment("AuthorizeNet::ARB"); $tx->content( type => 'CC', login => 'testdrive', password => 'testpass', #or transaction key action => 'Recurring Authorization', interval => '7 days', start => '2008-3-10', periods => '16', amount => '99.95', trialperiods => '4', trialamount => '0', description => 'Business::OnlinePayment test', invoice_number => '1153B33F', customer_id => 'vip', first_name => 'Tofu', last_name => 'Beast', address => '123 Anystreet', city => 'Anywhere', state => 'GA', zip => '84058', card_number => '4111111111111111', expiration => '09/02', ); $tx->submit(); if($tx->is_success()) { print "Card processed successfully: ".$tx->order_number."\n"; } else { print "Card was rejected: ".$tx->error_message."\n"; } my $subscription = $tx->order_number #### # Subscription change. Modestly more complicated. #### $tx->content( type => 'CC', subscription => '99W2C', login => 'testdrive', password => 'testpass', #or transaction key action => 'Modify Recurring Authorization', interval => '7 days', start => '2008-3-10', periods => '16', amount => '29.95', trialperiods => '4', trialamount => '0', description => 'Business::OnlinePayment test', invoice_number => '1153B340', customer_id => 'vip', first_name => 'Tofu', last_name => 'Beast', address => '123 Anystreet', city => 'Anywhere', state => 'GA', zip => '84058', card_number => '4111111111111111', expiration => '09/02', ); $tx->submit(); if($tx->is_success()) { print "Update processed successfully."\n"; } else { print "Update was rejected: ".$tx->error_message."\n"; } $tx->content( subscription => '99W2D', login => 'testdrive', password => 'testpass', # or transaction key action => 'Cancel Recurring Authorization', ); $tx->submit(); #### # Subscription cancellation. It happens. #### if($tx->is_success()) { print "Cancellation processed successfully."\n"; } else { print "Cancellation was rejected: ".$tx->error_message."\n"; } =head1 SUPPORTED TRANSACTION TYPES =head2 CC, Visa, MasterCard, American Express, Discover Content required: type, login, password, action, amount, first_name, last_name, card_number, expiration. =head2 Check Content required: type, login, password, action, amount, first_name, last_name, account_number, routing_code, bank_name (non-subscription), account_type (subscription), check_type (subscription). =head2 Subscriptions Additional content required: interval, start, periods. =head1 DESCRIPTION For detailed information see L. =head1 METHODS AND FUNCTIONS See L for the complete list. The following methods either override the methods in L or provide additional functions. =head2 result_code Returns the response reason code (from the message.code field for subscriptions). =head2 error_message Returns the response reason text (from the message.text field for subscriptions. =head2 server_response Returns the complete response from the server. =head1 Handling of content(%content) data: =head2 action The following actions are valid normal authorization authorization only credit post authorization void recurring authorization modify recurring authorization cancel recurring authorization =head2 interval Interval contains a number of digits, whitespace, and the units of days or months in either singular or plural form. =head1 Setting AuthorizeNet ARB parameters from content(%content) The following rules are applied to map data to AuthorizeNet ARB parameters from content(%content): # ARB param => $content{} merchantAuthentication name => 'login', transactionKey => 'password', subscription paymentSchedule interval length => \( the digits in 'interval' ), unit => \( days or months gleaned from 'interval' ), startDate => 'start', totalOccurrences => 'periods', trialOccurrences => 'trialperiods', amount => 'amount', trialAmount => 'trialamount', payment creditCard cardNumber => 'card_number', expiration => \( $year.'-'.$month ), # YYYY-MM from 'expiration' bankAccount accountType => 'account_type', routingNumber => 'routing_code', accountNumber => 'account_number, nameOnAccount => 'name', bankName => 'bank_name', echeckType => 'check_type', order invoiceNumber => 'invoice_number', description => 'description', customer type => 'customer_org', id => 'customer_id', email => 'email', phoneNumber => 'phone', faxNumber => 'fax', driversLicense number => 'license_num', state => 'license_state', dateOfBirth => 'license_dob', taxid => 'customer_ssn', billTo firstName => 'first_name', lastName => 'last_name', company => 'company', address => 'address', city => 'city', state => 'state', zip => 'zip', country => 'country', shipTo firstName => 'ship_first_name', lastName => 'ship_last_name', company => 'ship_company', address => 'ship_address', city => 'ship_city', state => 'ship_state', zip => 'ship_zip', country => 'ship_country', =head1 NOTES Use your transaction key in the password field. Unlike Business::OnlinePayment or pre-3.0 versions of Business::OnlinePayment::AuthorizeNet, 3.1 requires separate first_name and last_name fields. Business::OnlinePayment::AuthorizeNet uses Authorize.Net's "Advanced Integration Method (AIM) (formerly known as ADC direct response)" and "Automatic Recurring Billing (ARB)", sending a username and password (or transaction key as password) with every transaction. Therefore, Authorize.Net's referrer "security" is not necessary. In your Authorize.Net interface at https://secure.authorize.net/ make sure the list of allowable referers is blank. Alternatively, set the B field in the transaction content. To settle an authorization-only transaction (where you set action to 'Authorization Only'), submit the nine-digit transaction id code in the field "order_number" with the action set to "Post Authorization". You can get the transaction id from the authorization by calling the order_number method on the object returned from the authorization. You must also submit the amount field with a value less than or equal to the amount specified in the original authorization. For the subscription actions an authorization code is never returned by the module. Instead it returns the value of subscriptionId in order_number. This is the value to use for changing or cancelling subscriptions. Authorize.Net has turned address verification on by default for all merchants since 2002. If you do not have valid address information for your customer (such as in an IVR application), you must disable address verification in the Merchant Menu page at https://secure.authorize.net/ so that the transactions aren't denied due to a lack of address information. =head1 COMPATIBILITY This module implements Authorize.Net's API using the Advanced Integration Method (AIM) version 3.1, formerly known as ADC Direct Response and the Automatic Recurring Billing version 1.0 using the XML interface. See http://www.authorize.net/support/AIM_guide.pdf and http://www.authorize.net/support/ARB_guide.pdf for details. =head1 AUTHORS Original author: Jason Kohles, jason@mediabang.com Ivan Kohler updated it for Authorize.Net protocol 3.0/3.1 and is the current maintainer. Please see the next section for for information on contributing. Jason Spence contributed support for separate Authorization Only and Post Authorization steps and wrote some docs. OST paid for it. Jeff Finucane added the ARB support. ARB support sponsored by Plus Three, LP. L. T.J. Mather sent a number of CVV2 patches. Mike Barry sent in a patch for the referer field and a fix for ship_company. Yuri V. Mkrtumyan sent in a patch to add the void action. Paul Zimmer sent in a patch for card-less post authorizations. Daemmon Hughes sent in a patch for "transaction key" authentication as well support for the recurring_billing flag and the md5 method that returns the MD5 hash which is returned by the gateway. Steve Simitzis contributed a patch for better compatibility with eProcessingNetwork's AuthorizeNet compatibility mode. Michael G. Schwern contributed cleanups, test fixes, and more. Erik Hollensbe implemented card-present data (track1/track2), the duplicate_window parameter, and test fixes. Paul Timmins added the check_number field. Nate Nuss implemented the ("Additional Shipping Information (Level 2 Data)" fields: tax, freight, duty, tax_exempt, po_number. Michael Peters fixed a bug in email address handling. Thomas Sibley wrote B:OP:AuthorizeNet::AIM::ErrorCodes which was borged and used to provide more descriptive error messages. Craig Pearlman sent in a patch to more accurately declare required fields for E-check transcations. =head1 CONTRIBUTIONS AND REPOSITORY Please send patches as unified diffs (diff -u) to (in order of preference): =over 4 =item CPAN RT http://rt.cpan.org/Public/Bug/Report.html?Queue=Business-OnlinePayment-AuthorizeNet =item The bop-devel mailing list http://420.am/cgi-bin/mailman/listinfo/bop-devel =item Ivan Ivan Kohler =back The code is available from our public git repository: git clone git://fit.freeside.biz/Business-OnlinePayment-AuthorizeNet.git Or on the web: http://freeside.biz/gitweb/?p=Business-OnlinePayment-AuthorizeNet.git =head1 A WORD FROM OUR SPONSOR This module and the Business::OnlinePayment framework are maintained by by Freeside Internet Services. If you need a complete, open-source web-based application to manage your customers, billing and trouble ticketing, please visit http://freeside.biz/ =head1 COPYRIGHT & LICENSE Copyright 2010-2015 Freeside Internet Services, Inc. Copyright 2008 Thomas Sibley All rights reserved. This program 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-AuthorizeNet-3.23/Makefile.PL0000644000175000017500000000131311773673025021072 0ustar ivanivanuse ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'Business::OnlinePayment::AuthorizeNet', 'VERSION_FROM' => 'AuthorizeNet.pm', # finds $VERSION 'AUTHOR' => 'Ivan Kohler ', #really just #the maintainer 'PREREQ_PM' => { 'Text::CSV_XS' => 0, 'Business::OnlinePayment' => 3, 'Business::OnlinePayment::HTTPS' => 0, 'Net::HTTPS::Any' => 0, 'Test::More' => 0.42, 'Tie::IxHash' => 0, 'XML::Simple' => 0, 'XML::Writer' => 0, }, ); Business-OnlinePayment-AuthorizeNet-3.23/t/0000755000175000017500000000000012635614671017365 5ustar ivanivanBusiness-OnlinePayment-AuthorizeNet-3.23/t/check.t0000644000175000017500000000220111773673025020622 0ustar ivanivan#!/usr/bin/perl -w use Test::More skip_all => "Authorize.net test account won't do ACH"; require "t/lib/test_account.pl"; my($login, $password) = test_account_or_skip('ach'); plan tests => 2; use_ok 'Business::OnlinePayment'; my $ctx = Business::OnlinePayment->new("AuthorizeNet"); $ctx->server('test.authorize.net'); $ctx->content( type => 'CHECK', login => $login, password => $password, action => 'Normal Authorization', amount => '49.95', invoice_number => '100100', customer_id => 'jsk', first_name => 'Tofu', last_name => 'Beast', account_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(); SKIP: { skip $ctx->error_message, 1 if $ctx->result_code == 18; ok( $ctx->is_success() ) || diag $ctx->error_message; } Business-OnlinePayment-AuthorizeNet-3.23/t/test_account_ach0000644000175000017500000000003411773673025022613 0ustar ivanivananettest05 BnrmzG5h49ggN6pl Business-OnlinePayment-AuthorizeNet-3.23/t/load.t0000644000175000017500000000014011773673025020464 0ustar ivanivan#!/usr/bin/perl -w use Test::More tests => 1; use_ok 'Business::OnlinePayment::AuthorizeNet'; Business-OnlinePayment-AuthorizeNet-3.23/t/test_account_arb0000644000175000017500000000003411773673025022624 0ustar ivanivan7d9P9X9vT2 773dV9999Pyz9GdW Business-OnlinePayment-AuthorizeNet-3.23/t/lib/0000755000175000017500000000000012635614671020133 5ustar ivanivanBusiness-OnlinePayment-AuthorizeNet-3.23/t/lib/Business/0000755000175000017500000000000012635614671021726 5ustar ivanivanBusiness-OnlinePayment-AuthorizeNet-3.23/t/lib/Business/FraudDetect/0000755000175000017500000000000012635614671024120 5ustar ivanivanBusiness-OnlinePayment-AuthorizeNet-3.23/t/lib/Business/FraudDetect/_Fake.pm0000644000175000017500000000074111773673025025465 0ustar ivanivanpackage Business::FraudDetect::_Fake; use vars qw( @ISA $result $fraud_score ); @ISA = qw ( Business::OnlinePayment ); sub _glean_parameters_from_parent { my ($self, $parent) = @_; $result = $parent->fraud_detect_faked_result; $fraud_score = $parent->fraud_detect_faked_score; } sub fraud_score { $fraud_score; } sub submit { my $self = shift; $result ? $self->error_message('') : $self->error_message('Planned failure.'); $self->is_success($result); } 1; Business-OnlinePayment-AuthorizeNet-3.23/t/lib/test_account.pl0000644000175000017500000000151711773673025023167 0ustar ivanivansub test_account_or_skip { my $suffix = shift; my($login, $password) = test_account($suffix); unless( defined $login ) { plan skip_all => "No test account"; } 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-AuthorizeNet-3.23/t/mixed_operation.t0000644000175000017500000000547511773673025022753 0ustar ivanivan#!/usr/bin/perl -w BEGIN { push @INC, "t/lib" }; use Test::More; require "t/lib/test_account.pl"; my($arblogin, $arbpassword) = test_account_or_skip('arb'); my($aimlogin, $aimpassword) = test_account_or_skip(); plan tests => 9; use_ok 'Business::OnlinePayment'; my $tx = Business::OnlinePayment->new("AuthorizeNet", fraud_detect => '_Fake', fraud_detect_faked_result => '0', fraud_detect_faked_score => '2', maximum_fraud_score => '1', ); $tx->content( type => 'VISA', login => $arblogin, password => $arbpassword, action => 'Recurring Authorization', description => 'Business::OnlinePayment::ARB mixed test', amount => '1.05', first_name => 'Tofu', last_name => 'Beast', card_number => '4007000000027', expiration => expiration_date(), interval => '1 month', start => tomorrow(), periods => '6', ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); ok(!$tx->is_success()) or diag "ARB Fraud detection unexpectedly did not fail."; $tx->fraud_detect_faked_result(1); $tx->submit(); ok(!$tx->is_success()) or diag "ARB Fraud detection unexpectedly did not deny."; $tx->fraud_detect_faked_score(0); $tx->submit(); ok($tx->is_success()) or diag $tx->error_message(); my $subscription = $tx->order_number(); like($subscription, qr/^[0-9]{1,13}$/, "Get order number"); SKIP: { skip "No order number", 1 unless $subscription; $tx->content( login => $arblogin, password => $arbpassword, action => 'Cancel Recurring Authorization', subscription => $subscription, ); $tx->test_transaction(1); $tx->submit(); ok($tx->is_success()) or diag $tx->error_message; } $tx->server('test.authorize.net'); $tx->path('/gateway/transact.dll'); $tx->content( type => 'VISA', login => $aimlogin, password => $aimpassword, action => 'Normal Authorization', description => 'Business::OnlinePayment::AIM mixed test', amount => '1.06', first_name => 'Tofu', last_name => 'Beast', card_number => '4007000000027', expiration => expiration_date(), ); $tx->test_transaction(1); #test, don't really charge $tx->fraud_detect_faked_result(0); $tx->fraud_detect_faked_score(2); $tx->submit(); ok(!$tx->is_success()) or diag "AIM Fraud detection unexpectedly did not fail."; $tx->submit(); $tx->fraud_detect_faked_result(1); ok(!$tx->is_success()) or diag "AIM Fraud detection unexpectedly did not deny."; $tx->fraud_detect_faked_score(0); $tx->submit(); ok($tx->is_success()) or diag $tx->error_message; Business-OnlinePayment-AuthorizeNet-3.23/t/capture.t0000644000175000017500000000403411773673025021216 0ustar ivanivan#!/usr/bin/perl -w use Test::More; require "t/lib/test_account.pl"; my($login, $password) = test_account_or_skip(); plan tests => 4; use_ok 'Business::OnlinePayment'; #avoid dup checking in case "make test" is run too close to the last my $amount = sprintf('%.2f', rand(100)); my $tx = Business::OnlinePayment->new("AuthorizeNet"); $tx->server('test.authorize.net'); $tx->content( type => 'VISA', login => $login, password => $password, action => 'Authorization Only', description => 'Business::OnlinePayment visa test', amount => $amount, invoice_number => '100100', customer_id => 'jsk', first_name => 'Tofu', last_name => 'Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', card_number => '4007000000027', expiration => expiration_date(), ); # don't set test_transaction (using test server though, still a test) # as per authorize.net: # "You need to be in Live Mode to get back a transaction ID" #$tx->test_transaction(1); # test, dont really charge $tx->submit(); ok($tx->is_success()) or diag $tx->error_message; my $auth = $tx->authorization; my $order_number = $tx->order_number; like $order_number, qr/^\d+$/; #warn "auth: $auth\n"; #warn "order_number: $order_number\n"; my $settle_tx = Business::OnlinePayment->new("AuthorizeNet"); $settle_tx->server('test.authorize.net'); $settle_tx->content( type => 'VISA', login => $login, password => $password, action => 'Post Authorization', description => 'Business::OnlinePayment visa test', amount => $amount, invoice_number => '100100', authorization => $auth, order_number => $order_number, card_number => '4007000000027', expiration => expiration_date(), ); #$settle_tx->test_transaction(1); # test, dont really charge $settle_tx->submit(); ok($settle_tx->is_success()) || diag $settle_tx->error_message; Business-OnlinePayment-AuthorizeNet-3.23/t/credit_card.t0000644000175000017500000000170211773673025022015 0ustar ivanivan#!/usr/bin/perl -w use Test::More; require "t/lib/test_account.pl"; my($login, $password) = test_account_or_skip(); plan tests => 2; use_ok 'Business::OnlinePayment'; my $tx = Business::OnlinePayment->new("AuthorizeNet"); $tx->server('test.authorize.net'); $tx->content( type => 'VISA', login => $login, password => $password, action => 'Normal Authorization', description => 'Business::OnlinePayment visa test', amount => '49.95', invoice_number => '100100', customer_id => 'jsk', first_name => 'Tofu', last_name => 'Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', card_number => '4007000000027', expiration => expiration_date(), ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); ok($tx->is_success()) or diag $tx->error_message; Business-OnlinePayment-AuthorizeNet-3.23/t/00load.t0000644000175000017500000000014011773673025020624 0ustar ivanivan#!/usr/bin/perl -w use Test::More tests => 1; use_ok 'Business::OnlinePayment::AuthorizeNet'; Business-OnlinePayment-AuthorizeNet-3.23/t/test_account0000644000175000017500000000003511773673025022001 0ustar ivanivanf9zmKtPbQtD Vzx2n2Uk2TPanu3M Business-OnlinePayment-AuthorizeNet-3.23/t/bop.t0000644000175000017500000000012211773673025020325 0ustar ivanivan#!/usr/bin/perl -w use Test::More tests => 1; use_ok 'Business::OnlinePayment'; Business-OnlinePayment-AuthorizeNet-3.23/t/card_arb.t0000644000175000017500000000345211773673025021313 0ustar ivanivan#!/usr/bin/perl -w use Test::More skip_all => 'Authorize.net test account throwing errors about duplicates'; require "t/lib/test_account.pl"; my($login, $password) = test_account_or_skip('arb'); plan tests => 5; use_ok 'Business::OnlinePayment'; my $tx = Business::OnlinePayment->new("AuthorizeNet"); $tx->content( type => 'VISA', login => $login, password => $password, action => 'Recurring Authorization', description => 'Business::OnlinePayment::ARB visa test', amount => '49.95', invoice_number => '100100', customer_id => 'jsk', first_name => 'Tofu', last_name => 'Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', card_number => '4007000000027', expiration => expiration_date(), interval => '1 month', start => tomorrow(), periods => '3', ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); ok($tx->is_success()) or diag $tx->error_message; my $subscription = $tx->order_number(); like($subscription, qr/^[0-9]{1,13}$/, "Get order number"); SKIP: { skip "No order number", 2 unless $subscription; $tx->content( login => $login, password => $password, action => 'Modify Recurring Authorization', subscription => $subscription, amount => '19.95', ); $tx->test_transaction(1); $tx->submit(); ok($tx->is_success()) or diag $tx->error_message; $tx->content( login => $login, password => $password, action => 'Cancel Recurring Authorization', subscription => $subscription, ); $tx->test_transaction(1); $tx->submit(); ok($tx->is_success()) or diag $tx->error_message; } Business-OnlinePayment-AuthorizeNet-3.23/t/errorcodes.t0000644000175000017500000000200411773673025021715 0ustar ivanivan#!/usr/bin/perl -w use Test::More; require "t/lib/test_account.pl"; my($login, $password) = test_account_or_skip(); plan tests => 3; use_ok 'Business::OnlinePayment'; my $tx = Business::OnlinePayment->new("AuthorizeNet"); $tx->server('test.authorize.net'); $tx->content( type => 'VISA', login => $login, password => $password, action => 'Normal Authorization', description => 'Business::OnlinePayment visa test', amount => '49.95', invoice_number => '100100', customer_id => 'jsk', first_name => 'Tofu', last_name => 'Beast', address => '123 Anystreet', city => 'Anywhere', state => 'UT', zip => '84058', card_number => '4007000000027', expiration => 'BADFORMAT', #expiration_date(), ); $tx->test_transaction(1); # test, dont really charge $tx->submit(); ok(!$tx->is_success); ok($tx->error_message() =~ /The format of the date submitted was incorrect/ ); Business-OnlinePayment-AuthorizeNet-3.23/AuthorizeNet/0000755000175000017500000000000012635614671021543 5ustar ivanivanBusiness-OnlinePayment-AuthorizeNet-3.23/AuthorizeNet/AIM.pm0000644000175000017500000002622112277743671022517 0ustar ivanivanpackage Business::OnlinePayment::AuthorizeNet::AIM; use strict; use Carp; use Business::OnlinePayment::HTTPS; use Business::OnlinePayment::AuthorizeNet; use Business::OnlinePayment::AuthorizeNet::AIM::ErrorCodes '%ERRORS'; use Text::CSV_XS; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); @ISA = qw(Business::OnlinePayment::AuthorizeNet Business::OnlinePayment::HTTPS); $VERSION = '3.23'; sub set_defaults { my $self = shift; $self->server('secure.authorize.net') unless $self->server; $self->port('443') unless $self->port; $self->path('/gateway/transact.dll') unless $self->path; $self->build_subs(qw( order_number md5 avs_code cvv2_response cavv_response )); } sub map_fields { my($self) = @_; my %content = $self->content(); # ACTION MAP my %actions = ('normal authorization' => 'AUTH_CAPTURE', 'authorization only' => 'AUTH_ONLY', 'credit' => 'CREDIT', 'post authorization' => 'PRIOR_AUTH_CAPTURE', 'void' => 'VOID', ); $content{'action'} = $actions{lc($content{'action'} || '')} || $content{'action'}; # TYPE MAP my %types = ('visa' => 'CC', 'mastercard' => 'CC', 'american express' => 'CC', 'discover' => 'CC', 'check' => 'ECHECK', ); $content{'type'} = $types{lc($content{'type'} || '')} || $content{'type'}; $self->transaction_type($content{'type'}); # ACCOUNT TYPE MAP my %account_types = ('personal checking' => 'CHECKING', 'personal savings' => 'SAVINGS', 'business checking' => 'CHECKING', 'business savings' => 'SAVINGS', ); $content{'account_type'} = $account_types{lc($content{'account_type'} || '')} || $content{'account_type'}; if (length $content{'password'} == 15) { $content{'transaction_key'} = delete $content{'password'}; } # stuff it back into %content $self->content(%content); } sub remap_fields { my($self,%map) = @_; my %content = $self->content(); foreach(keys %map) { $content{$map{$_}} = $content{$_}; } $self->content(%content); } sub get_fields { my($self,@fields) = @_; my %content = $self->content(); my %new = (); foreach( grep defined $content{$_}, @fields) { $new{$_} = $content{$_}; } return %new; } sub submit { my($self) = @_; $self->map_fields(); $self->remap_fields( type => 'x_Method', login => 'x_Login', password => 'x_Password', transaction_key => 'x_Tran_Key', action => 'x_Type', description => 'x_Description', amount => 'x_Amount', currency => 'x_Currency_Code', invoice_number => 'x_Invoice_Num', order_number => 'x_Trans_ID', auth_code => 'x_Auth_Code', customer_id => 'x_Cust_ID', customer_ip => 'x_Customer_IP', last_name => 'x_Last_Name', first_name => 'x_First_Name', company => 'x_Company', address => 'x_Address', city => 'x_City', state => 'x_State', zip => 'x_Zip', country => 'x_Country', ship_last_name => 'x_Ship_To_Last_Name', ship_first_name => 'x_Ship_To_First_Name', ship_company => 'x_Ship_To_Company', ship_address => 'x_Ship_To_Address', ship_city => 'x_Ship_To_City', ship_state => 'x_Ship_To_State', ship_zip => 'x_Ship_To_Zip', ship_country => 'x_Ship_To_Country', tax => 'x_Tax', freight => 'x_Freight', duty => 'x_Duty', tax_exempt => 'x_Tax_Exempt', po_number => 'x_Po_Num', phone => 'x_Phone', fax => 'x_Fax', email => 'x_Email', email_customer => 'x_Email_Customer', card_number => 'x_Card_Num', expiration => 'x_Exp_Date', cvv2 => 'x_Card_Code', check_type => 'x_Echeck_Type', account_name => 'x_Bank_Acct_Name', account_number => 'x_Bank_Acct_Num', account_type => 'x_Bank_Acct_Type', bank_name => 'x_Bank_Name', routing_code => 'x_Bank_ABA_Code', check_number => 'x_Bank_Check_Number', customer_org => 'x_Customer_Organization_Type', customer_ssn => 'x_Customer_Tax_ID', license_num => 'x_Drivers_License_Num', license_state => 'x_Drivers_License_State', license_dob => 'x_Drivers_License_DOB', recurring_billing => 'x_Recurring_Billing', duplicate_window => 'x_Duplicate_Window', track1 => 'x_Track1', track2 => 'x_Track2', ); my $auth_type = $self->{_content}->{transaction_key} ? 'transaction_key' : 'password'; my @required_fields = ( qw(type action login), $auth_type ); unless ( $self->{_content}->{action} eq 'VOID' ) { if ($self->transaction_type() eq "ECHECK") { push @required_fields, qw( amount routing_code account_number account_type bank_name account_name ); if (defined $self->{_content}->{customer_org} and length $self->{_content}->{customer_org} ) { push @required_fields, qw( customer_org customer_ssn ); } elsif ( defined $self->{_content}->{license_num} and length $self->{_content}->{license_num} ) { push @required_fields, qw(license_num license_state license_dob); } } elsif ($self->transaction_type() eq 'CC' ) { if ( $self->{_content}->{action} eq 'PRIOR_AUTH_CAPTURE' ) { if ( $self->{_content}->{order_number} ) { push @required_fields, qw( amount order_number ); } else { push @required_fields, qw( amount card_number expiration ); } } elsif ( $self->{_content}->{action} eq 'CREDIT' ) { push @required_fields, qw( amount order_number card_number ); } else { push @required_fields, qw( amount last_name first_name card_number expiration ); } } else { Carp::croak( "AuthorizeNet can't handle transaction type: ". $self->transaction_type() ); } } $self->required_fields(@required_fields); my %post_data = $self->get_fields(qw/ x_Login x_Password x_Tran_Key x_Invoice_Num x_Description x_Amount x_Cust_ID x_Method x_Type x_Card_Num x_Exp_Date x_Card_Code x_Auth_Code x_Echeck_Type x_Bank_Acct_Num x_Bank_Account_Name x_Bank_ABA_Code x_Bank_Name x_Bank_Acct_Type x_Bank_Check_Number x_Customer_Organization_Type x_Customer_Tax_ID x_Customer_IP x_Drivers_License_Num x_Drivers_License_State x_Drivers_License_DOB x_Last_Name x_First_Name x_Company x_Address x_City x_State x_Zip x_Country x_Ship_To_Last_Name x_Ship_To_First_Name x_Ship_To_Company x_Ship_To_Address x_Ship_To_City x_Ship_To_State x_Ship_To_Zip x_Ship_To_Country x_Tax x_Freight x_Duty x_Tax_Exempt x_Po_Num x_Phone x_Fax x_Email x_Email_Customer x_Country x_Currency_Code x_Trans_ID x_Duplicate_Window x_Track1 x_Track2/); $post_data{'x_Test_Request'} = $self->test_transaction() ? 'TRUE' : 'FALSE'; #deal with perl-style bool if ( $post_data{'x_Email_Customer'} && $post_data{'x_Email_Customer'} !~ /^FALSE$/i ) { $post_data{'x_Email_Customer'} = 'TRUE'; } elsif ( exists $post_data{'x_Email_Customer'} ) { $post_data{'x_Email_Customer'} = 'FALSE'; } my $data_string = join("", values %post_data); my $encap_character; # The first set of characters here are recommended by authorize.net in their # encapsulating character example. # The second set we made up hoping they will work if the first fail. # The third chr(31) is the binary 'unit separator' and is our final last # ditch effort to find something not in the input. foreach my $char( qw( | " ' : ; / \ - * ), '#', qw( ^ + < > [ ] ~), chr(31) ){ if( index($data_string, $char) == -1 ){ # found one. $encap_character = $char; last; } } if(!$encap_character){ $self->is_success(0); $self->error_message( "DEBUG: Input contains all encapsulating characters." . " Please remove | or ^ from your input if possible." ); return; } $post_data{'x_ADC_Delim_Data'} = 'TRUE'; $post_data{'x_delim_char'} = ','; $post_data{'x_encap_char'} = $encap_character; $post_data{'x_ADC_URL'} = 'FALSE'; $post_data{'x_Version'} = '3.1'; my $opt = defined( $self->{_content}->{referer} ) ? { 'headers' => { 'Referer' => $self->{_content}->{referer} } } : {}; my($page, $server_response, %headers) = $self->https_post( $opt, \%post_data ); #escape NULL (binary 0x00) values $page =~ s/\x00/\^0/g; #trim 'ip_addr="1.2.3.4"' added by eProcessingNetwork Authorize.Net compat $page =~ s/,ip_addr="[\d\.]+"$//; my $csv = new Text::CSV_XS({ binary=>1, escape_char=>'', quote_char => $encap_character }); $csv->parse($page); my @col = $csv->fields(); $self->server_response($page); $self->avs_code($col[5]); $self->order_number($col[6]); $self->md5($col[37]); $self->cvv2_response($col[38]); $self->cavv_response($col[39]); if($col[0] eq "1" ) { # Authorized/Pending/Test $self->is_success(1); $self->result_code($col[0]); if ($col[4] =~ /^(.*)\s+(\d+)$/) { #eProcessingNetwork extra bits.. $self->authorization($2); } else { $self->authorization($col[4]); } } else { $self->is_success(0); $self->result_code($col[2]); $self->error_message($col[3]); if ( $self->result_code ) { my $addl = $ERRORS{ $self->result_code }; $self->error_message( $self->error_message. ' - '. $addl->{notes}) if $addl && ref($addl) eq 'HASH' && $addl->{notes}; } else { #additional logging information #$page =~ s/\x00/\^0/g; $self->error_message($col[3]. " DEBUG: No x_response_code from server, ". "(HTTPS response: $server_response) ". "(HTTPS headers: ". join(", ", map { "$_ => ". $headers{$_} } keys %headers ). ") ". "(Raw HTTPS content: $page)" ); } } } 1; __END__ =head1 NAME Business::OnlinePayment::AuthorizeNet::AIM - AuthorizeNet AIM backend for Business::OnlinePayment =head1 SEE ALSO perl(1). L L. =cut Business-OnlinePayment-AuthorizeNet-3.23/AuthorizeNet/ARB.pm0000644000175000017500000002623511773673025022515 0ustar ivanivanpackage Business::OnlinePayment::AuthorizeNet::ARB; use strict; use Carp; use Business::OnlinePayment::AuthorizeNet; use Business::OnlinePayment::HTTPS; use XML::Simple; use XML::Writer; use Tie::IxHash; use vars qw($VERSION $DEBUG @ISA $me); @ISA = qw(Business::OnlinePayment::AuthorizeNet Business::OnlinePayment::HTTPS); $VERSION = '0.02'; $DEBUG = 0; $me='Business::OnlinePayment::AuthorizeNet::ARB'; sub set_defaults { my $self = shift; $self->server('api.authorize.net') unless $self->server; $self->port('443') unless $self->port; $self->path('/xml/v1/request.api') unless $self->path; $self->build_subs(qw( order_number md5 avs_code cvv2_response cavv_response )); } sub map_fields { my($self) = @_; my %content = $self->content(); # ACTION MAP my %actions = ('recurring authorization' => 'ARBCreateSubscriptionRequest', 'modify recurring authorization' => 'ARBUpdateSubscriptionRequest', 'cancel recurring authorization' => 'ARBCancelSubscriptionRequest', ); $content{'action'} = $actions{lc($content{'action'} || '')} || $content{'action'}; # TYPE MAP my %types = ('visa' => 'CC', 'mastercard' => 'CC', 'american express' => 'CC', 'discover' => 'CC', 'check' => 'ECHECK', ); $content{'type'} = $types{lc($content{'type'} || '')} || $content{'type'}; $self->transaction_type($content{'type'}); # ACCOUNT TYPE MAP my %account_types = ('personal checking' => 'checking', 'personal savings' => 'savings', 'business checking' => 'businessChecking', 'business savings' => 'savings', ); $content{'account_type'} = $account_types{lc($content{'account_type'} || '')} || $content{'account_type'}; # MASSAGE EXPIRATION $content{'expdate_yyyymm'} = $self->expdate_yyyymm($content{'expiration'}); # stuff it back into %content $self->content(%content); } sub revmap_fields { my $self = shift; tie my(%map), 'Tie::IxHash', @_; my %content = $self->content(); map { my $value; if ( ref( $map{$_} ) eq 'HASH' ) { $value = $map{$_} if ( keys %{ $map{$_} } ); }elsif( exists( $content{ $map{$_} } ) ) { $value = $content{ $map{$_} }; } if (defined($value)) { ($_ => $value); }else{ (); } } (keys %map); } sub expdate_yyyymm { my $self = shift; my $expiration = shift; my $expdate_yyyymm; if ( defined($expiration) and $expiration =~ /^(\d{1,2})\D+(\d{2})$/ ) { my ( $month, $year ) = ( $1, $2 ); $expdate_yyyymm = sprintf( "20%02d-%02d", $year, $month ); } return defined($expdate_yyyymm) ? $expdate_yyyymm : $expiration; }; sub _xmlwrite { my ($self, $writer, $item, $value) = @_; $writer->startTag($item); if ( ref( $value ) eq 'HASH' ) { foreach ( keys ( %$value ) ) { $self->_xmlwrite($writer, $_, $value->{$_}); } }else{ $writer->characters($value); } $writer->endTag($item); } sub submit { my($self) = @_; $self->map_fields(); my @required_fields = qw(action login password); if ( $self->{_content}->{action} eq 'ARBCreateSubscriptionRequest' ) { push @required_fields, qw( type interval start periods amount first_name last_name ); if ($self->transaction_type() eq "ECHECK") { push @required_fields, qw( amount routing_code account_number account_type account_name check_type ); } elsif ($self->transaction_type() eq 'CC' ) { push @required_fields, qw( card_number expiration ); } }elsif ( $self->{_content}->{action} eq 'ARBUpdateSubscriptionRequest' ) { push @required_fields, qw( subscription ); }elsif ( $self->{_content}->{action} eq 'ARBCancelSubscriptionRequest' ) { push @required_fields, qw( subscription ); }else{ croak "$me can't handle transaction type: ". $self->{_content}->{action}. " for ". $self->transaction_type(); } $self->required_fields(@required_fields); tie my %merchant, 'Tie::IxHash', $self->revmap_fields( name => 'login', transactionKey => 'password', ); my ($length,$unit) = ($self->{_content}->{interval} or '') =~ /^\s*(\d+)\s+(day|month)s?\s*$/; tie my %interval, 'Tie::IxHash', ( ($length ? (length => $length) : () ), ($unit ? (unit => $unit.'s') : () ), ); tie my %schedule, 'Tie::IxHash', $self->revmap_fields( interval => \%interval, startDate => 'start', totalOccurrences => 'periods', trialOccurrences => 'trialperiods', ); tie my %account, 'Tie::IxHash', ( ( defined($self->transaction_type()) && $self->transaction_type() eq 'CC' ) ? $self->revmap_fields( cardNumber => 'card_number', expirationDate => 'expdate_yyyymm', ) : $self->revmap_fields( accountType => 'account_type', routingNumber => 'routing_code', accountNumber => 'account_number', nameOnAccount => 'account_name', echeckType => 'check_type', bankName => 'bank_name', ) ); tie my %payment, 'Tie::IxHash', $self->revmap_fields( ( ( defined($self->transaction_type()) && # require? $self->transaction_type() eq 'CC' ) ? 'creditCard' : 'bankAccount' ) => \%account, ); tie my %order, 'Tie::IxHash', $self->revmap_fields( invoiceNumber => 'invoice_number', description => 'description', ); tie my %drivers, 'Tie::IxHash', $self->revmap_fields( number => 'license_num', state => 'license_state', dateOfBirth => 'license_dob', ); tie my %billto, 'Tie::IxHash', $self->revmap_fields( firstName => 'first_name', lastName => 'last_name', company => 'company', address => 'address', city => 'city', state => 'state', zip => 'zip', country => 'country', ); tie my %shipto, 'Tie::IxHash', $self->revmap_fields( firstName => 'ship_first_name', lastName => 'ship_last_name', company => 'ship_company', address => 'ship_address', city => 'ship_city', state => 'ship_state', zip => 'ship_zip', country => 'ship_country', ); tie my %customer, 'Tie::IxHash', $self->revmap_fields( type => 'customer_org', id => 'customer_id', email => 'email', phoneNumber => 'phone', faxNumber => 'fax', driversLicense => \%drivers, taxid => 'customer_ssn', ); tie my %sub, 'Tie::IxHash', $self->revmap_fields( name => 'subscription_name', paymentSchedule => \%schedule, amount => 'amount', trialAmount => 'trialamount', payment => \%payment, order => \%order, customer => \%customer, billTo => \%billto, shipTo => \%shipto, ); tie my %req, 'Tie::IxHash', $self->revmap_fields ( merchantAuthentication => \%merchant, subscriptionId => 'subscription', subscription => \%sub, ); my $ns = "AnetApi/xml/v1/schema/AnetApiSchema.xsd"; my $post_data; my $writer = new XML::Writer( OUTPUT => \$post_data, DATA_MODE => 1, DATA_INDENT => 1, ENCODING => 'utf-8', ); $writer->xmlDecl(); $writer->startTag($self->{_content}->{action}, 'xmlns', $ns); foreach ( keys ( %req ) ) { $self->_xmlwrite($writer, $_, $req{$_}); } $writer->endTag($self->{_content}->{action}); $writer->end(); if ($self->test_transaction()) { $self->server('apitest.authorize.net'); } warn $post_data if $DEBUG; my($page,$server_response,%headers) = $self->https_post( { 'Content-Type' => 'text/xml' }, $post_data); #trim leading (4?) characters of unknown origin not in spec $page =~ s/^(.*?){messages}->{message}) eq 'ARRAY') { $message = $response->{messages}->{message}->[0]; }else{ $message = $response->{messages}->{message}; } }else{ $response->{messages}->{resultCode} = "Server Failed"; $message->{code} = $server_response; } $self->server_response($page); $self->order_number($response->{subscriptionId}); $self->result_code($message->{code}); $self->error_message($message->{text}); if($response->{messages}->{resultCode} eq "Ok" ) { $self->is_success(1); } else { $self->is_success(0); unless ( $self->error_message() ) { #additional logging information $self->error_message( "(HTTPS response: $server_response) ". "(HTTPS headers: ". join(", ", map { "$_ => ". $headers{$_} } keys %headers ). ") ". "(Raw HTTPS content: $page)" ); } } } 1; __END__ =head1 NAME Business::OnlinePayment::AuthorizeNet::ARB - AuthorizeNet ARB backend for Business::OnlinePayment =head1 AUTHOR Jeff Finucane, authorizenetarb@weasellips.com =head1 SEE ALSO perl(1). L. =cut Business-OnlinePayment-AuthorizeNet-3.23/AuthorizeNet/AIM/0000755000175000017500000000000012635614671022151 5ustar ivanivanBusiness-OnlinePayment-AuthorizeNet-3.23/AuthorizeNet/AIM/ErrorCodes.pm0000644000175000017500000012014411773673025024560 0ustar ivanivanpackage Business::OnlinePayment::AuthorizeNet::AIM::ErrorCodes; use strict; use warnings; use Exporter 'import'; use vars qw(@EXPORT_OK $VERSION); @EXPORT_OK = qw(lookup %ERRORS); $VERSION = '0.01'; =head1 NAME Business::OnlinePayment::AuthorizeNet::AIM::ErrorCodes - Easy lookup of Authorize.Net's AIM result reason codes =head1 SYNOPSIS use Business::OnlinePayment::AuthorizeNet::AIM::ErrorCodes 'lookup'; my $result = lookup( $result_code ); # $result = { reason => ..., notes => ... }; or use Business::OnlinePayment::AuthorizeNet::AIM::ErrorCodes '%ERRORS'; my $result = $ERRORS{ $result_code }; =head1 DESCRIPTION This module exists to lookup the textual descriptions of errors returned by Authorize.Net's AIM submission method. The error messages returned in the gateway's response are often not as useful as those in Authorize.Net's AIM guide (L). =head2 lookup CODE Takes the result code returned by Authorize.Net's AIM gateway. Returns a hashref containing two keys, C and C (which may be empty) if the lookup is successful, undef otherwise. =head1 AUTHOR Thomas Sibley =head1 COPYRIGHT AND LICENSE Copyright (c) 2008. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available. =cut our %ERRORS; sub lookup { my $code = shift; return if not $code or not defined $ERRORS{$code}; return $ERRORS{$code}; } %ERRORS = ( '127' => { 'notes' => 'The system-generated void for the original AVS-rejected transaction failed.', 'reason' => 'The transaction resulted in an AVS mismatch. The address provided does not match billing address of cardholder.' }, '32' => { 'notes' => '', 'reason' => 'This reason code is reserved or not applicable to this API.' }, '90' => { 'notes' => '', 'reason' => 'This reason code is reserved or not applicable to this API.' }, '206' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The merchant is not on file.', 'reason' => 'This transaction has been declined.' }, '118' => { 'notes' => 'This code is applicable only to merchants that include the x_authentication_indicator and x_authentication_value in the transaction request. The combination of authentication indicator and cardholder authentication value for a Visa or MasterCard transaction is invalid.', 'reason' => 'The combination of authentication indicator and cardholder authentication value is invalid.' }, '71' => { 'notes' => 'The value submitted in x_bank_acct_type was invalid.', 'reason' => 'The bank account type is invalid.' }, '102' => { 'notes' => 'A password or transaction key was submitted with this WebLink request. This is a high security risk.', 'reason' => 'This request cannot be accepted.' }, '200' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The credit card number is invalid.', 'reason' => 'This transaction has been declined.' }, '18' => { 'notes' => 'The merchant does not accept electronic checks.', 'reason' => 'ACH transactions are not accepted by this merchant.' }, '16' => { 'notes' => 'The transaction ID sent in was properly formatted but the gateway had no record of the transaction.', 'reason' => 'The transaction was not found.' }, '44' => { 'notes' => 'The merchant would receive this error if the Card Code filter has been set in the Merchant Interface and the transaction received an error code from the processor that matched the rejection criteria set by the merchant.', 'reason' => 'This transaction has been declined.' }, '55' => { 'notes' => 'The transaction is rejected if the sum of this credit and prior credits exceeds the original debit amount.', 'reason' => 'The sum of credits against the referenced transaction would exceed the original debit amount.' }, '84' => { 'notes' => '', 'reason' => 'This reason code is reserved or not applicable to this API.' }, '27' => { 'notes' => '', 'reason' => 'The transaction resulted in an AVS mismatch. The address provided does not match billing address of cardholder.' }, '95' => { 'notes' => 'This code is applicable to Wells Fargo SecureSource merchants only.', 'reason' => 'A valid state is required.' }, '57' => { 'notes' => '', 'reason' => 'An error occurred in processing. Please try again in 5 minutes.' }, '220' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The primary CPU is not available.', 'reason' => 'This transaction has been declined.' }, '20' => { 'notes' => '', 'reason' => 'An error occurred during processing. Please try again in 5 minutes.' }, '243' => { 'notes' => 'The combination of values submitted for x_recurring_billing and x_echeck_type is not allowed.', 'reason' => 'Recurring billing is not allowed for this eCheck.Net type.' }, '109' => { 'notes' => 'Applicable only to eCheck. The values submitted for first name and last name failed validation.', 'reason' => 'This transaction is currently under review.' }, '89' => { 'notes' => '', 'reason' => 'This reason code is reserved or not applicable to this API.' }, '175' => { 'notes' => 'Concord EFS Ð This transaction is not allowed. The Concord EFS processing platform does not support voiding credit transactions. Please debit the credit card instead of voiding the credit.', 'reason' => 'The processor does not allow voiding of credits.' }, '31' => { 'notes' => 'The merchant was incorrectly set up at the processor.', 'reason' => 'The FDC Merchant ID or Terminal ID is incorrect. Call Merchant Service Provider.' }, '35' => { 'notes' => 'The merchant was incorrectly set up at the processor.', 'reason' => 'An error occurred during processing. Call Merchant Service Provider.' }, '11' => { 'notes' => 'A transaction with identical amount and credit card information was submitted two minutes prior.', 'reason' => 'A duplicate transaction has been submitted.' }, '208' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The merchant is not on file.', 'reason' => 'This transaction has been declined.' }, '78' => { 'notes' => 'The value submitted in x_card_code failed format validation.', 'reason' => 'The Card Code (CVV2/CVC2/CID) is invalid.' }, '93' => { 'notes' => 'This code is applicable to Wells Fargo SecureSource merchants only. Country is a required field and must contain the value of a supported country.', 'reason' => 'A valid country is required.' }, '106' => { 'notes' => 'Applicable only to eCheck. The value submitted for company failed validation.', 'reason' => 'This transaction is currently under review.' }, '65' => { 'notes' => 'The transaction was declined because the merchant configured their account through the Merchant Interface to reject transactions with certain values for a Card Code mismatch.', 'reason' => 'This transaction has been declined.' }, '29' => { 'notes' => '', 'reason' => 'The PaymentTech identification numbers are incorrect. Call Merchant Service Provider.' }, '203' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The value submitted in the amount field is invalid.', 'reason' => 'This transaction has been declined.' }, '261' => { 'notes' => 'The transaction experienced an error during sensitive data encryption and was not processed. Please try again.', 'reason' => 'An error occurred during processing. Please try again.' }, '58' => { 'notes' => '', 'reason' => 'An error occurred in processing. Please try again in 5 minutes.' }, '211' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The cardholder is not on file.', 'reason' => 'This transaction has been declined.' }, '15' => { 'notes' => 'The transaction ID value is non-numeric or was not present for a transaction that requires it (i.e., VOID, PRIOR_AUTH_CAPTURE, and CREDIT).', 'reason' => 'The transaction ID is invalid.' }, '81' => { 'notes' => 'The merchant requested an integration method not compatible with the AIM API.', 'reason' => 'The requested form type is invalid.' }, '60' => { 'notes' => '', 'reason' => 'An error occurred in processing. Please try again in 5 minutes.' }, '101' => { 'notes' => 'Applicable only to eCheck. The specified name on the account and/or the account type do not match the NOC record for this account.', 'reason' => 'The given name on the account and/or the account type does not match the actual account.' }, '73' => { 'notes' => 'The format of the value submitted in x_drivers_license_num was invalid.', 'reason' => 'The driverÕs license date of birth is invalid.' }, '86' => { 'notes' => '', 'reason' => 'This reason code is reserved or not applicable to this API.' }, '76' => { 'notes' => 'The value submitted in x_tax failed format validation.', 'reason' => 'The tax amount is invalid.' }, '62' => { 'notes' => '', 'reason' => 'An error occurred in processing. Please try again in 5 minutes.' }, '247' => { 'notes' => 'The combination of values submitted for x_type and x_echeck_type is not allowed.', 'reason' => 'This eCheck.Net type is not allowed.' }, '67' => { 'notes' => 'This error code is applicable to merchants using the Wells Fargo SecureSource product only. This product does not allow transactions of type CAPTURE_ONLY.', 'reason' => 'The given transaction type is not supported for this merchant.' }, '204' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The department code is invalid.', 'reason' => 'This transaction has been declined.' }, '165' => { 'notes' => 'The system-generated void for the original card code-rejected transaction failed.', 'reason' => 'This transaction has been declined.' }, '2' => { 'notes' => '', 'reason' => 'This transaction has been declined.' }, '17' => { 'notes' => 'The merchant was not configured to accept the credit card submitted in the transaction.', 'reason' => 'The merchant does not accept this type of credit card.' }, '110' => { 'notes' => 'Applicable only to eCheck. The value submitted for bank account name does not contain valid characters.', 'reason' => 'This transaction is currently under review.' }, '82' => { 'notes' => 'The system no longer supports version 2.5; requests cannot be posted to scripts.', 'reason' => 'Scripts are only supported in version 2.5.' }, '218' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The PIN block format or PIN availability value is invalid.', 'reason' => 'This transaction has been declined.' }, '202' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The transaction type is invalid.', 'reason' => 'This transaction has been declined.' }, '14' => { 'notes' => 'The Relay Response or Referrer URL does not match the merchantÕs configured value(s) or is absent. Applicable only to SIM and WebLink APIs.', 'reason' => 'The Referrer or Relay Response URL is invalid.' }, '112' => { 'notes' => 'This code is applicable to Wells Fargo SecureSource merchants only.', 'reason' => 'A valid billing state/province is required.' }, '69' => { 'notes' => 'The value submitted in x_type was invalid.', 'reason' => 'The transaction type is invalid.' }, '172' => { 'notes' => 'Concord EFS Ð The store ID is invalid.', 'reason' => 'An error occurred during processing. Please contact the merchant.' }, '145' => { 'notes' => 'The system-generated void for the original card code-rejected and AVS-rejected transaction failed.', 'reason' => 'This transaction has been declined.' }, '49' => { 'notes' => 'The transaction amount submitted was greater than the maximum amount allowed.', 'reason' => 'A transaction amount greater than $[amount] will not be accepted.' }, '24' => { 'notes' => '', 'reason' => 'The Nova Bank Number or Terminal ID is incorrect. Call Merchant Service Provider.' }, '224' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. Please re-enter the transaction.', 'reason' => 'This transaction has been declined.' }, '223' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. This transaction experienced an unspecified error.', 'reason' => 'This transaction has been declined.' }, '104' => { 'notes' => 'Applicable only to eCheck. The value submitted for country failed validation.', 'reason' => 'This transaction is currently under review.' }, '131' => { 'notes' => 'IFT: The payment gateway account status is Suspended-STA.', 'reason' => 'This transaction cannot be accepted at this time.' }, '181' => { 'notes' => 'The system-generated void for the original invalid transaction failed. (The original transaction included an invalid processor response format.)', 'reason' => 'An error occurred during processing. Please try again.' }, '121' => { 'notes' => 'The system-generated void for the original errored transaction failed. (The original transaction experienced a database error.)', 'reason' => 'An error occurred during processing. Please try again.' }, '79' => { 'notes' => 'The value submitted in x_drivers_license_num failed format validation.', 'reason' => 'The driverÕs license number is invalid.' }, '212' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The bank configuration is not on file', 'reason' => 'This transaction has been declined.' }, '23' => { 'notes' => '', 'reason' => 'An error occurred during processing. Please try again in 5 minutes.' }, '96' => { 'notes' => 'This code is applicable to Wells Fargo SecureSource merchants only. Country is a required field and must contain the value of a supported country.', 'reason' => 'This country is not authorized for buyers.' }, '251' => { 'notes' => 'The transaction was declined as a result of triggering a Fraud Detection Suite filter.', 'reason' => 'This transaction has been declined.' }, '253' => { 'notes' => 'The transaction was accepted and was authorized, but is being held for merchant review. The merchant may customize the customer response in the Merchant Interface.', 'reason' => 'Your order has been received. Thank you for your business!' }, '47' => { 'notes' => 'This occurs if the merchant tries to capture funds greater than the amount of the original authorization-only transaction.', 'reason' => 'The amount requested for settlement may not be greater than the original amount authorized.' }, '8' => { 'notes' => '', 'reason' => 'The credit card has expired.' }, '209' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. Communication with the processor could not be established.', 'reason' => 'This transaction has been declined.' }, '98' => { 'notes' => 'Applicable only to SIM API. The transaction fingerprint has already been used.', 'reason' => 'This transaction cannot be accepted.' }, '216' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The ATM term ID is invalid.', 'reason' => 'This transaction has been declined.' }, '37' => { 'notes' => '', 'reason' => 'The credit card number is invalid.' }, '117' => { 'notes' => 'This code is applicable only to merchants that include the x_cardholder_authentication_value in the transaction request. The CAVV for a Visa transaction; or the AVV/UCAF for a MasterCard transaction is invalid.', 'reason' => 'The cardholder authentication value is invalid.' }, '43' => { 'notes' => 'The merchant was incorrectly set up at the processor.', 'reason' => 'The merchant was incorrectly set up at the processor. Call your Merchant Service Provider.' }, '270' => { 'notes' => 'A value submitted in x_line_item for the item referenced is invalid.', 'reason' => 'The line item [item number] is invalid.' }, '5' => { 'notes' => 'The value submitted in the amount field did not pass validation for a number.', 'reason' => 'A valid amount is required.' }, '170' => { 'notes' => 'Concord EFS Ð Provisioning at the processor has not been completed.', 'reason' => 'An error occurred during processing. Please contact the merchant.' }, '33' => { 'notes' => 'The word FIELD will be replaced by an actual field name. This error indicates that a field the merchant specified as required was not filled in.', 'reason' => 'FIELD cannot be left blank.' }, '21' => { 'notes' => '', 'reason' => 'An error occurred during processing. Please try again in 5 minutes.' }, '63' => { 'notes' => '', 'reason' => 'An error occurred in processing. Please try again in 5 minutes.' }, '7' => { 'notes' => 'The format of the date submitted was incorrect.', 'reason' => 'The credit card expiration date is invalid.' }, '26' => { 'notes' => '', 'reason' => 'An error occurred during processing. Please try again in 5 minutes.' }, '80' => { 'notes' => 'The value submitted in x_drivers_license_state failed format validation.', 'reason' => 'The driverÕs license state is invalid.' }, '193' => { 'notes' => 'The transaction was placed under review by the risk management system.', 'reason' => 'The transaction is currently under review.' }, '119' => { 'notes' => 'This code is applicable only to merchants that include the x_authentication_indicator and x_recurring_billing in the transaction request. Transactions submitted with a value in x_authentication_indicator AND x_recurring_billing =YES will be rejected.', 'reason' => 'Transactions having cardholder authentication values cannot be marked as recurring.' }, '180' => { 'notes' => 'The processor response format is invalid.', 'reason' => 'An error occurred during processing. Please try again.' }, '99' => { 'notes' => 'Applicable only to SIM API. The server-generated fingerprint does not match the merchant-specified fingerprint in the x_fp_hash field.', 'reason' => 'This transaction cannot be accepted.' }, '244' => { 'notes' => 'The combination of values submitted for x_bank_acct_type and x_echeck_type is not allowed.', 'reason' => 'This eCheck.Net type is not allowed for this Bank Account Type.' }, '72' => { 'notes' => 'The value submitted in x_auth_code was more than six characters in length.', 'reason' => 'The authorization code is invalid.' }, '246' => { 'notes' => 'The merchantÕs payment gateway account is not enabled to submit the eCheck.Net type.', 'reason' => 'This eCheck.Net type is not allowed.' }, '74' => { 'notes' => 'The value submitted in x_duty failed format validation.', 'reason' => 'The duty amount is invalid.' }, '61' => { 'notes' => '', 'reason' => 'An error occurred in processing. Please try again in 5 minutes.' }, '108' => { 'notes' => 'Applicable only to eCheck. The values submitted for first name and last name failed validation.', 'reason' => 'This transaction is currently under review.' }, '92' => { 'notes' => '', 'reason' => 'The gateway no longer supports the requested method of integration.' }, '103' => { 'notes' => 'A valid fingerprint, transaction key, or password is required for this transaction.', 'reason' => 'This transaction cannot be accepted.' }, '201' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The expiration date is invalid.', 'reason' => 'This transaction has been declined.' }, '10' => { 'notes' => 'The value submitted in the x_bank_acct_num field did not pass validation.', 'reason' => 'The account number is invalid.' }, '152' => { 'notes' => 'The system-generated void for the original transaction failed. The response for the original transaction could not be communicated to the client.', 'reason' => 'The transaction was authorized, but the client could not be notified; the transaction will not be settled.' }, '207' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The merchant account is closed.', 'reason' => 'This transaction has been declined.' }, '91' => { 'notes' => '', 'reason' => 'Version 2.5 is no longer supported.' }, '48' => { 'notes' => 'The merchant attempted to settle for less than the originally authorized amount.', 'reason' => 'This processor does not accept partial reversals.' }, '107' => { 'notes' => 'Applicable only to eCheck. The value submitted for bank account name failed validation.', 'reason' => 'This transaction is currently under review.' }, '87' => { 'notes' => '', 'reason' => 'This reason code is reserved or not applicable to this API.' }, '174' => { 'notes' => 'Concord EFS Ð This transaction type is not accepted by the processor.', 'reason' => 'The transaction type is invalid. Please contact the merchant.' }, '77' => { 'notes' => 'The value submitted in x_customer_tax_id failed validation.', 'reason' => 'The SSN or tax ID is invalid.' }, '214' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. This function is currently unavailable.', 'reason' => 'This transaction has been declined.' }, '123' => { 'notes' => 'The transaction request must include the API login ID associated with the payment gateway account.', 'reason' => 'This account has not been given the permission(s) required for this request.' }, '221' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The SE number is invalid.', 'reason' => 'This transaction has been declined.' }, '50' => { 'notes' => 'Credits or refunds may only be performed against settled transactions. The transaction against which the credit/refund was submitted has not been settled, so a credit cannot be issued.', 'reason' => 'This transaction is awaiting settlement and cannot be refunded.' }, '39' => { 'notes' => '', 'reason' => 'The supplied currency code is either invalid, not supported, not allowed for this merchant or doesnÕt have an exchange rate.' }, '210' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The merchant type is incorrect.', 'reason' => 'This transaction has been declined.' }, '64' => { 'notes' => 'This error is applicable to Wells Fargo SecureSource merchants only. Credits or refunds cannot be issued against transactions that were not authorized.', 'reason' => 'The referenced transaction was not approved.' }, '97' => { 'notes' => 'Applicable only to SIM API. Fingerprints are only valid for a short period of time. This code indicates that the transaction fingerprint has expired.', 'reason' => 'This transaction cannot be accepted.' }, '12' => { 'notes' => 'A transaction that required x_auth_code to be present was submitted without a value.', 'reason' => 'An authorization code is required but not present.' }, '41' => { 'notes' => 'Only merchants set up for the FraudScreen.Net service would receive this decline. This code will be returned if a given transactionÕs fraud score is higher than the threshold set by the merchant.', 'reason' => 'This transaction has been declined.' }, '52' => { 'notes' => '', 'reason' => 'The transaction was authorized, but the client could not be notified; the transaction will not be settled.' }, '173' => { 'notes' => 'Concord EFS Ð The store key is invalid.', 'reason' => 'An error occurred during processing. Please contact the merchant.' }, '56' => { 'notes' => 'The merchant processes eCheck transactions only and does not accept credit cards.', 'reason' => 'This merchant accepts ACH transactions only; no credit card transactions are accepted.' }, '45' => { 'notes' => 'This error would be returned if the transaction received a code from the processor that matched the rejection criteria set by the merchant for both the AVS and Card Code filters.', 'reason' => 'This transaction has been declined.' }, '66' => { 'notes' => 'The transaction did not meet gateway security guidelines.', 'reason' => 'This transaction cannot be accepted for processing.' }, '19' => { 'notes' => '', 'reason' => 'An error occurred during processing. Please try again in 5 minutes.' }, '54' => { 'notes' => '', 'reason' => 'The referenced transaction does not meet the criteria for issuing a credit.' }, '70' => { 'notes' => 'The value submitted in x_method was invalid.', 'reason' => 'The transaction method is invalid.' }, '68' => { 'notes' => 'The value submitted in x_version was invalid.', 'reason' => 'The version parameter is invalid.' }, '1' => { 'notes' => '', 'reason' => 'This transaction has been approved.' }, '88' => { 'notes' => '', 'reason' => 'This reason code is reserved or not applicable to this API.' }, '116' => { 'notes' => 'This code is applicable only to merchants that include the x_authentication_indicator in the transaction request. The ECI value for a Visa transaction; or the UCAF indicator for a MasterCard transaction submitted in the x_authentication_indicator field is invalid.', 'reason' => 'The authentication indicator is invalid.' }, '30' => { 'notes' => '', 'reason' => 'The configuration with the processor is invalid. Call Merchant Service Provider.' }, '141' => { 'notes' => 'The system-generated void for the original FraudScreen-rejected transaction failed.', 'reason' => 'This transaction has been declined.' }, '100' => { 'notes' => 'Applicable only to eCheck. The value specified in the x_echeck_type field is invalid.', 'reason' => 'The eCheck type is invalid.' }, '222' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. Duplicate auth request (from INAS).', 'reason' => 'This transaction has been declined.' }, '25' => { 'notes' => '', 'reason' => 'An error occurred during processing. Please try again in 5 minutes.' }, '128' => { 'notes' => 'The customer\'s financial institution does not currently allow transactions for this account.', 'reason' => 'This transaction cannot be processed.' }, '252' => { 'notes' => 'The transaction was accepted, but is being held for merchant review. The merchant may customize the customer response in the Merchant Interface.', 'reason' => 'Your order has been received. Thank you for your business!' }, '28' => { 'notes' => 'The Merchant ID at the processor was not configured to accept this card type.', 'reason' => 'The merchant does not accept this type of credit card.' }, '120' => { 'notes' => 'The system-generated void for the original timed-out transaction failed. (The original transaction timed out while waiting for a response from the authorizer.)', 'reason' => 'An error occurred during processing. Please try again.' }, '40' => { 'notes' => '', 'reason' => 'This transaction must be encrypted.' }, '75' => { 'notes' => 'The value submitted in x_freight failed format validation.', 'reason' => 'The freight amount is invalid.' }, '83' => { 'notes' => 'The system no longer supports version 2.5; requests cannot be posted to scripts.', 'reason' => 'The requested script is either invalid or no longer supported.' }, '250' => { 'notes' => 'This transaction was submitted from a blocked IP address.', 'reason' => 'This transaction has been declined.' }, '59' => { 'notes' => '', 'reason' => 'An error occurred in processing. Please try again in 5 minutes.' }, '254' => { 'notes' => 'The transaction was declined after manual review.', 'reason' => 'Your transaction has been declined.' }, '215' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The encrypted PIN field format is invalid.', 'reason' => 'This transaction has been declined.' }, '271' => { 'notes' => 'The number of line items submitted in x_line_item exceeds the allowed maximum of 30.', 'reason' => 'The number of line items submitted is not allowed. A maximum of 30 line items can be submitted.' }, '130' => { 'notes' => 'IFT: The payment gateway account status is Blacklisted.', 'reason' => 'This payment gateway account has been closed.' }, '217' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. This transaction experienced a general message format problem.', 'reason' => 'This transaction has been declined.' }, '53' => { 'notes' => 'If x_method = ECHECK, x_type cannot be set to CAPTURE_ONLY.', 'reason' => 'The transaction type was invalid for ACH transactions.' }, '245' => { 'notes' => 'The value submitted for x_echeck_type is not allowed when using the payment gateway hosted payment form.', 'reason' => 'This eCheck.Net type is not allowed when using the payment gateway hosted payment form.' }, '122' => { 'notes' => 'The system-generated void for the original errored transaction failed. (The original transaction experienced a processing error.)', 'reason' => 'An error occurred during processing. Please try again.' }, '205' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The value submitted in the merchant number field is invalid.', 'reason' => 'This transaction has been declined.' }, '42' => { 'notes' => 'This is applicable only to merchants processing through the Wells Fargo SecureSource product who have requirements for transaction submission that are different from merchants not processing through Wells Fargo.', 'reason' => 'There is missing or invalid information in a required field.' }, '22' => { 'notes' => '', 'reason' => 'An error occurred during processing. Please try again in 5 minutes.' }, '219' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The ETC void is unmatched.', 'reason' => 'This transaction has been declined.' }, '46' => { 'notes' => '', 'reason' => 'Your session has expired or does not exist. You must log in to continue working.' }, '13' => { 'notes' => '', 'reason' => 'The merchant API login ID is invalid or the account is inactive.' }, '105' => { 'notes' => 'Applicable only to eCheck. The values submitted for city and country failed validation.', 'reason' => 'This transaction is currently under review.' }, '6' => { 'notes' => '', 'reason' => 'The credit card number is invalid.' }, '85' => { 'notes' => '', 'reason' => 'This reason code is reserved or not applicable to this API.' }, '185' => { 'notes' => '', 'reason' => 'This reason code is reserved or not applicable to this API.' }, '36' => { 'notes' => '', 'reason' => 'The authorization was approved, but settlement failed.' }, '3' => { 'notes' => '', 'reason' => 'This transaction has been declined.' }, '248' => { 'notes' => 'Invalid check number. Check number can only consist of letters and numbers and not more than 15 characters.', 'reason' => 'The check number is invalid.' }, '213' => { 'notes' => 'This error code applies only to merchants on FDC Omaha. The merchant assessment code is incorrect.', 'reason' => 'This transaction has been declined.' }, '94' => { 'notes' => 'This code is applicable to Wells Fargo SecureSource merchants only.', 'reason' => 'The shipping state or country is invalid.' }, '51' => { 'notes' => '', 'reason' => 'The sum of all credits against this transaction is greater than the original transaction amount.' }, '9' => { 'notes' => 'The value submitted in the x_bank_aba_code field did not pass validation or was not for a valid financial institution.', 'reason' => 'The ABA code is invalid.' }, '111' => { 'notes' => 'This code is applicable to Wells Fargo SecureSource merchants only.', 'reason' => 'A valid billing country is required.' }, '38' => { 'notes' => 'The merchant was incorrectly set up at the processor.', 'reason' => 'The Global Payment System identification numbers are incorrect. Call Merchant Service Provider.' }, '4' => { 'notes' => 'The code returned from the processor indicating that the card used needs to be picked up.', 'reason' => 'This transaction has been declined.' }, '34' => { 'notes' => 'The merchant was incorrectly set up at the processor.', 'reason' => 'The VITAL identification numbers are incorrect. Call Merchant Service Provider.' }, '132' => { 'notes' => 'IFT: The payment gateway account status is Suspended-Blacklist.', 'reason' => 'This transaction cannot be accepted at this time.' }, '171' => { 'notes' => 'Concord EFS Ð This request is invalid.', 'reason' => 'An error occurred during processing. Please contact the merchant.' } ); 1; Business-OnlinePayment-AuthorizeNet-3.23/README0000644000175000017500000000165012271327607020000 0ustar ivanivanCopyright (c) 1999 Jason Kohles. Copyright (c) 2002-2003 Ivan Kohler Copyright (c) 2006-2014 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::AuthorizeNet, an Business::OnlinePayment backend module for Authorize.Net. It is only useful if you have a merchant account with Authorize.Net: http://www.authorize.net This module has been updated and now implements Authorize.Net API version 3.1. Jason Kohles is the original author. Ivan Kohler is the current maintainer. Please send patches as unified diffs (diff -u). 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-AuthorizeNet-3.23/Changes0000644000175000017500000001445212635614050020412 0ustar ivanivanRevision history for Perl extension Business::OnlinePayment::AuthorizeNet. 3.23 Sun Dec 20 13:05:34 PST 2015 - Don't require libense_num / license_state / license_dob for E-Check transacitons; not a universal requirement. Patches from Craig Pearlman and Adi Fairbank, thanks! (closes: CPAN#110352) - Documentation: fix spelling errors, thanks to Xavier Guimard - Documentation: remove redundant/out-of-date AUTHORS section in AIM.pm - Documentation: add country and email fields to example (closes: CPAN#80337) - Documentation: update repo info 3.22 Mon Sep 26 15:06:52 PDT 2011 - Add missing t/lib/Business/FraudDetect/_Fake.pm to MANIFEST to fix tests. Patch from Rob Brown, thanks! (closes: CPAN#52444) - Incorporate Business::OnlinePayment::AuthorizeNet::AIM::ErrorCodes by Thomas Sibley and, using it, provide more descriptive error messages. (closes: CPAN#34362) - Switch to Business::OnlinePayment::HTTPS instead of using Net::SSLeay directly - Silence new warnings about lc(undef) introduced in perl 5.12. Patch from Todd Rinaldo, thanks! (closes: CPAN#56172) 3.21 Tue Nov 24 10:45:21 PST 2009 - Add repository, contributing and contirbutor information to the docs. - Patch from Nate Nuss implementing ("Additional Shipping Information (Level 2 Data)" ~pg 24 in the AIM guide): tax, freight, duty, tax_exempt, po_number. Thanks! (closes: CPAN#42046) - Patch from Michael Peters to fix a bug in email address handling: exclude x_Email_Customer flag when it is not specified in content, to avoid overriding admin settings. (closes: CPAN#51501) - Patch from Josh Rosenbaum to fix encapsulation problems. Thanks! (closes: CPAN#15210) - Clarified documentation wrt transaction key (closes: CPAN#23753) - ARB (recurring billing) fixes from John Springer, thanks! (closes: CPAN#48625) - Add META.yml 3.20 Wed Jun 18 16:46:10 PDT 2008 - Patch from Erik Hollensbe implementing card-present data (track1/track2) and the duplicate_window parameter, and test fixes. Thanks! - Patch from Paul Timmins adding check_number field. 3.19 Fri Nov 23 12:46:05 PST 2007 - ironically, forgot the 3.18 changelog, so this is 3.19 anyway :) 3.18 Fri Nov 23 10:55:44 PST 2007 - Patch From Steve Simitzis for better compatiblity with eProcessingNetwork's AuthorizeNet compatability mode. - added ARB support, rearranging code in the process (Jeff Finucane) 3.17 Tue Jul 10 21:12:46 PDT 2007 - Trim the extra 'ip_addr="1.2.3.4"' added by eProcessingNetwork's AuthorizeNet compatability mode. - add bank account type handling 3.16 Tue Nov 14 02:35:30 PST 2006 - Update link to API docs, now it is called "Advanced Integration Method (AIM)" - Update test account, separate ACH-capable one - patch to map ship_company properly to x_Ship_To_Company from Mike Barry - Documentation patch from William McKee From Michael G. Schwern : - Eliminate inheriting from AutoLoader. We're not using it and it just screws up the error messages. - account_type mentioned twice in the required fields for checks. - Quiet an uninit value warning when customer_org is not set. - Fix t/credit_card.t test to use a date 11 months in the future as the expiration date, and to print the error message on failure. - Update tests to use Test::More 3.15 Wed Mar 16 01:10:51 PST 2005 - Ask for ',' delimiter and '"' quote explicitly to prevent problems when a merchant has them configured differently. - expiration is not a required field for credits 3.14 Tue Sep 21 01:10:46 PDT 2004 - Added ship_ name/address fields - Fixed required fields for echeck voiding From T.J. Mather (closes: cpan#6761): - Added cvv2_response and cavv_response to get the cvv2 and cavv response codes back from authorize.net. - Added example of how to capture a transaction to the synopsis. - Added example of how to get the avs_code, cvv2_response, and cavv_response from the response 3.13 Sun Aug 10 21:56:34 PDT 2003 - removed Michael Mavroudis's email address - added 'void' action, patch from Yuri V. Mkrtumyan - allow "Post Authorize" with order_number but no card info, patch from Paul Zimmer - Don't require "check_type" field - s/x_Bank_Account_Name/x_Bank_Acct_Name/ for ACH transactions From Daemon Hughes : - add "transaction key" (x_Tran_Key) authentication in addition to password - add "recurring_billing" field - added "md5" method From valerian : - Added "avs_code" method - Return "order_number" for unsucessful transactions also 3.12 Thu Nov 21 17:05:19 2002 - Added cvv2 field, patch from T.J. Mather (closes: cpan#1805) - Added referer field, patch from Mike Barry - Added currency field, request from Oleksandr Kapitanenko - Added documentation about referrer field at Authorize.Net - Added nonascii.patch from "T.J. Mather" to put Text::CSV in binary mode to prevent problems with i18n characters (closes: cpan#1804) - ECHECK (ACH) patch from Michael Mavroudis to add fields for ssn and license # 3.11 Sat May 4 00:43:36 PDT 2002 - forgot 3.10 changelog in 3.10 :) - extremely verbose debugging information for responses without response code - PREREQ_PM on Business::OnlinePayment - Escape 0x00 (NULL) in responses from Authorize.Net. wtf? 3.10 Wed Mar 13 2002 - updated for Authorize.Net API 3.1 - enable t/credit_card.t test again; testing account seems to work - working Post Authorization support - s/CSV/CSV_XS/ 3.01 Wed Nov 14 13:42:06 2001 - update README - disable t/credit_card.t test; testdrive account no longer valid 3.00 Sat Sep 1 13:29:34 2001 - new maintainer, updated for Authorize.Net API 3.0 0.01 Sun Jul 25 16:37:11 1999 - original version; created by h2xs 1.19