Skip to content

Commit

Permalink
Check for presence of iban before mounting
Browse files Browse the repository at this point in the history
  • Loading branch information
roykho committed Aug 27, 2018
1 parent 8e135e2 commit 467d19c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions assets/js/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,16 @@ jQuery( function( $ ) {

wc_stripe_form.mountElements();

iban.mount( '#stripe-iban-element' );
if ( $( '#stripe-iban-element' ).length ) {
iban.mount( '#stripe-iban-element' );
}
} );
} else if ( $( 'form#add_payment_method' ).length || $( 'form#order_review' ).length ) {
wc_stripe_form.mountElements();
iban.mount( '#stripe-iban-element' );

if ( $( '#stripe-iban-element' ).length ) {
iban.mount( '#stripe-iban-element' );
}
}
},

Expand Down
Loading

0 comments on commit 467d19c

Please sign in to comment.