Skip to content

Commit

Permalink
Doing a simple Perltidy commit so that I can evaluate differences bet…
Browse files Browse the repository at this point in the history
…ween the branches and make sure patches are up to date

git-svn-id: svn://svn.code.sf.net/p/ledger-smb/code/trunk@1103 4979c152-3d1c-0410-bac9-87ea11338e46
  • Loading branch information
einhverfr committed Apr 26, 2007
1 parent 445b5d8 commit fba81f4
Show file tree
Hide file tree
Showing 100 changed files with 51,777 additions and 45,603 deletions.
734 changes: 370 additions & 364 deletions LedgerSMB.pm

Large diffs are not rendered by default.

1,580 changes: 808 additions & 772 deletions LedgerSMB/AA.pm

Large diffs are not rendered by default.

1,975 changes: 994 additions & 981 deletions LedgerSMB/AM.pm

Large diffs are not rendered by default.

516 changes: 260 additions & 256 deletions LedgerSMB/BP.pm

Large diffs are not rendered by default.

596 changes: 299 additions & 297 deletions LedgerSMB/CA.pm

Large diffs are not rendered by default.

935 changes: 463 additions & 472 deletions LedgerSMB/CP.pm

Large diffs are not rendered by default.

1,417 changes: 708 additions & 709 deletions LedgerSMB/CT.pm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions LedgerSMB/Contact.pm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

=head1 NAME
LedgerSMB::Contact - LedgerSMB class for managing Contacts
Expand Down
3 changes: 2 additions & 1 deletion LedgerSMB/CreditCard.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=====================================================================
# LedgerSMB
# LedgerSMB
# Small Medium Business Accounting software
# http://www.ledgersmb.org/
# Copyright (C) 2006
Expand All @@ -19,6 +19,7 @@ use LedgerSMB;
use LedgerSMB::DBObject;

our @ISA qw(LedgerSMB::DBObject);

# use LedgerSMB::CreditCard::Config; # moving elsewhere

## TODO: Add code for credit card number validation and the like
Expand Down
4 changes: 2 additions & 2 deletions LedgerSMB/CreditCard/Config.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#=====================================================================
# LedgerSMB
# LedgerSMB
# Small Medium Business Accounting software
# http://www.ledgersmb.org/
# Copyright (C) 2006
Expand All @@ -18,6 +18,6 @@
package Config;

$gateway_module = "TrustCommerce";
$debug = 0; # Debugging off by default
$debug = 0; # Debugging off by default

1;
96 changes: 48 additions & 48 deletions LedgerSMB/CreditCard/TrustCommerce.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#=====================================================================
# LedgerSMB
# LedgerSMB
# Small Medium Business Accounting software
# http://www.ledgersmb.org/
# Copyright (C) 2006
Expand All @@ -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;
9 changes: 4 additions & 5 deletions LedgerSMB/CreditCard/TrustCommerce/Config.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=====================================================================
# LedgerSMB
# LedgerSMB
# Small Medium Business Accounting software
# http://www.ledgersmb.org/
# Copyright (C) 2006
Expand All @@ -14,12 +14,11 @@
#
# TrustCommerce configuration Information goes Here


package TrustCommerce;


%baseparams = ( custid => '000000',
password => 'password',
%baseparams = (
custid => '000000',
password => 'password',
);

$debug = 0;
Expand Down
Loading

0 comments on commit fba81f4

Please sign in to comment.