#nachofranco14

1 messages · Page 1 of 1 (latest)

subtle sapphireBOT
vivid horizon
#

Hello! Error seems pretty descriptive to me. pm_1O0fHtBEDYDqpisuSOV4GlAu is already attach to a different Customer: cus_KKVhfEF52rOOPG

#

It can't be attached to multiple

quaint moat
#

but it is the same person

#

it is descriptive to me as well, definitely

vivid horizon
#

Doesn't matter I'm afraid. They can only be attached to a single Customer object

quaint moat
#

if I cannot attach the same payment method to two customers why did Stripe allowed me to create the same customer twice? (with same name and email)

#

cus_OfkByI7ejoOOh9 and cus_KKVhfEF52rOOPG

#

actually, this used to throw an error

vivid horizon
#

Because we don't check for email/name uniqueness

#

If that is important to you, then you'll need to implement that check in your code

quaint moat
#

🤦‍♂️

#

how can I solve this problem then?

vivid horizon
#

Which problem is that?

quaint moat
#

I have to attach the same payment method to the same person

#

which in this case is two different customers in Stripe

vivid horizon
#

You would need to create a new Payment Method (pm_xxx) with the same card details

quaint moat
#

it's not a card

#

it's an IBAN

#

we're using sepa direct debit

vivid horizon
#

That works for non-card PMs too

#

Payment Element supports SEPA

#

But either way you need a new pm_xxx object

quaint moat
#

that's okay, what's is rather strange is that this didn't happen before

#

see these two customers: cus_Jww1LxUrPojhGC and cus_OnyvPYQqO8xOO0

vivid horizon
#

What about them?

quaint moat
#

or these two: cus_LQY99ntRrnmaB0, cus_MWT7Ba3FCaRvhY

#

they are the same person, two customer objects and exactly identical IBAN

vivid horizon
#

Yeah, to be clear that is fine. You can have 2 customers that have unique pm_xxx object that are the same underlying IBAN

quaint moat
#

ahhhhh

vivid horizon
#

That's not an issue. The issue is that the pm_xxx needs to be unique

quaint moat
#

I understand what happened now

vivid horizon
#

A single pm_xxx can only belong to one cus_xxx

quaint moat
#

we're using the key meant to avoid repeating exactly identical requests

#

so, the person that updated the payment method did both updates within the same time range, let's say with 10mins diff

#

so the idempotency key was the same because tthe ddata used was the same

#

and hence the payment_method_id was the same, as the idempotency key was the same

#

do you happen to know how long those idempotency keys leave?

vivid horizon
quaint moat
#

ok. thanks