summaryrefslogtreecommitdiff
path: root/LedgerSMB/CreditCard
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-26 18:00:56 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-26 18:00:56 +0000
commit666fd833584fe2e3618a397fe9d9a9bdf4c5b94b (patch)
tree19c4444705fd7f7803e0d7b597659c11d7e85b73 /LedgerSMB/CreditCard
parent2edd2e4de0f08a0a5f23647ea715f279671a0b89 (diff)
Doing a simple Perltidy commit so that I can evaluate differences between the branches and make sure patches are up to date
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1103 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/CreditCard')
-rw-r--r--LedgerSMB/CreditCard/Config.pm4
-rw-r--r--LedgerSMB/CreditCard/TrustCommerce.pm96
-rw-r--r--LedgerSMB/CreditCard/TrustCommerce/Config.pm9
3 files changed, 54 insertions, 55 deletions
diff --git a/LedgerSMB/CreditCard/Config.pm b/LedgerSMB/CreditCard/Config.pm
index 199431c0..c8b30758 100644
--- a/LedgerSMB/CreditCard/Config.pm
+++ b/LedgerSMB/CreditCard/Config.pm
@@ -1,6 +1,6 @@
#=====================================================================
-# LedgerSMB
+# LedgerSMB
# Small Medium Business Accounting software
# http://www.ledgersmb.org/
# Copyright (C) 2006
@@ -18,6 +18,6 @@
package Config;
$gateway_module = "TrustCommerce";
-$debug = 0; # Debugging off by default
+$debug = 0; # Debugging off by default
1;
diff --git a/LedgerSMB/CreditCard/TrustCommerce.pm b/LedgerSMB/CreditCard/TrustCommerce.pm
index e0adb395..634af8f2 100644
--- a/LedgerSMB/CreditCard/TrustCommerce.pm
+++ b/LedgerSMB/CreditCard/TrustCommerce.pm
@@ -1,6 +1,6 @@
#=====================================================================
-# LedgerSMB
+# LedgerSMB
# Small Medium Business Accounting software
# http://www.ledgersmb.org/
# Copyright (C) 2006
@@ -23,63 +23,63 @@ use Net::TCLink;
$debug = $1;
sub sale {
- $form = shift @_;
- $params{action} = 'sale';
- $params{amount} = $form->{amount} * 100;
- $params{track1} = $form->{track1};
- $params{track2} = $form->{track2};
- &process;
+ $form = shift @_;
+ $params{action} = 'sale';
+ $params{amount} = $form->{amount} * 100;
+ $params{track1} = $form->{track1};
+ $params{track2} = $form->{track2};
+ &process;
}
sub process {
- for (keys %params){
- print "$_= ".$params{$_}."\n";
- }
- my %result = Net::TCLink::send(\%params);
- $form->{status} = $result{status};
- if ($result{status} eq 'decline'){
- $form->{declinetype} = $result{declinetype};
- $form->{declinemsg} = $declinemsg{$result{declinetype}};
- }
- $form->{ccauth} = $result{transID};
- # log transID and status
- print STDERR "Info: TCLink CC AUTH transID $result{transid} returned ".
- "status $result{status}:$result{declinetype}:$result{baddata}:".
- "$result{errortype}\n";
- if ($debug){
- print STDERR "Full Result:\n";
+ for ( keys %params ) {
+ print "$_= " . $params{$_} . "\n";
+ }
+ my %result = Net::TCLink::send( \%params );
+ $form->{status} = $result{status};
+ if ( $result{status} eq 'decline' ) {
+ $form->{declinetype} = $result{declinetype};
+ $form->{declinemsg} = $declinemsg{ $result{declinetype} };
+ }
+ $form->{ccauth} = $result{transID};
- for (keys %result){
- print STDERR "$_= ".$result{$_}."\n";
- }
- }
-
- %result;
+ # log transID and status
+ print STDERR "Info: TCLink CC AUTH transID $result{transid} returned "
+ . "status $result{status}:$result{declinetype}:$result{baddata}:"
+ . "$result{errortype}\n";
+ if ($debug) {
+ print STDERR "Full Result:\n";
+
+ for ( keys %result ) {
+ print STDERR "$_= " . $result{$_} . "\n";
+ }
+ }
+
+ %result;
}
sub credit {
- $form = shift @_;
- my %params = %baseparams;
- $params{transid} = $form->{transid};
- $params{amount} = $form->{amount};
- &process;
+ $form = shift @_;
+ my %params = %baseparams;
+ $params{transid} = $form->{transid};
+ $params{amount} = $form->{amount};
+ &process;
}
-
%declinemsg = (
- decline => 'Transaction declined by bank',
- avs => 'AVS failed: Address and/or Zip mismatch',
- cvv => 'CVV2 Failure: Check the CVV2 number and try again',
- call => 'Call customer service number on card to get authcode',
- expiredcard => 'This card has expired',
- carderror => 'This card number is invalid.',
- authexpired => 'The authorization expired. Can not postauth.',
- fraud => 'CrediGuard Fraud Score exceeded desired threshold',
- blacklist => 'CrediGuard Declined: blacklisted this transaction.',
- velocity => 'Crediguard declined: Too many transactions',
- dailylimit => 'Too many transactions in a day.',
- weeklylimit => 'Too many transactions in a week',
- monthlylimit => 'Too many transactions in a month'
+ decline => 'Transaction declined by bank',
+ avs => 'AVS failed: Address and/or Zip mismatch',
+ cvv => 'CVV2 Failure: Check the CVV2 number and try again',
+ call => 'Call customer service number on card to get authcode',
+ expiredcard => 'This card has expired',
+ carderror => 'This card number is invalid.',
+ authexpired => 'The authorization expired. Can not postauth.',
+ fraud => 'CrediGuard Fraud Score exceeded desired threshold',
+ blacklist => 'CrediGuard Declined: blacklisted this transaction.',
+ velocity => 'Crediguard declined: Too many transactions',
+ dailylimit => 'Too many transactions in a day.',
+ weeklylimit => 'Too many transactions in a week',
+ monthlylimit => 'Too many transactions in a month'
);
1;
diff --git a/LedgerSMB/CreditCard/TrustCommerce/Config.pm b/LedgerSMB/CreditCard/TrustCommerce/Config.pm
index bbe707be..86d026d8 100644
--- a/LedgerSMB/CreditCard/TrustCommerce/Config.pm
+++ b/LedgerSMB/CreditCard/TrustCommerce/Config.pm
@@ -1,5 +1,5 @@
#=====================================================================
-# LedgerSMB
+# LedgerSMB
# Small Medium Business Accounting software
# http://www.ledgersmb.org/
# Copyright (C) 2006
@@ -14,12 +14,11 @@
#
# TrustCommerce configuration Information goes Here
-
package TrustCommerce;
-
-%baseparams = ( custid => '000000',
- password => 'password',
+%baseparams = (
+ custid => '000000',
+ password => 'password',
);
$debug = 0;