chase canada E-xactBatch
authorjeff <jeff>
Fri, 1 Dec 2006 06:31:55 +0000 (06:31 +0000)
committerjeff <jeff>
Fri, 1 Dec 2006 06:31:55 +0000 (06:31 +0000)
FS/FS/Conf.pm
FS/FS/cust_pay_batch.pm
httemplate/misc/download-batch.cgi
httemplate/search/cust_pay_batch.cgi

index 639f06b..566d8e8 100644 (file)
@@ -1865,7 +1865,8 @@ httemplate/docs/config.html
     'section'     => 'billing',
     'description' => 'Default format for batches.',
     'type'        => 'select',
-    'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ]
+    'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch',
+                       'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
   },
 
   {
@@ -1873,7 +1874,8 @@ httemplate/docs/config.html
     'section'     => 'billing',
     'description' => 'Fixed (unchangeable) format for credit card batches.',
     'type'        => 'select',
-    'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ]
+    'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP' ,
+                       'csv-chase_canada-E-xactBatch', 'BoM', 'PAP' ]
   },
 
   {
index 1eeabb6..c9a5468 100644 (file)
@@ -346,6 +346,56 @@ sub import_results {
     };
 
 
+  }elsif ( $format eq 'csv-chase_canada-E-xactBatch' ) {
+
+    $filetype = "CSV";
+
+    @fields = (
+      '',            # Internal(bank) id of the transaction
+      '',            # Transaction Type:  00 - purchase,      01 - preauth,
+                     #                    02 - completion,    03 - forcepost,
+                     #                    04 - refund,        05 - auth,
+                     #                    06 - purchase corr, 07 - refund corr,
+                     #                    08 - void           09 - void return
+      '',            # gateway used to process this transaction
+      'paid',        # Amount:  Amount of the transaction.  Dollars and cents
+                     #          with decimal entered.
+      'auth',        # Auth#:  Authorization number (if approved)
+      'payinfo',     # Card Number:  Card number for the transaction
+      '',            # Expiry Date:  Expiry date of the card
+      '',            # Cardholder Name
+      'bankcode',    # Bank response code (3 alphanumeric)
+      'bankmess',    # Bank response message
+      'etgcode',     # ETG response code (2 alphanumeric)
+      'etgmess',     # ETG response message
+      '',            # Returned customer number for the transaction
+      'paybatchnum', # Reference#:  paybatch number of the transaction
+      '',            # Reference#:  Invoice number of the transaction
+      'result',      # Processing Result: Approved of Declined
+    );
+
+    $end_condition = sub {
+      '';
+    };
+
+    $hook = sub {
+      my $hash = shift;
+      $hash->{'paid'} = sprintf("%.2f", $hash->{'paid'}); #hmmmm
+      $hash->{'_date'} = time;  # got a better one?
+    };
+
+    $approved_condition = sub {
+      my $hash = shift;
+      $hash->{'etgcode'} eq '00' && $hash->{'result'} eq "Approved";
+    };
+
+    $declined_condition = sub {
+      my $hash = shift;
+      $hash->{'etgcode'} ne '00' # internal processing error
+        || ( $hash->{'result'} eq "Declined" );
+    };
+
+
   }elsif ( $format eq 'PAP' ) {
 
     $filetype = "Fixed264";
index 038aa20..a1e7b5c 100644 (file)
@@ -40,6 +40,8 @@
 %my $jdate = sprintf("%03d", $date[5] % 100).sprintf("%03d", $date[7] + 1);
 %my $cdate = sprintf("%02d", $date[3]).sprintf("%02d", $date[4] + 1).
 %            sprintf("%02d", $date[5] % 100);
+%my $sdate = sprintf("%02d", $date[5] % 100).'/'.sprintf("%02d", $date[4] + 1).
+%            '/'.sprintf("%02d", $date[3]);
 %
 %if ($format eq "BoM") {
 %
 %
 %}elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){
 %#  1;
+%}elsif ($format eq "csv-chase_canada-E-xactBatch"){
+%
+%  my($origid) = $conf->config("batchconfig-$format");
+<% sprintf( '$$E-xactBatchFileV1.0$$%s:%03u$$%s',$sdate,$pay_batch->batchnum, $origid)
+  %>
+%
 %}else{
 %  die "Unknown format for batch in batchconfig. \n";
 %}
 ,,,,<% $cust_pay_batch->payinfo %>,<% $exp %>,<% $cust_pay_batch->amount %>,<% $cust_pay_batch->paybatchnum %>
 %
 %
+%  } elsif ($format eq "csv-chase_canada-E-xactBatch"){
+%
+%    
+<% $cust_pay_batch->paybatchnum %>,<% $cust_pay_batch->custnum %>,<% $cust_pay_batch->invnum %>,"<% $cust_pay_batch->payname %>",01,<% $cust_pay_batch->payinfo %>,<% $cust_pay_batch->amount %>,<% $exp %>,,
+%
+%
 %  } else {
 %    die "I'm already dead, but you did not know that.\n";
 %  }
 %
 %} elsif ($format eq "csv-td_canada_trust-merchant_pc_batch"){
 %  #1;
+%} elsif ($format eq "csv-chase_canada-E-xactBatch"){
+%  #1;
 %} else {
 %  die "I'm already dead (again), but you did not know that.\n";
 %}
index d12e3c4..b2354b2 100755 (executable)
@@ -62,6 +62,7 @@
 %      $html_init .= qq!Download batch in format <SELECT NAME="format">!.
 %                    qq!<OPTION VALUE="">Default batch mode</OPTION>!.
 %                    qq!<OPTION VALUE="csv-td_canada_trust-merchant_pc_batch">CSV file for TD Canada Trust Merchant PC Batch</OPTION>!.
+%                    qq!<OPTION VALUE="csv-chase_canada-E-xactBatch">CSV file for Chase Canada E-xactBatch</OPTION>!.
 %                    qq!<OPTION VALUE="PAP">80 byte file for TD Canada Trust PAP Batch</OPTION>!.
 %                    qq!<OPTION VALUE="BoM">Bank of Montreal ECA batch</OPTION>!.
 %                    qq!</SELECT>!;
@@ -84,6 +85,7 @@
 %      $html_init .= qq!Format <SELECT NAME="format">!.
 %                    qq!<OPTION VALUE="">Default batch mode</OPTION>!.
 %                    qq!<OPTION VALUE="csv-td_canada_trust-merchant_pc_batch">CSV results from TD Canada Trust Merchant PC Batch</OPTION>!.
+%                    qq!<OPTION VALUE="csv-chase_canada-E-xactBatch">CSV file for Chase Canada E-xactBatch</OPTION>!.
 %                    qq!<OPTION VALUE="PAP">264 byte results for TD Canada Trust PAP Batch</OPTION>!.
 %                    qq!<OPTION VALUE="BoM">Bank of Montreal ECA results</OPTION>!.
 %                    qq!</SELECT><BR>!;