From 5a9f95194bb1bfa0df2385d7f92003a686c82281 Mon Sep 17 00:00:00 2001 From: Omar abu hussein Date: Thu, 8 Nov 2018 16:23:13 +0000 Subject: [PATCH] dev/core#513: USe payment_instrument_id instead of payment_type to determine the payment instrument when using the Transact API --- api/v3/Contribution.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 0d641ad864..36ed63cfee 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -434,7 +434,8 @@ function civicrm_api3_contribution_transact($params) { $paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($params['payment_processor'], $params['payment_processor_mode']); $paymentProcessor['object']->doPayment($params); - $params['payment_instrument_id'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', $paymentProcessor['payment_processor_type_id'], 'payment_type') == 1 ? 'Credit Card' : 'Debit Card'; + $params['payment_instrument_id'] = $paymentProcessor['object']->getPaymentInstrumentID(); + return civicrm_api('Contribution', 'create', $params); } -- 2.25.1