#417goose_code

1 messages ยท Page 1 of 1 (latest)

snow crescentBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

strange radishBOT
dense cloud
#

Hi there ๐Ÿ‘‹ are you trying to update the amount you're using for the Express Checkout Element in the middle of your flow, or are you trying to set the price initially and it isn't displaying as expected?

shut cypress
#

set the price inititally

#

price only updates when shipping method changes

dense cloud
#

Gotcha. And how are you initiliazing Elements? Are you creating the Payment Intent first and using its client secret, are you passing mode, currency, amount, etc as part of the initialization?

shut cypress
#

Yes payment intent first

dense cloud
#

Do you have a test page where I can see what you're describing?

shut cypress
#

I am sorry I do not, it's local

#

req_w6h86rJRWQ3HIR is the request as you can see the intent has the correct value and I would like just loading the express would pull that value correct?

#

Just doing this to create the express checkout
const expressCheckoutElement = elements.create(
'expressCheckout', exoptions
)
// mount display
expressCheckoutElement.mount('#express-checkout-element')

dense cloud
#

Yeah, I see the amount set during the Payment Intent creation request as you describe. It's why I was hoping to see the Elements side of your integration to see if I could spot what's going on.

shut cypress
#

My thought is I am setting the element correct but the element amount is being updated with a decimal value, but wouldn't we see that "update" in the logs?

#

everywhere I manipulate the amount, I am outputting it and it always is correct, it's just dumbfounded.

dense cloud
#

Most Elements updates aren't shown in your logs, and you wouldn't be updating Elements if you're using a client-secret form an intent to drive its behavior.

#

You mentioned link (I'm thinking that's Link) in your original description. Do the Google/Apple pay modals show the correct amount?

shut cypress
#

No they all show the same incorrect amount

dense cloud
#

Okay, so Elements is definitely getting the wrong amount then.

shut cypress
#

When creating expressCheckout element I don't pass any amount correct

#

it pulls from the payment element

dense cloud
#

The Payment Element also pulls its amount from the Elements instance.

shut cypress
#

Oh my I just found my issue ...

#

I was calling an old variable (amount) that hadn't been converted to orderAmount (which is the decimal-less version. Looks like copy and paste got me ...

#

Sorry for your trouble ... thank you for being great as you guys ALWAYS are