#beneordio_checkout-subscription-webhooks

1 messages ยท Page 1 of 1 (latest)

zealous nymphBOT
#

๐Ÿ‘‹ 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.

iron raptor
#

Hi ๐Ÿ‘‹

What kind of Checkout Session are you creating? What mode are you using?

urban panther
#

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

iron raptor
#

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_

urban panther
#

Okay sure

#

sub_1QFztYIBlWedxMGUytbM9tzf

iron raptor
#

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

urban panther
#

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

iron raptor
#

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.

urban panther
#

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?

iron raptor
urban panther
#

I can see it too, weird. Can you check if that session also has a sub_id

cs_live_a1QGdNa7YYZPoz3EPScrWJ1OFdakvQOb7qub4zCcDVZXTxpKNPA9Z9vKtd

iron raptor
#

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",

urban panther
#

damn

#

how does is still end up being a completed checkout session event

iron raptor
#

There is no event associated with this session

urban panther
#

to find actual completed checkout session i need to filter for status=completed then?

iron raptor
#

But, like I said, no checkout.session.completed event fired for that checkout session.

urban panther
#

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?

iron raptor
#

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

urban panther
#

Okay i understand. Thank you!

iron raptor
#

Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚