push the CC processing to the end so that it runs just before the final commit
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Oct 2009 20:56:45 +0000 (20:56 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 8 Oct 2009 20:56:45 +0000 (20:56 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14318 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm

index be909d5..0d27690 100644 (file)
@@ -190,14 +190,6 @@ sub make_payments {
 
        } # all payment objects have been created and inserted. 
 
-    if($type eq 'credit_card_payment') {
-        # TODO send to credit card processor
-        # amount == $total_paid
-        # user == $user_id
-        # other args == $cc_args (hash)
-        # $e->rollback if processing fails.  This will undo everything.
-    }
-
        my $evt = _update_patron_credit($e, $patron, $credit);
        return $evt if $evt;
 
@@ -207,6 +199,14 @@ sub make_payments {
         return $evt if $evt;
     }
 
+    if($type eq 'credit_card_payment') {
+        # TODO send to credit card processor
+        # amount == $total_paid
+        # user == $user_id
+        # other args == $cc_args (hash, see api docs)
+        # $e->rollback if processing fails.  This will undo everything.
+    }
+
     $e->commit;
     return 1;
 }