#jeline_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/1363872836179071110
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- jeline_api, 6 days ago, 20 messages
So the main problem is that elements have clientSecret on initialization, you can't update amount via javascript on express checkout element
Hi, are you able to share more about your use case here? What have you already tried?
I already tried implement this per this doc
https://docs.stripe.com/elements/express-checkout-element/accept-a-payment
But i receive that error
controller-with-prec…ae3c23e87f65bc.js:1 You may only specify one of these parameters: client_secret, deferred_intent.
when doing elements.update({amount: result.amount})
So the problem is that when you have clientSecret added to elements initialzation you can't update amount in express checkout even you update PaymentIntent via API
Updating the elements, https://docs.stripe.com/js/elements_object/update is the correct approach. Can you share the page where you see this? What does your code look like?
I should clarify that if the issuing bank send that decline code, we would surface that too. Wrong thread, sorry.
Hello 👋 I'm jumping in as my teammate needs to step away soon.
If you're creating your Elements instance by first creating a Payment Intent and using it's client secret to initialize stripe.js, then you won't use update when you want to change the amount on the frontend.
Instead, after updating your Payment Intent, you'll call fetchUpdates() to have Stripe.js fetch the updated details from the associated Payment Intent:
https://docs.stripe.com/js/elements_object/fetch_updates
Interesting i wiill try
Does this will work in google pay window?
Google pay window opened - > Customer change his shipping method and total amount should be changed- > i am usung fetchUpdates()
I believe so, but let me know if that's not what you see during your testing.
So i just use elements.fetchUpdates() and that's all?
After updating the Payment Intent with the new amount (or any other relevant updates).
Yeah that's works, also do you know how to fech billing address change? I want also to calclulate taxes
Can you help me understand where you want to fetch the address details from?
It's included in the confirm Event then:
https://docs.stripe.com/js/elements_object/express_checkout_element_confirm_event#express_checkout_element_on_confirm-handler-billingDetails
You won't get it sooner than that.
However, I'd suggest checking with your tax advisor for the appropriate tax calculation approach for the region where you operate. My understanding, at least within the US, is that tax amounts are typically calulated off of the shipping address rather than the billing address. (And I'm guessing you're listening to shipping address changes since you're updating shipping rates).
Thanks for your help, only one issue that worry me now it's that address line is empty
That doesn't look like a confirm Event, can you elaborate on what you're looking at now?