#azhar_error

1 messages ¡ Page 1 of 1 (latest)

dense spruceBOT
#

👋 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.

devout junco
weary stone
#

Hi! The reason you get this error is due to mismatch on the client and server side codes.

#

From some of your GET /v1/elements/sessions, I do not see setupFutureUsage: off_session as well.

devout junco
#

@weary stone so i need to pass in this option object correc?

#

const options = { mode: 'payment', amount: 100, currency: 'usd', setupFutureUsage : 'off_session', };

dense spruceBOT
weary stone
#

Apologies, I realised that the confirmation token was created with mode: "payment". However, you are creating a setup intent with it. Any reason why?

devout junco
#

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 ?

leaden lance
#

Yes

devout junco
#

Thanks, let us try now

devout junco
#

@leaden lancegetting error like

Uncaught IntegrationError: Invalid value for elements(): amount is not applicable when mode is 'setup'

leaden lance
#

Seems expected yes. What exactly are you trying to do?

devout junco
#

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

leaden lance
#

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

devout junco
#

Hmm, actually, we need both. let me try without amount

leaden lance
#

Both? As in you want to process a payment and save a card

devout junco
#

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 ?

leaden lance
#

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

devout junco
#

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

leaden lance
#

No, you need a back-end to create the Setup/Payment Intent

devout junco
#

@leaden lance checked with team we are okay without amount so for now its fine. thanks for your support