[freeside-commits] freeside/FS/FS pay_batch.pm, 1.15, 1.16 Conf.pm, 1.327, 1.328
Mark Wells
mark at wavetail.420.am
Sat Oct 24 16:37:44 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv18411/FS/FS
Modified Files:
pay_batch.pm Conf.pm
Log Message:
Scripts for paymentech batch transfer
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.327
retrieving revision 1.328
diff -u -d -r1.327 -r1.328
--- Conf.pm 24 Oct 2009 00:34:34 -0000 1.327
+++ Conf.pm 24 Oct 2009 23:37:42 -0000 1.328
@@ -2451,7 +2451,7 @@
{
'key' => 'batchconfig-paymentech',
'section' => 'billing',
- 'description' => 'Configuration for Chase Paymentech batching, four lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username',
+ 'description' => 'Configuration for Chase Paymentech batching, four lines: 1. BIN, 2. Terminal ID, 3. Merchant ID, 4. Username, 5. Password',
'type' => 'textarea',
},
Index: pay_batch.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/pay_batch.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- pay_batch.pm 3 Oct 2009 20:22:19 -0000 1.15
+++ pay_batch.pm 24 Oct 2009 23:37:41 -0000 1.16
@@ -196,7 +196,7 @@
or die "unknown format $format";
my $filetype = $info->{'filetype'}; # CSV or fixed
- my @fields = @{ $info->{'fields'} };
+ my @fields = @{ $info->{'fields'}};
my $formatre = $info->{'formatre'}; # for fixed
my @all_values;
my $begin_condition = $info->{'begin_condition'};
@@ -256,7 +256,7 @@
}
$rows = [ $rows ] if ref($rows) ne 'ARRAY';
foreach my $row (@$rows) {
- push @all_values, [ @{$row}{@xmlkeys} ];
+ push @all_values, [ @{$row}{@xmlkeys}, $row ];
}
}
else {
@@ -269,9 +269,9 @@
$dbh->rollback if $oldAutoCommit;
return "can't parse: ". $csv->error_input();
};
- push @all_values, [ $csv->fields() ];
+ push @all_values, [ $csv->fields(), $line ];
}elsif ($filetype eq 'fixed'){
- my @values = $line =~ /$formatre/;
+ my @values = ( $line =~ /$formatre/, $line );
unless (@values) {
$dbh->rollback if $oldAutoCommit;
return "can't parse: ". $line;
@@ -288,15 +288,20 @@
my @values = @$_;
my %hash;
+ my $line = pop @values;
foreach my $field ( @fields ) {
my $value = shift @values;
next unless $field;
$hash{$field} = $value;
}
- if ( defined($end_condition) and &{$end_condition}(\%hash) ) {
+ if ( defined($begin_condition) and &{$begin_condition}(\%hash, $line)) {
+ undef $begin_condition;
+ }
+
+ if ( defined($end_condition) and &{$end_condition}(\%hash, $line) ) {
my $error;
- $error = &{$end_hook}(\%hash, $total) if defined($end_hook);
+ $error = &{$end_hook}(\%hash, $total, $line) if defined($end_hook);
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;
More information about the freeside-commits
mailing list