[freeside-commits] branch master updated. c683be2e0bc89b9d11dfd5454a6cd21161b752ef

Ivan ivan at 420.am
Thu Apr 12 16:13:08 PDT 2012


The branch, master has been updated
       via  c683be2e0bc89b9d11dfd5454a6cd21161b752ef (commit)
      from  b17ce7c641ad897ec35cac0c8f8e69320c19ab0e (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 c683be2e0bc89b9d11dfd5454a6cd21161b752ef
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Apr 12 16:13:07 2012 -0700

    fix voiding of APPL and ANRD payments, RT#17344

diff --git a/FS/FS/cust_pay_void.pm b/FS/FS/cust_pay_void.pm
index f1193cd..bebcfd4 100644
--- a/FS/FS/cust_pay_void.pm
+++ b/FS/FS/cust_pay_void.pm
@@ -68,9 +68,7 @@ order taker (see L<FS::access_user>)
 
 =item payby
 
-`CARD' (credit cards), `CHEK' (electronic check/ACH),
-`LECB' (phone bill billing), `BILL' (billing), `CASH' (cash),
-`WEST' (Western Union), `MCRD' (Manual credit card), or `COMP' (free)
+Payment Type (See L<FS::payinfo_Mixin> for valid values)
 
 =item payinfo
 
@@ -186,6 +184,7 @@ sub check {
     || $self->ut_foreign_keyn('pkgnum', 'cust_pkg', 'pkgnum')
     || $self->ut_numbern('void_date')
     || $self->ut_textn('reason')
+    || $self->payinfo_check
   ;
   return $error if $error;
 
@@ -197,31 +196,6 @@ sub check {
 
   $self->void_date(time) unless $self->void_date;
 
-  $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREP|CASH|WEST|MCRD)$/
-    or return "Illegal payby";
-  $self->payby($1);
-
-  #false laziness with cust_refund::check
-  if ( $self->payby eq 'CARD' ) {
-    my $payinfo = $self->payinfo;
-    $payinfo =~ s/\D//g;
-    $self->payinfo($payinfo);
-    if ( $self->payinfo ) {
-      $self->payinfo =~ /^(\d{13,16}|\d{8,9})$/
-        or return "Illegal (mistyped?) credit card number (payinfo)";
-      $self->payinfo($1);
-      validate($self->payinfo) or return "Illegal credit card number";
-      return "Unknown card type" if $self->payinfo !~ /^99\d{14}$/ #token
-                                 && cardtype($self->payinfo) eq "Unknown";
-    } else {
-      $self->payinfo('N/A');
-    }
-
-  } else {
-    $error = $self->ut_textn('payinfo');
-    return $error if $error;
-  }
-
   $self->void_usernum($FS::CurrentUser::CurrentUser->usernum)
     unless $self->void_usernum;
 

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

Summary of changes:
 FS/FS/cust_pay_void.pm |   30 ++----------------------------
 1 files changed, 2 insertions(+), 28 deletions(-)




More information about the freeside-commits mailing list