From ce7692e2c2514b2b590a9f14804001488dcb9c9a Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot <forums@artfulrobot.uk> Date: Wed, 30 Oct 2019 06:50:01 +0000 Subject: [PATCH] add payment_processor_id and payment_instrument_id --- docs/financial/orderAPI.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/financial/orderAPI.md b/docs/financial/orderAPI.md index 2bc5c4e9..d0a90255 100644 --- a/docs/financial/orderAPI.md +++ b/docs/financial/orderAPI.md @@ -355,13 +355,19 @@ $order = civicrm_api3('Order', 'create' $params); try { // Use the Payment Processor to attempt to take the actual payment. You may // pass in other params here, too. - civicrm_api3('PaymentProcessor', 'pay', ['contribution_id' => $order['id']]); + civicrm_api3('PaymentProcessor', 'pay', [ + 'payment_processor_id' => $params['payment_processor_id'], + 'contribution_id' => $order['id'], + 'amount' => $params['total_amount'], + ]); // Assuming the payment was taken, record it which will mark the Contribution // as Completed and update related entities. civicrm_api3('Payment', 'create', [ 'contribution_id' => $order['id'], 'total_amount' => $params['amount'], + 'payment_processor_id' => $params['payment_processor_id'], + 'payment_instrument_id' => $params['payment_instrument_id'], ]); } catch { -- GitLab