[freeside-commits] branch master updated. 7d8aea452e6d4090d6c97acce0b6bde0f1dccac1

Jonathan Prykop jonathan at 420.am
Mon May 2 19:45:08 PDT 2016


The branch, master has been updated
       via  7d8aea452e6d4090d6c97acce0b6bde0f1dccac1 (commit)
      from  f8b1ee4818c40fa7cbc7dd060efb24df87c1669c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7d8aea452e6d4090d6c97acce0b6bde0f1dccac1
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Mon May 2 21:44:40 2016 -0500

    RT#37632 Credit card validation [bug fixes]

diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index b892e97..bbf86a5 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -1932,8 +1932,10 @@ sub realtime_verify_bop {
                                 );
 
     $reverse->content( 'action'        => 'Reverse Authorization',
+                       $self->_bop_auth(\%options),          
 
                        # B:OP
+                       'amount'        => '1.00',
                        'authorization' => $transaction->authorization,
                        'order_number'  => $ordernum,
 
diff --git a/FS/FS/cust_payby.pm b/FS/FS/cust_payby.pm
index ec4eb7a..50d9ee0 100644
--- a/FS/FS/cust_payby.pm
+++ b/FS/FS/cust_payby.pm
@@ -636,7 +636,21 @@ sub verify {
 
   my %opt = ();
 
-  $opt{$_} = $self->$_() for qw( payinfo payname paydate );
+  # false laziness with check
+  my( $m, $y );
+  if ( $self->paydate =~ /^(\d{1,2})[\/\-](\d{2}(\d{2})?)$/ ) {
+    ( $m, $y ) = ( $1, length($2) == 4 ? $2 : "20$2" );
+  } elsif ( $self->paydate =~ /^19(\d{2})[\/\-](\d{1,2})[\/\-]\d+$/ ) {
+    ( $m, $y ) = ( $2, "19$1" );
+  } elsif ( $self->paydate =~ /^(20)?(\d{2})[\/\-](\d{1,2})[\/\-]\d+$/ ) {
+    ( $m, $y ) = ( $3, "20$2" );
+  } else {
+    return "Illegal expiration date: ". $self->paydate;
+  }
+  $m = sprintf('%02d',$m);
+  $opt{paydate} = "$y-$m-01";
+
+  $opt{$_} = $self->$_() for qw( payinfo payname paycvv );
 
   if ( $self->locationnum ) {
     my $cust_location = $self->cust_location;

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main/Billing_Realtime.pm |    2 ++
 FS/FS/cust_payby.pm                 |   16 +++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list