File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
app/assets/javascripts/payola Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,14 @@ var PayolaOnestepSubscriptionForm = {
2727 PayolaOnestepSubscriptionForm . showError ( form , 'The card number is not a valid credit card number.' ) ;
2828 return false ;
2929 }
30-
31- var expMonth = $ ( "[data-stripe='exp_month']" ) . val ( ) ;
32- var expYear = $ ( "[data-stripe='exp_year']" ) . val ( ) ;
33- if ( ! Stripe . card . validateExpiry ( expMonth , expYear ) ) {
30+ if ( $ ( "[data-stripe='exp']" ) . length ) {
31+ var valid = ! Stripe . card . validateExpiry ( $ ( "[data-stripe='exp']" ) . val ( ) ) ;
32+ } else {
33+ var expMonth = $ ( "[data-stripe='exp_month']" ) . val ( ) ;
34+ var expYear = $ ( "[data-stripe='exp_year']" ) . val ( ) ;
35+ var valid = ! Stripe . card . validateExpiry ( expMonth , expYear ) ;
36+ }
37+ if ( valid ) {
3438 PayolaOnestepSubscriptionForm . showError ( form , "Your card's expiration month/year is invalid." ) ;
3539 return false ;
3640 }
You can’t perform that action at this time.
0 commit comments