From: Omar abu hussein Date: Thu, 8 Nov 2018 16:23:13 +0000 (+0000) Subject: dev/core#513: USe payment_instrument_id instead of payment_type to determine the... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5a9f95194bb1bfa0df2385d7f92003a686c82281;p=civicrm-core.git dev/core#513: USe payment_instrument_id instead of payment_type to determine the payment instrument when using the Transact API --- 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); }