#yogooooooo_code
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/1389730176413466675
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
The UI amount just won't update. to match the payment intent.
Which UI amount are you referring to? Could you share the screenshot?
If you're referring to Apple Pay payment interface, it takes the amount from the Element options instead of the one from Payment Intent. You'd need to update the amount in the Element options, so that Apple Pay interface will show correct value: https://docs.stripe.com/js/elements_object/update#elements_update-options-amount
Ok, I'll see if passing the amount through the Elements component will work. I am referring to the amount in the apple pay sheet.
Then yes, updating the amount in the Element options should reflect the new value
It seems as though it won't accept amount as a prop on options because it does not exist on type StripeElementsOptionsClientSecret.
And I am not specifically typing the options object as such, I am typing it as StripeElementsOptions.
Why wouldn't it update along with the payment intent?
By it I mean the amount on the apple pay sheet
Express Checkout Element uses deferred intent flow, i.e. doesn't use amount the Payment Intent client secret, and only reads the amount from the options. To update the Elements options, StripeElementsUpdateOptions should be used: https://github.com/stripe/stripe-js/blob/master/types/stripe-js/elements-group.d.ts#L846
StripeElementsOptionsClientSecret is for Elements is for creation, not update.
Ok, thank you