#Chee Hong-Payment
1 messages · Page 1 of 1 (latest)
Hello, yes you can have multiple PaymentMethod attached to a Customer. But you only can have 1 default PaymentMethod
If i refer to
{{customer_id}},
{type: 'card'}
);```
I only manage to get one
What do you mean by default payment method?
If that API returns only 1 result, that means only 1 PaymentMethod is attached currently
My flow is
- Server side create payment intent with
setup_future_usage=on_sessionand attach customerId. - Client side
confirmCardPaymentby pass in the element.(card_info). Once success, card info become a payment method attach to customer
Ah, you mean if the customer repeat the flow, the new card is replaced the old card ?
Yup
The old card payment method will not retrieavable
Meaning i not able to let customer choose other previous card
Just a quick confirm, why using confirmCardPayment instead of confirmPayment?
In fact, this is a part of code done by other developer. Before that is using handleCardPayment
There is a new requirement that would like to save the credit card. And i found that handleCardPayment is deprecated. And now thinking to change the method to be confirmCardPayment
thanks
I was thinking you are following the exact same flow as the link you provided
Can you give an example request id?
No. We kind of implement the credit card payment in Production
And just enrich the flow
You mean the payment intentId?
Yes PI id could work
like pi_xxx
I just quick tried it and I think the confirmCardPaymentshould preserve multiple Payment Methods as well
I receive multiple PMs when retrieving from a Customer
It would be helpful if I can see your requests flow, so a PaymentIntent Id would be helpful
I see quite a number of Detach requests (for example: req_wCwJAncaIGow1N) Isn't it because of those requests?
I purposely detach the card
just for testing purpose
Do you want me to provide you the customerId for better tracking purpose?
cus_KeBygrKzRQJoQY this one, right?
I think you would want to debug by a fresh setup
there is a testing card 4242 attach now
I can attach another card
for your tracking
- Create a new Customer
- Create a PI from that Customer
- Confirm it with card A
- Repeat step 2 and 3 with card B
- Check the Customer and pasting the ID
customer: 'cus_KeBygrKzRQJoQY',
type: 'card',
}) as any```
I have try again to attach a new card
And it show me only the new card
Here is the payment intent pi_3K1it6HsXhzGaeTv04SwKgvd
{"object":"list","data":[{"id":"pm_1K1iwUHsXhzGaeTvjQYFeUoW","object":"payment_method","billing_details":{"address":{"city":null,"country":null,"line1":null,"line2":null,"postal_code":null,"state":null},"email":null,"name":"Test","phone":null},"card":{"brand":"visa","checks":{"address_line1_check":null,"address_postal_code_check":null,"cvc_check":"pass"},"country":"DE","exp_month":8,"exp_year":2023,"fingerprint":"7XN8542ZKNZgNOfi","funding":"credit","generated_from":null,"last4":"3184","networks":{"available":["visa"],"preferred":null},"three_d_secure_usage":{"supported":true},"wallet":null},"created":1638327190,"customer":"cus_KeBygrKzRQJoQY","livemode":false,"metadata":{},"type":"card"}],"has_more":false,"url":"/v1/payment_methods"}
Another payment intent pi_3K1jTlHsXhzGaeTv1uPdjwAd which attach a new card
{"object":"list","data":[{"id":"pm_1K1jWfHsXhzGaeTvpcgUUFbj","object":"payment_method","billing_details":{"address":{"city":null,"country":null,"line1":null,"line2":null,"postal_code":null,"state":null},"email":null,"name":"Demo","phone":null},"card":{"brand":"visa","checks":{"address_line1_check":null,"address_postal_code_check":null,"cvc_check":"pass"},"country":"FR","exp_month":8,"exp_year":2025,"fingerprint":"LdWp4LEh4eLTnKU7","funding":"credit","generated_from":null,"last4":"3155","networks":{"available":["visa"],"preferred":null},"three_d_secure_usage":{"supported":true},"wallet":null},"created":1638329434,"customer":"cus_KeBygrKzRQJoQY","livemode":false,"metadata":{},"type":"card"}],"has_more":false,"url":"/v1/payment_methods"}
I am a bit confused. In the most recent 2 Payments, you confirmed the card 3184 -> it is attached and became default. Then you confirmed the card 3155 -> it is attached and became default. The 3184 still attached but is not default anymore. After that you detached the 3184 card, now the Customer only has 3155 as the only one and default.
It's expected, I think
I think there is a request: req_gjpitenkHxEv9n
All right. It really has such request being triggered. I have overlook the hidden logic in another process.!
And one more question is about charge again the payment method. A bit different with the sample given in doc
Here is my flow:
For create payment intent(server side), set the
stripeOptions.payment_method = {{pmId}}
stripeOptions.customer = {{customerId}}
stripeOptions.off_session = false
stripeOptions.confirm = false
Above request will require the user to confirmCardPayment in client
In client will be
stripeApiClient
.confirmCardPayment(clientSecret, {payment_method:{{pmId}})
So just to confirm that if the customer will be in the checkout flow. We should set off_session =false instead of true to complete the payment in client, am I right?
I ask this is because I afraid that the card issuer will request for TAC number/reauthenticate if use the payment method