[freeside-commits] freeside/FS/FS/cust_main Billing_Realtime.pm, 1.9.2.9, 1.9.2.10

Mark Wells mark at wavetail.420.am
Thu May 12 12:57:12 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/FS/cust_main
In directory wavetail.420.am:/tmp/cvs-serv17725/FS/FS/cust_main

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	Billing_Realtime.pm 
Log Message:
new status for pending third-party payments, fix for #12808

Index: Billing_Realtime.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Billing_Realtime.pm,v
retrieving revision 1.9.2.9
retrieving revision 1.9.2.10
diff -u -w -d -r1.9.2.9 -r1.9.2.10
--- Billing_Realtime.pm	11 May 2011 00:49:51 -0000	1.9.2.9
+++ Billing_Realtime.pm	12 May 2011 19:57:10 -0000	1.9.2.10
@@ -488,6 +488,19 @@
     'custnum' => $self->custnum,
     'status'  => { op=>'!=', value=>'done' } 
   });
+
+  #for third-party payments only, remove pending payments if they're in the 
+  #'thirdparty' (waiting for customer action) state.
+  if ( $namespace eq 'Business::OnlineThirdPartyPayment' ) {
+    foreach ( grep { $_->status eq 'thirdparty' } @pending ) {
+      my $error = $_->delete;
+      warn "error deleting unfinished third-party payment ".
+          $_->paypendingnum . ": $error\n"
+        if $error;
+    }
+    @pending = grep { $_->status ne 'thirdparty' } @pending;
+  }
+
   return "A payment is already being processed for this customer (".
          join(', ', map 'paypendingnum '. $_->paypendingnum, @pending ).
          "); $options{method} transaction aborted."
@@ -560,6 +573,9 @@
 
   if ( $transaction->is_success() && $namespace eq 'Business::OnlineThirdPartyPayment' ) {
 
+    $cust_pay_pending->status('thirdparty');
+    my $cpp_err = $cust_pay_pending->replace;
+    return { error => $cpp_err } if $cpp_err;
     return { reference => $cust_pay_pending->paypendingnum,
              map { $_ => $transaction->$_ } qw ( popup_url collectitems ) };
 



More information about the freeside-commits mailing list