diff options
-rw-r--r-- | LedgerSMB/CreditCard.pm | 2 | ||||
-rw-r--r-- | LedgerSMB/CreditCard/TrustCommerce.pm | 15 | ||||
-rw-r--r-- | LedgerSMB/CreditCard/TrustCommerce/Config.pm | 11 |
3 files changed, 19 insertions, 9 deletions
diff --git a/LedgerSMB/CreditCard.pm b/LedgerSMB/CreditCard.pm index fdd6711a..d924ce53 100644 --- a/LedgerSMB/CreditCard.pm +++ b/LedgerSMB/CreditCard.pm @@ -22,3 +22,5 @@ BEGIN { import $gateway_module qw(sale credit); } +1; + diff --git a/LedgerSMB/CreditCard/TrustCommerce.pm b/LedgerSMB/CreditCard/TrustCommerce.pm index b57d2f7a..e0adb395 100644 --- a/LedgerSMB/CreditCard/TrustCommerce.pm +++ b/LedgerSMB/CreditCard/TrustCommerce.pm @@ -16,16 +16,14 @@ # Simple TrustCommerce API using Net::TCLink package TrustCommerce; -use LedgerSMB::CreditCard::TrustCommerce::Config (); -use LedgerSMB::CreditCard::Config (); +use LedgerSMB::CreditCard::Config; +use LedgerSMB::CreditCard::TrustCommerce::Config; use Net::TCLink; -%baseparams = ${Config::baseparams}; -$debug = ${Config::debug}; +$debug = $1; sub sale { $form = shift @_; - my %params = %baseparams; $params{action} = 'sale'; $params{amount} = $form->{amount} * 100; $params{track1} = $form->{track1}; @@ -34,6 +32,9 @@ sub sale { } sub process { + for (keys %params){ + print "$_= ".$params{$_}."\n"; + } my %result = Net::TCLink::send(\%params); $form->{status} = $result{status}; if ($result{status} eq 'decline'){ @@ -47,10 +48,12 @@ sub process { "$result{errortype}\n"; if ($debug){ print STDERR "Full Result:\n"; + for (keys %result){ - print "$_= ".$result{$_}."\n"; + print STDERR "$_= ".$result{$_}."\n"; } } + %result; } diff --git a/LedgerSMB/CreditCard/TrustCommerce/Config.pm b/LedgerSMB/CreditCard/TrustCommerce/Config.pm index 9596d7e7..bbe707be 100644 --- a/LedgerSMB/CreditCard/TrustCommerce/Config.pm +++ b/LedgerSMB/CreditCard/TrustCommerce/Config.pm @@ -15,8 +15,13 @@ # TrustCommerce configuration Information goes Here -package CreditCard::TrustCommerce::Config; +package TrustCommerce; -%baseparams = ( customer_id => 'MyCustomerID', - password => 'MyPassword' + +%baseparams = ( custid => '000000', + password => 'password', ); + +$debug = 0; + +1; |