#birdy247

1 messages ยท Page 1 of 1 (latest)

fair shaleBOT
keen perch
#

Hi ๐Ÿ‘‹

What's your question?

manic elk
#

We have seen a couple of cases where our clients are paying a different payment_intent to the one in our DB

#

it seems the one they are confirming was made 4 minutes before the one we have in our DB

#

The one they paid (of which we do not have the ID in our DB)

keen perch
#

Just the IDs are all I need. I can't use the Dashboard links

manic elk
#

The one we have in our DB: pi_3MIWmNCt3m4r28lr0dxrSjyV (most recent)

#

The one they confirmed: pi_3MIWiKCt3m4r28lr0Tpknnrk

#

Everytime our checkout page loads, we make a new payment intent

#

So the only way I can see this happening is if they open a browser window, then open another browser window and pay the 1st window

keen perch
#

Okay so it sounds like your front-end was still using the client_secret value from an older payment intent

#

Or the multi-browser scenario

manic elk
#

It must be multi-browser scenario

keen perch
#

But the API calls all look normal to me

manic elk
#

Because we create the payment intent before the page loads

#

And dont cache the secret etc..

#

Any tips of handling this?

keen perch
#

Hmmm... ๐Ÿค”

How do you know it's the same customer?

manic elk
#

because we use meta data to capture the invoice ID's we are including in the charge

#

they match

keen perch
#

Well, either you could configure your DB to handle this scenario (removing the one that didn't get paid and retaining the PI that did get paid). Or you could cancel the older Payment Intent when a new one is generated https://stripe.com/docs/api/payment_intents/cancel

However it might be hard if they accidentally opened a new browser window and closed it immediately.

manic elk
#

Yes, thats the issue

#

We have no way of linking the 2 payment intents (that I know of)

#

Or is the meta data the way?

keen perch
#

That's why I was asking how you knew it was the same customer. I would use the metadata values you append to match up the Payment Intent to your invoice numbers.

manic elk
#

Ok

#

We can do that

#

As a last resort if we cant match the payment intent

#

Or maybe put a hash in the metadata ?

keen perch
#

Either option that is more reliable for you. The metadata property is pretty flexible in terms of what you can add to it.

manic elk
#

ok, thanks, got it