diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 0d641ad8641f..36ed63cfee7c 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); }