#sunagimo_api

1 messages · Page 1 of 1 (latest)

desert flareBOT
#

👋 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.

azure nova
#

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

#

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

cunning pine
#

Thank you. I thought the Charge API was not recommended. Is it okay to continue using it in the future?

azure nova
#

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?

cunning pine
cunning pine
#

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?

azure nova
#

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

Learn how to fulfill payments received with the Checkout Sessions API.