[freeside-commits] freeside/FS/FS cust_pay.pm,1.50.2.2,1.50.2.3

Ivan,,, ivan at wavetail.420.am
Wed Jul 11 01:08:32 PDT 2007


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv10696/FS/FS

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	cust_pay.pm 
Log Message:
finish adding payunique field

Index: cust_pay.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pay.pm,v
retrieving revision 1.50.2.2
retrieving revision 1.50.2.3
diff -u -d -r1.50.2.2 -r1.50.2.3
--- cust_pay.pm	29 Jun 2007 01:42:19 -0000	1.50.2.2
+++ cust_pay.pm	11 Jul 2007 08:08:29 -0000	1.50.2.3
@@ -69,7 +69,9 @@
 
 =item paymask - Masked payinfo (See L<FS::payinfo_Mixin> for how this works)
 
-=item paybatch - text field for tracking card processing
+=item paybatch - text field for tracking card processing or other batch grouping
+
+=item payunique - Optional unique identifer to prevent duplicate transactions.
 
 =item closed - books closed flag, empty or `Y'
 
@@ -162,17 +164,6 @@
     }
   }
 
-  if ( $self->paybatch =~ /^webui-/ ) {
-    my @cust_pay = qsearch('cust_pay', {
-      'custnum' => $self->custnum,
-      'paybatch' => $self->paybatch,
-    } );
-    if ( scalar(@cust_pay) > 1 ) {
-      $dbh->rollback if $oldAutoCommit;
-      return "a payment with webui token ". $self->paybatch. " already exists";
-    }
-  }
-
   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
 
   #false laziness w/ cust_credit::insert
@@ -421,7 +412,10 @@
   # should give a better error message the other 99.9% of the time...
   if ( length($self->payunique)
        && qsearchs('cust_pay', { 'payunique' => $self->payunique } ) ) {
-    return "duplicate transaction"; #well, it *could* be a better error message
+    #well, it *could* be a better error message
+    return "duplicate transaction".
+           " - a payment with unique identifer ". $self->payunique.
+           " already exists";
   }
 
   $self->SUPER::check;



More information about the freeside-commits mailing list