#beneordio_checkout-subscription-webhooks
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/1301945472554111087
๐ 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.
- beneordio_webhooks, 1 day ago, 16 messages
- beneordio_api, 1 day ago, 24 messages
Hi ๐
What kind of Checkout Session are you creating? What mode are you using?
subscription mode
customer={{262153501__Customer_ID_Stripe__c}}&
line_items[0][price]={{259288780__ProductCode}}&
line_items[0][quantity]={{259288780__Quantity}}&
mode=subscription&
subscription_data[proration_behavior]=create_prorations&
subscription_data[billing_cycle_anchor]={{259288783__output}}&
success_url=[]
cancel_url=[]
payment_method_collection=always&
automatic_tax[enabled]=true&
customer_update[address]=auto
Okay in that case the Payment Method is not saved to the Checkout Session but the created Subscription object. Can you share a Subscription ID that was created from one of these Checkout Sessions? It will start with sub_
Thanks, taking a look
Okay it's as I thought. The payment method the customer provided is not saved to the Checkout Session ( there's no payment_method property on the Checkout Session to save it to) but it is saved as the default_payment_method on the Subscription object.
If you are listening to Checkout Session webhook events, you can find the Payment Method by using the Subscription ID in the subscription property on the Checkout Session object to retrieve the Subscription object and then save the value in the default_payment_method as the invoice_settings.default_payment_method for the Customer
I understand, however within my "completed checkout session" i did not find any subscription ids, weirdly..
for the one i sent you i found the subscription id by looking up the customer manually
It is possible that the Subscription was still in the process of being created when the Checkout Session event was fired. In that case there wouldn't be an ID to save to the subscription property.
May be because no completed checkout session event contains a sub_id
I cant configure the checkout to set the default payment method on the customer, can i?
Wait I'm looking at the events for this Subscription and I see the ID in the checkout.session.completed event here: https://dashboard.stripe.com/events/evt_1QFzvSIBlWedxMGUPfn1bkDV
I can see it too, weird. Can you check if that session also has a sub_id
cs_live_a1QGdNa7YYZPoz3EPScrWJ1OFdakvQOb7qub4zCcDVZXTxpKNPA9Z9vKtd
Looking
Ah no this session was never completed so no sub was created
You can tell because it has status: "open",
and payment_status: "unpaid",
There is no event associated with this session
to find actual completed checkout session i need to filter for status=completed then?
If you are using the List API, yeah. https://docs.stripe.com/api/checkout/sessions/list
But, like I said, no checkout.session.completed event fired for that checkout session.
okay i will use the filter then and find the default.payment.method via the subscription id and set it on the customer correct?
or will most completed checkout sessions be open and unpaid because of the payment method used? and if so is there another event once they are completed?
No
Sorry but you are mixing up what the status means
Any checkout session with status: "open" has not been completed
There was no attempt to pay it. no customer ever provided any payment method information
You cannot save a payment method that doesn't exist
Okay i understand. Thank you!
Happy to shed what ๐ก I can ๐