[freeside-commits] branch FREESIDE_4_BRANCH updated. 57aed0231a284b2ce96e5fcc76a183f73b7e21ab

Jonathan Prykop jonathan at 420.am
Tue May 3 22:34:17 PDT 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  57aed0231a284b2ce96e5fcc76a183f73b7e21ab (commit)
       via  21b9f3f3ff7870d7cd422b98125a9a917fe30979 (commit)
      from  5f4d0e8ad92e9377d996ca7c709f528606f8a1db (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 57aed0231a284b2ce96e5fcc76a183f73b7e21ab
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue May 3 23:17:37 2016 -0500

    RT#37632: Credit card validation [cust_pay_pending handling on error]

diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index bbf86a5..54c7c5d 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -1965,6 +1965,17 @@ sub realtime_verify_bop {
 
     }
 
+  } else { # is not success
+
+    # status is 'done' not 'declined', as in _realtime_bop_result
+    $cust_pay_pending->status('done');
+    $cust_pay_pending->statustext( $transaction->error_message || 'Unknown error' );
+    # could also record failure_status here,
+    #   but it's not supported by B::OP::vSecureProcessing...
+    #   need a B::OP module with (reverse) auth only to test it with
+    my $cpp_declined_err = $cust_pay_pending->replace;
+    return $cpp_declined_err if $cpp_declined_err;
+
   }
 
   ###

commit 21b9f3f3ff7870d7cd422b98125a9a917fe30979
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 |   13 +++++++++++++
 FS/FS/cust_payby.pm                 |   16 +++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list