#sweetpotato
1 messages ยท Page 1 of 1 (latest)
hello! you would want to go through this section : https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
When Stripe redirects the customer to the return_url, we provide the client_secret in the URL query parameters, which you can use the retrieve the PaymentIntent with the publishable key. The PaymentMethod ID will be returned as part of the PaymentIntent : https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method
thank you.
i have one more question..
this error has occurred.
Payment was successful, then Payment method can use next time by Customer
What should I do?
can you paste the PaymentMethod id here for me to take a look?
you would want to go through this guide : https://stripe.com/docs/payments/save-during-payment
The key points are that you should include a customer id, and setup_future_usage=off_session when creating the PaymentIntent
but i create the PaymentIntent with setup_future_usage=off_session , i can use only card..
i think Customers shold be free to choose payment methods. (alipay,klarna...)
so, i want that customer choose payment method(card,klarna,alipay...etc) , and if they select the card and pay successfully , next their card saved
you can specify setup_future_usage only for card in this parameter : https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card-setup_future_usage
If you use https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card-setup_future_usage - you can save cards for future usage, but still support other payment methods like Klarna and Alipay
I have never confused.
you mean like this picture??
This will only return card.
๐ Taking over this thread, catching up now
Can you share the payment intent ID (pi_xxx) created from your code above?
pi_3NIPSUEBFG6Yi3HC0opBAbhX : 3 paymentmethod return
pi_3NIPU6EBFG6Yi3HC13cahKE1 :1 paymentMethod return
Klarna and Alipay don't support saving a payment method. When you set setup_future_usage, both Klarna and Alipay aren't applicable, so they will not be shown. That's why pi_3NIPU6EBFG6Yi3HC13cahKE1 only has one payment method returned.
In pi_3NIPSUEBFG6Yi3HC0opBAbhX that doesn't have setup_future_usage set, it will return the payment methods that support one-time payment.
If you wish to have card with setup_future_usage and Klarna/Alipay for one-time payment shown, that's also possible. You don't set setup_future_usage on the parent request, but on the payment_method_options.card.setup_future_usage (card only) as suggested by alex earlier: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card-setup_future_usage
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Payment method is public, but why do you want to expose the customer? It just a random ID that customer probably won't understand
Maybe the member won't see the IDs, but I want to show the last 4 digits and allow the customer to select a card.
I want to enable payment with the selected card.
I see! As long as you can map the selected card with the corresponding payment method ID (pm_xxx), then it should just work
I have one more question..
Is there a function to specify a default among the Payment Methods with one time payment?
There is no default payment method for one-time payment
thank you!