#fiery_papaya_08623

1 messages · Page 1 of 1 (latest)

wary oarBOT
#

Hello fiery_papaya_08623, we'll be with you shortly! 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.
fiery_papaya_08623, 0 days ago, 5 messages
fiery_papaya_08623, 0 days ago, 21 messages
fiery_papaya_08623, 0 days ago, 6 messages

rich wagon
#

HI 👋

You need to update the Elements instance from the Intent to reflect the new amount

wary oarBOT
fast pendant
#

Tried it and it does not seem to work...

#

After updating the amount and calling elements.fetchUpdates();, its still showing the orignial amount. When the user confirms payment, the amount charged is the correct amount, but the amount showed is not the correct one

idle wing
#

Hello! I'm taking over and catching up...

#

What specific Stripe Element are you using for Apple Pay?

fast pendant
#

I use this hook const elements = useElements();

#

of this library @stripe/react-stripe-js

idle wing
#

Right, but are you using the Payment Element? Payment Request Button? Express Checkout Element?

fast pendant
#

I use Payment Element

idle wing
fast pendant
#

I see the documentation but these are my only option sfor the update method

idle wing
#

Maybe you need to update the library you're using?

fast pendant
#

Ok yes I just upgraded it and the other options are showing now thanks! I now see this error when trying to update the elements but not sure why

idle wing
#

You're specifying both a client secret and also indicating you're using the deferred flow. Those are not compatible approaches, so you're getting that error.

fast pendant
#

This is my line :
elements.update({ amount: paymentIntent.totalAmount, mode: "payment", currency: "cad" });

idle wing
#

So are you initializing elements with a client secret?

#

Which guide are you following?

fast pendant
idle wing
#

So it sounds like you're probably initializing with a client secret. How are you updating the amount on the Payment Intent?

fast pendant
#

Yes I do Sorry ! I make an api request to my backend and it updates the amount of the payment intent. In my frontend, I show to the user the updated amount, but when it comes to pay with apple pay, it shows the original amount

idle wing
#

But you said it doesn't work?

wary oarBOT
fast pendant
#

No it did not.. after making my request, it updated the payment intent correctly, but still showed the original amount in apple pay

desert night
#

Hi @wooden mauve I'm taking over this thread.

fast pendant
#

Hi! Thank you

desert night
#

I'm unable to reprodce your problem, the Apple Pay paymentsheet shows the updated amount after I call elements.fetchUpdates()