#Nick Ortega-update-payment-intent

1 messages ยท Page 1 of 1 (latest)

radiant girderBOT
rustic cobalt
#

Hi ๐Ÿ‘‹ the amount parameter is provided each time you make a request to create a Payment Intent, so if you need to create ones with different amount values then you would adjust the value that you're providing for that parameter.

Is that what you were asking?

final shard
#

I'm not sure I understand. I have a text box so a customer can input an amount in and pay, then that amount will be updated thru elements.fetchUpdates() but doesn't seem to work

#

And I'm not sure if the amount parameter needs to be a string or if I can leave it as a variable?

rustic cobalt
#

Sounds like you may be doing things in the wrong direction. Are you making a request to update the Payment Intent before you have Elements fetch the updated information from the Payment Intent?

final shard
#

Yes I believe that is the order I am doing it in.

rustic cobalt
final shard
#

I am creating a form that logs customer info, which is the customer obj (name, email, phone). Then I render in the Payment Element with the amount and description on top of the Payment Element.

#

But I when I test the form the amount nor the description gets updated in my Stripe Dashboard

rustic cobalt
#

Did you set up any event listeners on your form? What triggers when you make changes to those fields?

final shard
#

I have onChange event listener for both amount and description

#

near the bottom

#

But they don't update, I get the amount I already preset in the server side code

rustic cobalt
final shard
#

Uhhh no they do not trigger the backend to make a request. I update the request before those inputs are available, is that where I'm going wrong?

rustic cobalt
#

Likely, your client-side code is not allowed to directly update a Payment Intent, that request will need to be made by your server-side code using your secret key.

final shard
#

Okay just so I understand better

#

I will need to call my backend to update the details and send them to my front end?

rustic cobalt
#

No, the details are coming from your frontend so you don't not need to send them back to it, though you may need some indication the update request was successful to be provided back to your frontend. Once the Payment Intent has been updated, you can call fetchUpdate() from your frontend code to have elements pull in the updated information.

#

Nick Ortega-update-payment-intent

final shard
#

I am getting PaymentIntent in unexpected status message at the very bottom

#

I also have this on my server-side code as well.

wanton fulcrum
#

๐Ÿ‘‹ could you share the PaymentIntent ID that corresponds to the above status error message?

wanton fulcrum
#

@final shard let me know if you still need help!