From 5aedd8b05907cc42933165dae3d0ff5917043a8a Mon Sep 17 00:00:00 2001 From: khoff Date: Wed, 11 Apr 2007 20:41:41 +0000 Subject: [PATCH] Added environment variables for overriding HTML and developer serial numbers. Removed CVV2 info from tests. --- README | 4 ++++ t/bad_card_mc.t | 6 +++++- t/bad_card_visa.t | 6 +++++- t/credit_card_mc.t | 8 ++++++-- t/credit_card_visa.t | 6 +++++- t/crypt_bad_card_mc.t | 6 +++++- t/crypt_bad_card_visa.t | 6 +++++- t/crypt_credit_card_mc.t | 6 +++++- t/crypt_credit_card_visa.t | 6 +++++- t/return_card_mc.t | 12 ++++++++---- t/return_card_visa.t | 18 +++++++++++------- t/void_card_mc.t | 14 +++++++++----- t/void_card_visa.t | 12 ++++++++---- 13 files changed, 81 insertions(+), 29 deletions(-) diff --git a/README b/README index 5b15aa3..3b2cd98 100644 --- a/README +++ b/README @@ -21,3 +21,7 @@ online credit card processors, online check acceptance houses, etc. (If you like buzzwords, call it an "multiplatform ecommerce-enabling middleware solution"). +Environment variable recongnized by "make test": +sj_html_serial_number - HTML serial number +sj_devel_serial_number - Developer serial number (required for voids & credits) + diff --git a/t/bad_card_mc.t b/t/bad_card_mc.t index 5f6fc81..3791d1b 100644 --- a/t/bad_card_mc.t +++ b/t/bad_card_mc.t @@ -14,9 +14,13 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000944785470', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', diff --git a/t/bad_card_visa.t b/t/bad_card_visa.t index 6e869b2..a57f640 100644 --- a/t/bad_card_visa.t +++ b/t/bad_card_visa.t @@ -14,9 +14,13 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', diff --git a/t/credit_card_mc.t b/t/credit_card_mc.t index aa11a26..6d026e4 100644 --- a/t/credit_card_mc.t +++ b/t/credit_card_mc.t @@ -14,9 +14,13 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000944785470', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', @@ -36,7 +40,7 @@ $tx->submit(); if($tx->is_success()) { print "ok 1\n"; } else { - #warn $tx->server_response."\n"; + warn $tx->server_response."\n"; warn $tx->error_message. "\n"; print "not ok 1\n"; } diff --git a/t/credit_card_visa.t b/t/credit_card_visa.t index 79a27b1..3e57380 100644 --- a/t/credit_card_visa.t +++ b/t/credit_card_visa.t @@ -14,9 +14,13 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', diff --git a/t/crypt_bad_card_mc.t b/t/crypt_bad_card_mc.t index 2339591..394a3bb 100644 --- a/t/crypt_bad_card_mc.t +++ b/t/crypt_bad_card_mc.t @@ -18,9 +18,13 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000944785470', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', diff --git a/t/crypt_bad_card_visa.t b/t/crypt_bad_card_visa.t index b618670..15ea208 100644 --- a/t/crypt_bad_card_visa.t +++ b/t/crypt_bad_card_visa.t @@ -18,9 +18,13 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', diff --git a/t/crypt_credit_card_mc.t b/t/crypt_credit_card_mc.t index fca30ab..aa2473c 100644 --- a/t/crypt_credit_card_mc.t +++ b/t/crypt_credit_card_mc.t @@ -18,9 +18,13 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000944785470', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', diff --git a/t/crypt_credit_card_visa.t b/t/crypt_credit_card_visa.t index 80fc5bb..146ab2c 100644 --- a/t/crypt_credit_card_visa.t +++ b/t/crypt_credit_card_visa.t @@ -18,9 +18,13 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', diff --git a/t/return_card_mc.t b/t/return_card_mc.t index 75e2af7..a52c8d0 100644 --- a/t/return_card_mc.t +++ b/t/return_card_mc.t @@ -14,15 +14,19 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000944785470', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', card_number => '5121212121212124', expiration => '03/10', - cvv2 => '999', + #cvv2 => '999', name => 'Tofu Beast', address => '8320', city => 'Anywhere', @@ -48,8 +52,8 @@ my $cr_tx = new Business::OnlinePayment("Skipjack"); $cr_tx->content( type => 'VISA', - login => '000944785470', # "HTML serial number" - password => '100594217288', # "developer serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Credit', description => 'Business::OnlinePayment::Skipjack test', amount => 11, diff --git a/t/return_card_visa.t b/t/return_card_visa.t index c717d79..354257e 100644 --- a/t/return_card_visa.t +++ b/t/return_card_visa.t @@ -14,9 +14,13 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', @@ -48,8 +52,8 @@ my $pa_tx = new Business::OnlinePayment("Skipjack"); $pa_tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" - password => '100594217288', # "developer serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Post Authorization', description => 'Business::OnlinePayment::Skipjack test', order_number => $tx->order_number(), @@ -76,8 +80,8 @@ my $st_tx = new Business::OnlinePayment("Skipjack"); $st_tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" - password => '100594217288', # "developer serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Status', description => 'Business::OnlinePayment::Skipjack test', order_number => $tx->order_number(), @@ -106,8 +110,8 @@ my $cr_tx = new Business::OnlinePayment("Skipjack"); $cr_tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" - password => '100594217288', # "developer serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Credit', description => 'Business::OnlinePayment::Skipjack test', amount => 11, diff --git a/t/void_card_mc.t b/t/void_card_mc.t index 2749466..34cf56a 100644 --- a/t/void_card_mc.t +++ b/t/void_card_mc.t @@ -14,15 +14,19 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000944785470', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', card_number => '5121212121212124', expiration => '03/10', - cvv2 => '999', + #cvv2 => '123', name => 'Tofu Beast', address => '8320', city => 'Anywhere', @@ -46,8 +50,8 @@ my $v_tx = new Business::OnlinePayment("Skipjack"); $v_tx->content( type => 'VISA', - login => '000944785470', # "HTML serial number" - password => '100594217288', # "developer serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Void', description => 'Business::OnlinePayment::Skipjack test', order_number => $tx->order_number(), @@ -60,7 +64,7 @@ if($v_tx->is_success()) { print "ok 2\n"; } else { #warn $v_tx->server_response."\n"; - warn $v_tx->error_message. "\n"; + #warn $v_tx->error_message. "\n"; print "not ok 2\n"; } diff --git a/t/void_card_visa.t b/t/void_card_visa.t index 451278a..c876bb4 100644 --- a/t/void_card_visa.t +++ b/t/void_card_visa.t @@ -14,15 +14,19 @@ my $tx = new Business::OnlinePayment("Skipjack"); #$Business::OnlinePayment::Skipjack::DEBUG = 1; #$Business::OnlinePayment::Skipjack::DEBUG = 1; +my $login = $ENV{'sj_html_serial_number'} || '000944785470'; +my $password = $ENV{'sj_devel_serial_number'} || '100594217288'; + $tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Normal Authorization', description => 'Business::OnlinePayment::Skipjack test', amount => '32', card_number => '4445999922225', expiration => '03/10', - cvv2 => '999', + #cvv2 => '123', name => 'Tofu Beast', address => '8320', city => 'Anywhere', @@ -46,8 +50,8 @@ my $v_tx = new Business::OnlinePayment("Skipjack"); $v_tx->content( type => 'VISA', - login => '000368452762', # "HTML serial number" - password => '100594217288', # "developer serial number" + login => $login, # "HTML serial number" + password => $password, # "Developer serial number" action => 'Void', description => 'Business::OnlinePayment::Skipjack test', order_number => $tx->order_number(), -- 2.11.0