#Avery-paymentElement

1 messages · Page 1 of 1 (latest)

white vigil
tardy walrus
#

Example pi_3KGd0aAcqRxm04BK0CT0w8KJ

white vigil
#

Sounds like a bug in Google Pay and Apple Pay. Instead of updating the payment intent, can you create a new Payment Intent with the updated amount?

tardy walrus
#

If you try to create a payment intent you have to update the element and it will reset the status of the element. So if you had credit card information inserted it will clear the information and if you had google pay selected it will select credit card.

Unless there is a way to edit the payment intent of the element without having to recreate it, but I thought I saw that the payment intent for elements are unique

white vigil
#

Hmm, sorry not sure if I follow you.

tardy walrus
#
<Elements
          key={clientSecret}
          stripe={stripePromise}
          options={{
            clientSecret: clientSecret,
          }}
        >

The clientSecret can only be set once here correct? You would need to recreate the element to change that?

white vigil
#

The clientSecret is a prop to <Elements> so if the value of clientSecret is updated (i.e., via useState hook or setState) the <Elements> will be re-rendered.

tardy walrus
#

yeah if you change the prop it will reset the element instead of just updating the payment. so if you have card information entered it will clear the text

white vigil
#

Yes, but does it give you the correct amount in the Google pay confirmation page?