Skip to content
This repository has been archived by the owner on Sep 1, 2019. It is now read-only.

Commit

Permalink
Detect billing form when stripe is not the selected processor
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Aug 1, 2018
1 parent 596985d commit 5345706
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/civicrm_stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,16 @@
}

function getBillingForm() {
// If we have a stripe billing form on the page
var $billingForm = $('input#stripe-pub-key').closest('form');
if (!$billingForm.length && getIsWebform()) {
// If we are in a webform
$billingForm = $('.webform-client-form');
}
if (!$billingForm.length) {
// If we have multiple payment processors to select and stripe is not currently loaded
$billingForm = $('input[name=hidden_processor]').closest('form');
}
return $billingForm;
}

Expand Down

0 comments on commit 5345706

Please sign in to comment.