#sunagimo_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/1357567975003000832
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- sunagimo_webhooks, 6 days ago, 15 messages
hello! The example event (evt_1RA06RJeNdmp8jhmuRkllSXx) you shared is a Checkout Session that is created with mode="subscription" . Only Checkout Sessions that are created with mode=setup will have setup_intent populated : https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
for a Checkout Session that is created with mode="subscription", I'll suggest retrieving the Checkout Session and expanding the subscription parameter. The corresponding Subscription object returned should have a default_payment_method set : https://docs.stripe.com/api/subscriptions/object#subscription_object-default_payment_method
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.
Thank you. I thought the Charge API was not recommended. Is it okay to continue using it in the future?
sorry, I'm a little confused. There was no mention of the Charge API in my answer above. Are you asking a new question about the Charge API?
I thought so because the expanding responses link (https://docs.stripe.com/api/expanding_objects) used Stripe::Charge.retrieve as an example. I’ll try to see if the expanding parameter works with Stripe::Subscription.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you! I was able to retrieve the payment_method just by fetching the Subscription again using the subscription included in the Checkout Session object.
I think I heard before that even at the time of checkout.session.completed, the subscription.default_payment_method might still be null until the subscription is fully created. Is there a chance that it could be null?
hmmm, I haven't heard of this issue before. I think one possibility could be for asynchronous payment methods, but in which case, you should really be listening for checkout.session.async_payment_succeeded too. You may want to go through this guide too : https://docs.stripe.com/checkout/fulfillment
more specifically - https://docs.stripe.com/checkout/fulfillment?payment-ui=stripe-hosted#immediate-versus-delayed-payment-methods