#pl_api
1 messages · Page 1 of 1 (latest)
đź‘‹ Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đź”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1272764131384098906
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
customer_id: cus_QZ1ahW7JKznSLd
default payment_method id: pm_1PhtZfP7LyQtEQaSfXCmhSSD
Checkout Session doesn't support listing all the saved payment methods.
From https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-customer:
In subscription mode, the customer’s default payment method will be used if it’s a card, otherwise the most recently saved card will be used.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I understand regarding the list. Thank you.
The default payment method is set, but why is this not embedded?
Could you share the example Checkout Session ID (cs_xxx), so that I can take a look?
The following information on the Log page?
https://dashboard.stripe.com/test/logs/req_Cpcv9pny91eTlz
POST /v1/checkout/sessions 200 OK
customer — cus_QZ1ahW7JKznSLd
checkout.session — cs_test_a1i8fSGISUooR8iWtbRhvBy4jAhiDCuZHHdpsVzNDqdzSwdbzAqF1Y4j2J
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
HI there, is it about prefilling saved payment method in checkout https://support.stripe.com/questions/prefilling-saved-cards-in-checkout
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I thought from the API description that all I had to do was specify the id of the Customer for whom the default payment method was set, but does that mean I also need to deal with the link?
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-customer
customer string
ID of an existing Customer, if one exists. In payment mode, the customer’s most recently saved card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. In subscription mode, the customer’s default payment method will be used if it’s a card, otherwise the most recently saved card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer’s card details.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
It's more than that, as the doc mentioned, you also need to enable https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-saved_payment_method_options-payment_method_save
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Isn't this an option for "storing" the card information entered in the session?
I'll try.
- Update to and create session with payment_method_save = enabled
- In the session, turn on the card details and "Save my payment information for future purchases" and subscribe.
The card information has been registered. (Visa ...4242 Jan 2025)
- Logs
POST /v1/checkout/sessions: req_k9s459VVeCRTFk
POST /v1/payment_pages/cs_test_a15ypHakxmlKMViX0tBDcstPee6ZMP3BaHOYMmKqZu7EljJVrOrebBKttb: req_BQYjXezUojxs6w
- Create session again (same parameters as 1).
-> The card information set in 2 is not embedded.
- Logs
POST /v1/checkout/sessions: req_cz5zPYTDtiTQ55
await stripe.checkout.sessions.create({
customer: customerId,
line_items: items,
mode: "subscription",
success_url: returnUrl,
cancel_url: returnUrl,
payment_method_types: ["card"],
saved_payment_method_options: {
payment_method_save: "enabled",
},
locale: "en",
});
Thanks for waiting.
So you don't see any saved payment mehtods in the 2nd checkout page?
That's right.
As a supplementary note, in the first Checkout, I just set the check box to on; I did not enter a phone number for Link.
Ok, you need to remove saved_payment_method_options in the 2nd checkout session creation request
I tried deleting and creating a session (for 3rd time), but the payment method I registered for 1st time is not embedded.
req_QEfqjStkMVKHF7
I would like to ask one more question.
When creating a Subscription using Session, I would like to include two types of interval, monthly and yearly, as candidates for the item, but when I specify them, I receive the following error message.
Checkout does not support multiple prices with different billing intervals.
Is there a way to create a registration screen using Stripe hosted ui that selects from Subscription Items of multiple time periods? If not, what is the recommended flow?
No, you can't create a subscription with prices of different billing intervals.
The workaround is to create to subscriptions separately
Can you tell us the difference between the following two?
subscription Assuming an update, how would you use it differently to check billing information for an assumed user?
https://docs.stripe.com/api/invoices/create_preview
https://docs.stripe.com/api/invoices/upcoming
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
They are very similar. preview invoice is a new API that Stripe added recently
If so, should I use preview invoice?