Merge pull request #9425 from colemanw/CRM-19649
[civicrm-core.git] / CRM / Member / Form / Membership.php
index 53de647a0daff062d24faafe196b1485a7b6b6ab..3073c104948d349320fdd660ab2cca90cd5ca6db 100644 (file)
@@ -1400,6 +1400,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
         $financialType->id = $params['financial_type_id'];
         $financialType->find(TRUE);
         $this->_params = $formValues;
+        $paymentParams['payment_instrument_id'] = $this->_paymentProcessor['payment_instrument_id'];
         $contribution = CRM_Contribute_Form_Contribution_Confirm::processFormContribution($this,
           $paymentParams,
           NULL,
@@ -1487,7 +1488,6 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
       );
       $params['source'] = $formValues['source'] ? $formValues['source'] : $params['contribution_source'];
       $params['trxn_id'] = CRM_Utils_Array::value('trxn_id', $result);
-      $params['payment_instrument_id'] = 1;
       $params['is_test'] = ($this->_mode == 'live') ? 0 : 1;
       if (!empty($formValues['send_receipt'])) {
         $params['receipt_date'] = $now;