spree_gateway
spree_gateway copied to clipboard
Stripe gateway not generating Stripe token
As a result, we'll get Sending credit card numbers directly to the Stripe API is generally unsafe
.
So, the problem in JS.
We have this:
Spree.stripePaymentMethod = $('#payment_method_' + 3);
And later:
if Spree.stripePaymentMethod.is(':visible')
And last one returns false
in Chrome console, when this payment method is actually visible and $('payment_method_3').is(':visible')
returns true
.
This is well-known jQuery problem/feature of selectors snapshots - https://stackoverflow.com/questions/11868899/how-can-i-refresh-a-stored-and-snapshotted-jquery-selector-variable
Maybe to store in Spree.stripePaymentMethod
just a selector string, not a snapshot?