#susan_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1353824174061256856
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello there
Looks like you set setup_future_usage server-side so you need to also set it client-side when you create your Elements instance: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#additional-options
and What happens if my user refuses to retain that payment method? I'm looking to set up future use, but only when my client clicks a button.
You can update that client-side based on that button click: https://docs.stripe.com/js/elements_object/update#elements_update-options-setupFutureUsage
before I sent the form card, right?
Yep
ok, I'll try that, thanks!
Sorry, just one last thing. When I create that form element, I set the amount and currency, but I prefer to set it in the backend. Are those values less important in the frontend? I mean, if I set both values in the frontend, can I override them in the backend without any problems?
You can, yes. However if you are using wallets like Google Pay or Apple Pay then the frontend amount is what will display in those modals. You can similarly update the frontend amount/currency as necessary using elements.update().
Also I believe there is validation for them to match with Paypal now that I think of it... if you are supporting Paypal.
Overall I would recommend you keep them in sync
Ok perfect, I'm using only cards, but the final amount depends on a calculation in the backend, that's why I wanted to configure that and the final and just keep it as a reference for the client in the frontend
Yeah overall that should be fine then