#aaronk_72176

1 messages · Page 1 of 1 (latest)

normal forumBOT
hard python
#

You just need to have the client secret from the payment intent to confirm the payment

#

So whatever approach makes the most sense for your workflow

junior meadow
#

Also, I see that payment request PaymentRequestOptions takes in a total amount, is it safe to pass in an amount that is calculated client side? If so, does that mean that you necessarily need to create the payment intent before showing the button?

#

Is there an example somewhere of an implmentation of this that does not create the payment intent before showing the button?

hard python
#

You should always calculate the amount on your server side

#

Anyone using the dev tools interface on a web browser could change that themselves

junior meadow
#

but that is just what is shown in the browser right? The amount that will actually be charged would be the amount set in the payment intent correct?

hard python
#

Correct

#

SO that is why. you don't want to create the Payment Intent entirely based on a value passed back from the browser

junior meadow
#

got it makes sense. So it is safe then to set the total in the PaymentRequestOptions from the client specifically for the payment request button as long as the actual amount that is charged on the payment intent is calculated on the server?

hard python
#

Correct

junior meadow
#

great, thank you!