summaryrefslogtreecommitdiff
path: root/LedgerSMB/CreditCard
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-04 04:15:49 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-10-04 04:15:49 +0000
commit10b34f429e923930d1c874c7c54ea0b7f49aa114 (patch)
tree7c592a0d526137260ecea7efef2306f96ccc9b09 /LedgerSMB/CreditCard
parent439abe733651aed7d48d4377c9a337ad04c624a9 (diff)
Minor bugs fixed in credit card processing
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@189 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/CreditCard')
-rw-r--r--LedgerSMB/CreditCard/TrustCommerce.pm15
-rw-r--r--LedgerSMB/CreditCard/TrustCommerce/Config.pm11
2 files changed, 17 insertions, 9 deletions
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;