Skip to content
Snippets Groups Projects
Commit 39daca19 authored by drastik's avatar drastik
Browse files

Stash the Stripe token (including its value) from _Main form in _Confirm, in...

Stash the Stripe token (including its value) from _Main form in _Confirm, in case they go backwards.
parent 7ed275da
No related branches found
No related tags found
No related merge requests found
......@@ -115,9 +115,7 @@ function stripe_civicrm_upgrade($op, CRM_Queue_Queue $queue = NULL) {
* @param $form - reference to the form object
*/
function stripe_civicrm_buildForm($formName, &$form) {
if (isset($form->_paymentProcessor['payment_processor_type'])
&& $form->_paymentProcessor['payment_processor_type'] == 'Stripe'
) {
if (isset($form->_paymentProcessor['payment_processor_type']) && $form->_paymentProcessor['payment_processor_type'] == 'Stripe') {
if (!stristr($formName, '_Confirm') && !stristr($formName, '_ThankYou')) {
if (!isset($form->_elementIndex['stripe_token'])) {
$form->_attributes['class'] .= " stripe-payment-form";
......@@ -125,6 +123,10 @@ function stripe_civicrm_buildForm($formName, &$form) {
stripe_add_stripe_js($form);
}
}
elseif (!empty($form->_params['stripe_token']) && !isset($form->_elementIndex['stripe_token'])) {
// Stash the token (including its value) in Confirm, in case they go backwards.
$form->addElement('hidden', 'stripe_token', $form->_params['stripe_token'], array('id' => 'stripe-token'));
}
}
// For the 'Record Contribution' backend page.
......
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