Reputation: 73
I have implemented stripe payment using stripe popup but before open this popup we need to set data-currency based on customer selection of currency suppose "USD" OR "EUR".
I tried with this code :
$('#custom_currency').change(function() {
$('.stripe-button').data('currency', $(this).val());
});
I checked in console and data-currency value change but in stripe popup always display the $.
Right now i select Euro(EUR) but always display $. (http://prntscr.com/kisgdt)
Would you please let me know what is the issue.
Thanks in advance.
Upvotes: 3
Views: 597
Reputation: 246
You would need to use Custom Checkout for this. The approach is to provide the selected currency value when calling the open()
function on your handler
[1] so it can be set at the time the pop up is opened.
Here's an example that should show the approach to take: https://jsfiddle.net/m07esujc/
[1] the handler
that you get when initializing Checkout with StripeCheckout.configure()
Upvotes: 2