return IDs of newly created payments on success
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 6 Jul 2010 19:30:03 +0000 (19:30 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 6 Jul 2010 19:30:03 +0000 (19:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16858 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index e7210a0..7d8595e 100644 (file)
@@ -69,7 +69,7 @@ __PACKAGE__->register_method(
         ],
         "return" => {
             "desc" =>
-                q{1 on success, event on failure.  Event possibilities include:
+                q{Array of payment IDs on success, event on failure.  Event possibilities include:
                 BAD_PARAMS
                     Bad parameters were given to this API method itself.
                     See note field.
@@ -299,6 +299,7 @@ sub make_payments {
 
     ### RE-OPEN TRANSACTION HERE ###
     $e->xact_begin;
+    my @payment_ids;
 
     # create payment records
     my $create_money_method = "create_money_" . $type;
@@ -338,6 +339,8 @@ sub make_payments {
                 $e, "$create_money_method failed", $payment, $cc_payload
             );
         }
+
+        push(@payment_ids, $payment->id);
     }
 
     my $evt = _update_patron_credit($e, $patron, $credit);
@@ -360,7 +363,7 @@ sub make_payments {
     }
 
     $e->commit;
-    return 1;
+    return \@payment_ids;
 }
 
 sub _recording_failure {