dev/core#513: USe payment_instrument_id instead of payment_type to determine the...
authorOmar abu hussein <opetmar91@gmail.com>
Thu, 8 Nov 2018 16:23:13 +0000 (16:23 +0000)
committerOmar abu hussein <opetmar91@gmail.com>
Thu, 8 Nov 2018 16:23:13 +0000 (16:23 +0000)
api/v3/Contribution.php

index 0d641ad8641f8ececec66b2ea42e1626ff0b8a25..36ed63cfee7c0d061f71c8720b1c26acb7154317 100644 (file)
@@ -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);
 }