#notRly
1 messages · Page 1 of 1 (latest)
You're completely allowed to attach the card token you get from apple/google pay to the customer, and once you've attached it you're allowed to reuse it
You only have to detach it if you don't want it to be reused because that's what you want for you integration
Got it!
And these tokens, are they just like normal cards or they can expire at some earlier point?
Is there a limitation on at what moment I can detach them? Or can I do it as soon as Charge was successful?
If you just want to use them once, you don't actually have to attach it to the customer - that'll immediately consume the token and it can't be used again
And no, the tokens don't expire - but we do recommend using them soon after creation because we only store the CVC from the token for a short period of time
Interesting, thanks.
The problem that I initially had was that I get the error that payment method is not attached to a customer.
POST https://api.stripe.com/v1/payment_intents -> {capture_method=automatic, confirm=true, amount=1000, metadata={...}, return_url=..., currency=USD, payment_method=card_1NIJJaCHcuYUidKzSQLkpgj5}
got me this error
ERROR: status_code=400 -- A source must be attached to a customer to be used as a `payment_method`.;
Ah, interesting - it's because you're using the source... I believe if you listened for the paymentmethod instead and used that you wouldn't have to attach it
yeah... And with that, do I have to attach and detach? Or should I just add a customer id to the /v1/payment_intents call to make it work?
👋 taking over here
I don't think so no, but it depends on how are you integrating. Why do you pass a card_xxxx value into payment_method?
I thought that what I should be doing to Apple Pay cards. Should I pass something else? Sorry maybe I'm missing something here and it's in the docs but I didn't find it yet
I get the payment method from client library, and then I'm trying to create a payment intent. What would be the right way to do it?
In our system we have Customers with several payment methods, and UI makes them choose one. So I guess I should provide the id in some way when I create a PI
Users usually have one or more cards "linked" to their account in our system and now we're adding an option to use Apple Pay
Okie, let me ask some clarify question. Which Doc are you following?
Ok I believe paymentMethod.id here should be the format pm_xxx, correct?
oh yeah, there is pm_1NDrXuKMzRtmfm5VKeXiZ0nW
I can try using it instead with PI I guess.
Yep!
Thanks. Is it going to allow me not to attach a payment method to a Customer?