#stickyou69

1 messages · Page 1 of 1 (latest)

sick wadiBOT
compact python
#

Payment intent should only be created when customer is at checkout/payment page. It shouldn't be required when customer is adding products to the cart

patent pumice
#

but if they continue shopping

#

and add sonething to the cart

#

the payment intent will be wrong

#

I can cancel the intent every time they continue shopping

#

but the docs say to re-use them

#

(users are locked into checkout page when checking out)

#

say when they add something to the cart, I can update the intent

#

but the loaded page on the browser doesnt know this

#

what if they submit payment from an old tab?

compact python
#

Stripe will always charge the latest amount set on the Payment Intent

patent pumice
#

so my page will say $60

#

but they will be charged 120?

compact python
#

If you wish to show the amount correctly at client, elements.fetchUpdates() can be used

#

It'll pull the latest amount set

patent pumice
#

how often does it poll

compact python
#

But yes, even if you show $60, customer will still be charged $120 even if you don't show correct amount at client

#

Stripe always follow the amount set on the Payment Intent, not the amount displayed at client

patent pumice
#

so if the user is on a stale tab they are just fucked

#

hmm

#

what can I do

compact python
#

If the customer is on older tab, he/she will still be charged with new amount

patent pumice
#

ahh

#

I control the submit button

#

so I can check before submitting

#

if the page is displaying stale data

#

sounds good

compact python
#

Yup! This sounds right

patent pumice
#

so then I don't need to lock down cart modifications while they are checking out

#

maybe a GUID of the cart on checkout page load

#

postback with the GUID

#

only can pay if it matches the current GUID

#

otherwise refresh page

#

ok

#

thanks