diff --git a/js/civicrm_stripe.js b/js/civicrm_stripe.js index 07b8676a7cdd759e0b48c7b42738efcb90affc2c..033785bbbe43c7c1d3213c3b1d6e056d626dd9e7 100644 --- a/js/civicrm_stripe.js +++ b/js/civicrm_stripe.js @@ -229,8 +229,14 @@ 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)) { + + // If any of these are true, we are not using the stripe processor: + // - Is the selected processor ID pay later (0) + // - Is the Stripe processor ID defined? + // - Is selected processor ID and stripe ID undefined? If we only have stripe ID, then there is only one (stripe) processor on the page + if ((chosenProcessorId === 0) + || (stripeProcessorId == null) + || ((chosenProcessorId == null) && (stripeProcessorId == null))) { debugging('Not a Stripe transaction, or pay-later'); return true; }