#azhar_error
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/1331182188204523613
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! The reason you get this error is due to mismatch on the client and server side codes.
As the error code suggests, you would need to pass in setupFutureUsage: off_session: https://docs.stripe.com/payments/build-a-two-step-confirmation#additional-options
From some of your GET /v1/elements/sessions, I do not see setupFutureUsage: off_session as well.
@weary stone so i need to pass in this option object correc?
const options = { mode: 'payment', amount: 100, currency: 'usd', setupFutureUsage : 'off_session', };
Apologies, I realised that the confirmation token was created with mode: "payment". However, you are creating a setup intent with it. Any reason why?
i guess i am doing wrong. we want to create intent on server side and charge also on server side only
so mode i should be using as setup right ?
Yes
Thanks, let us try now
@leaden lancegetting error like
Uncaught IntegrationError: Invalid value for elements(): amount is not applicable when mode is 'setup'
Seems expected yes. What exactly are you trying to do?
dont we need to show some amount when apple pay button clicked ?
we are intergrating apple pay
let me try without amount. let me see how its working
Well, yes. But are you trying to accept a payment or save a card for future usage
Right now you seem to have a mix of both
Hmm, actually, we need both. let me try without amount
Both? As in you want to process a payment and save a card
yes on server side payment and card saved for future
@leaden lance payment worked after removing the amount
any possibility to show amount in this case ?
OK, but that's not a payment. You're just saving their Apple Pay card to be used in future
You need to use mode: 'payment' if you actually want to process a payment, and then you can use setupFutureUsage: 'off_session' to save the card
ok in this case, intent i need to create on front side only and charge api call also on front side only right ?
meanwhile, i will check with team if we are okay without amount displayed
No, you need a back-end to create the Setup/Payment Intent
@leaden lance checked with team we are okay without amount so for now its fine. thanks for your support