Skip to content
Snippets Groups Projects
Commit 48cb7084 authored by mattwire's avatar mattwire
Browse files

Allow submit of a different payment processor when Stripe is default but not selected

parent 76099723
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
/**
......
......@@ -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) {
......
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