#umairasif7-PaymentMethod

1 messages · Page 1 of 1 (latest)

rustic plover
#

Hi, it depends on your current integration

#

Could you elaborate on your logic which is creating PaymentMethod?

unreal bone
#

First setup intent API gets called, then a code(client_secret) passes to create card element, and after that payment code passes to create payment method API

rustic plover
#

And each time when customers input same card info, it created different PaymentMethods and you want to avoid, correct?

unreal bone
#

Yes, right.

#

Everytime the code is different, but details are same.

rustic plover
#

Did you tight the PaymentMethods to a same Customer?

unreal bone
#

Yes, PaymentMethods was tied to the same Customer.

rustic plover
#

I think the only information you could obtain are probably the last 4 digits/exp_year/exp_month (And it's great that way because you are not exposing to PCI Compliance). So whenever you create a new PaymentMethod, you can list current Customer's PaymentMethods last4/exp_year/exp_month and check for duplication

unreal bone
#

last4/exp_year/exp_month are these unique for each card?

rustic plover
#

Then instead of creating a new PaymentMethod, circle back to frontend and display a popup to your customer "Hey we notice you registered a xxx0000 card. Might be a same card?"

#

No it's not guaranteed, but it's good enough to confirm back the customer

#

Def not guaranteed unique

unreal bone
#

This validation will be implemented during confirmCardSetup process?

rustic plover
#

Yeah, but TBH I am not sure if you can list PaymentMethods from client. You might need a roundtrip to backend, then list the PaymentMethods backend

unreal bone
#

Yeah, you are right.