Skip to content
Snippets Groups Projects
Unverified Commit 5489f159 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #14206 from mattwire/paymentforms_refactor

REF Refactor to reduce duplication on payment forms
parents 7e3b797c 2204d007
No related branches found
No related tags found
No related merge requests found
......@@ -766,6 +766,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
$this->assign('bltID', $this->_bltID);
}
/**
* @return int
*/
public function getPaymentProcessorID() {
return $this->_paymentProcessorID;
}
/**
* This if a front end form function for setting the payment processor.
*
......@@ -878,9 +885,8 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
else {
$this->_paymentProcessor = [];
}
CRM_Financial_Form_Payment::addCreditCardJs($this->_paymentProcessorID);
}
$this->assign('paymentProcessorID', $this->_paymentProcessorID);
// We save the fact that the profile 'billing' is required on the payment form.
// Currently pay-later is the only 'processor' that takes notice of this - but ideally
// 1) it would be possible to select the minimum_billing_profile_id for the contribution form
......
......@@ -73,6 +73,9 @@ class CRM_Core_Payment_ProcessorForm {
$form->assign('suppressSubmitButton', $form->_paymentObject->isSuppressSubmitButtons());
CRM_Financial_Form_Payment::addCreditCardJs($form->getPaymentProcessorID());
$form->assign('paymentProcessorID', $form->getPaymentProcessorID());
$form->assign('currency', $form->getCurrency());
// also set cancel subscription url
......
......@@ -79,11 +79,6 @@ class CRM_Financial_Form_Payment extends CRM_Core_Form {
CRM_Core_Payment_ProcessorForm::preProcess($this);
self::addCreditCardJs($this->_paymentProcessorID);
$this->assign('paymentProcessorID', $this->_paymentProcessorID);
$this->assign('currency', $this->currency);
$this->assign('suppressForm', TRUE);
$this->controller->_generateQFKey = FALSE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment