diff --git a/CRM/Core/Payment/Stripe.php b/CRM/Core/Payment/Stripe.php index 427b91608e1f460b66f3342a1c5e2e4ff9c28d56..68cc7ddd076406689a84ef3c2e366869570df636 100644 --- a/CRM/Core/Payment/Stripe.php +++ b/CRM/Core/Payment/Stripe.php @@ -891,7 +891,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment { * */ public function doTransferCheckout(&$params, $component) { - CRM_Core_Error::fatal(ts('Use direct billing instead of Transfer method.')); + self::doDirectPayment($params); } /** diff --git a/js/civicrm_stripe.js b/js/civicrm_stripe.js index 899c7ccf9ed3e11382c463ad257907fca763a7de..3d06db27318b5089aad46be099a547700093ae92 100644 --- a/js/civicrm_stripe.js +++ b/js/civicrm_stripe.js @@ -141,6 +141,23 @@ return false; } + // Handle multiple payment options and Stripe not being chosen. + if ($form.find(".crm-section.payment_processor-section").length > 0) { + var extMode = $('#ext-mode').val(); + var stripeProcessorId = $('#stripe-id').val(); + var chosenProcessorId = $form.find('input[name="payment_processor_id"]:checked').val(); + + // Bail if we're not using Stripe or are using pay later (option value '0' in payment_processor radio group). + if ((chosenProcessorId !== stripeProcessorId) || (chosenProcessorId === 0)) { + debugging('debug: Not a Stripe transaction, or pay-later'); + $form.get(0).submit(); + return true; + } + } + else { + debugging('debug: Stripe is the selected payprocessor'); + } + $form = getBillingForm(); // Don't handle submits generated by non-stripe processors @@ -192,22 +209,6 @@ // Disable the submit button to prevent repeated clicks $submit.prop('disabled', true); - // Handle multiple payment options and Stripe not being chosen. - if ($form.find(".crm-section.payment_processor-section").length > 0) { - var extMode = $('#ext-mode').val(); - var stripeProcessorId = $('#stripe-id').val(); - var chosenProcessorId = $form.find('input[name="payment_processor_id"]:checked').val(); - - // Bail if we're not using Stripe or are using pay later (option value '0' in payment_processor radio group). - if ((chosenProcessorId !== stripeProcessorId) || (chosenProcessorId === 0)) { - debugging('debug: Not a Stripe transaction, or pay-later'); - return true; - } - } - else { - debugging('debug: Stripe is the selected payprocessor'); - } - // If there's no credit card field, no use in continuing (probably wrong // context anyway) if (!$form.find('#credit_card_number').length) {