#wackjeston_api

1 messages ยท Page 1 of 1 (latest)

cobalt orioleBOT
#

๐Ÿ‘‹ 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.

tawny vesselBOT
#

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.

rough mural
#

Hello! You say 'fails to confirm', what exactly does that look like? Is there an error returned?

regal magnet
#

Hello

#

one sec, I will get you some screen shots

#

This is the error that stripe reutnr

#

sorry it's over 2000 characters

rough mural
#

Taking a look

regal magnet
#

thanks

rough mural
#

So the step where you're redirected to the PayPal dialog and confirm the payment happens yes?

regal magnet
#

I am using the express checkout element so I don't get redirected. There is a PayPal popup

rough mural
#

Can you share your code that is triggering the error?

regal magnet
regal magnet
#

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

rough mural
regal magnet
#

And when pay button is pressed, the stripeElement is confirmed

#

This is what causes the error

#

stripe.confirmPayment

rough mural
#

Yep, looking

regal magnet
#

the update is something I recently added in

#

but it doesn't seem to do anything

rough mural
#

You're using a sandbox account with PayPal, yes?

regal magnet
#

yeah

#

pi_3P4KUgISraJyVicT0VQwWmJW

#

this is the latest failed intent

rough mural
#

Yeah I have the ID from the JSON dump

regal magnet
#

nice

rough mural
#

I'm looking at your code, please be patient

regal magnet
#

I will make you a succesfull one where I don't change the shipping option

#

pi_3P4KhWISraJyVicT0rt0OA2b

rough mural
#

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

regal magnet
#

So before I confirm I am updating the payment intent amount

rough mural
#

I think you'll need to call elements.update() in your shippingratechange event handler directly

regal magnet
#

interesting, I will try this

rough mural
#

So you'd make your backend call to update the PI via stripeUpdate, call elements.update() and then resolve()

regal magnet
#

Oh so instead of manually updating the pi with php

#

I should just use element.update instead

rough mural
#

No, you need to do both

regal magnet
#

it worked

#

you're a legend

#

I've been stuck on this for 3 days lol

#

Thank you very much ynnoj

rough mural
#

No problem, glad I could help!

regal magnet
#

I hope you have a nice rest of your day