#wackjeston_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/1227921878287384627
๐ 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.
- wackjeston_api, 1 day ago, 56 messages
- wackjeston_api, 2 days ago, 15 messages
Hello! You say 'fails to confirm', what exactly does that look like? Is there an error returned?
Hello
one sec, I will get you some screen shots
This is the error that stripe reutnr
sorry it's over 2000 characters
Taking a look
thanks
So the step where you're redirected to the PayPal dialog and confirm the payment happens yes?
I am using the express checkout element so I don't get redirected. There is a PayPal popup
Can you share your code that is triggering the error?
Yeah, that's what I meant
If I leave the shipping method as is, it will confirm successfully
but if I select one it fails
When you select one of the shipping options, the intent amount is updated by my update php script
That part of the code is fine I think, you can see the API call to update the amount: https://dashboard.stripe.com/test/logs/req_TchKjtce9ZgOWA
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Where's your confirm event handler? https://docs.stripe.com/js/elements_object/express_checkout_element_confirm_event
And when pay button is pressed, the stripeElement is confirmed
This is what causes the error
stripe.confirmPayment
Yep, looking
You're using a sandbox account with PayPal, yes?
Yeah I have the ID from the JSON dump
nice
I'm looking at your code, please be patient
I will make you a succesfull one where I don't change the shipping option
pi_3P4KhWISraJyVicT0rt0OA2b
OK, I've found the issue. It seems that there's a mismatch between the amount you initially set (21000) and what you confirm with (22194). I guess that accounts for the shipping rate selected and why it only occurs if you change that in the interface
So before I confirm I am updating the payment intent amount
I think you'll need to call elements.update() in your shippingratechange event handler directly
interesting, I will try this
So you'd make your backend call to update the PI via stripeUpdate, call elements.update() and then resolve()
Oh so instead of manually updating the pi with php
I should just use element.update instead
No, you need to do both
it worked
you're a legend
I've been stuck on this for 3 days lol
Thank you very much ynnoj
No problem, glad I could help!
I hope you have a nice rest of your day