#StefanG - Checkout Session
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Could you share a request ID for one of these Checkout Session creation requests?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
@lofty adder req_hYRoy6CAlDTxWk
that one was for a subscription checkout session
req_1frqty9gtHYs91 this is for a payment checkout session
Okay do you have the subscription that is created once this is processed?
yep
Okay I am seeing the description for this sub: testInt testInt; Tno8lVHDkXf6E7wjy6GS7yHO8ms1; subscription;
yes, that should be it, but where is it?
it doesnt show up in the payments dashboard
subscription.descrption
I cant see it here
nor in this object
I want to see it in the dashboard in order for my client to be able to identify payments when they export the table
it does show up, as you can see, for a normal payment, but not for subscriptions
That is an invoice, not a subscription.
ook, then in the first photo?
For some reason the description you have shown me, which is the correct one, does not show up in the dashboard with all payments. If you have seen, it means that probably I have implemented this correctly
One mention tho. This feature with subscription description is new, I have opened an issue on github about this as the api was not updated to be in sync with the docs. In the docs there was a description for subscription to be set when creating a checkout session, but not in the code
Now, in v9.1.0 for stripe-node, the description is also available for the subscription, maybe this is the case why the description does not show up there?
What is it you are trying to achieve here? A subscription is not a payment in itself. It generates payments. Are you saying you want to see the description you put on this subscription on each invoice?
In the first photo I sent you, I have payments for both one time stuff, and for subscriptions
I can attach a description to the one time payment, as seen in the photo with that long description
But, I cant do that for the payment related to the subscription
That is a default description: "Subscription creation" I want to change that
That Description is auto-created by the Dashboard and takes many factors into account
yea, but, how to override it?
when I create a checkout session, I do this for mode payment:
payment_intent_data: {description: ${authorName}; ${paymentObject.author}; purchase; ${paymentObject.title}; ${paymentObject.content}, },
sorry for the bad formatting
and for subscription I do this
subscription_data: { description: ${authorName}; ${paymentObject.author}; subscription;, },
the first one overrides the description
the second one does not
If you use three backticks (`) it will create a formatted code block
ah, sorry:
description:`${authorName};${paymentObject.author};purchase;${paymentObject.title};${paymentObject.content}`
},```
subscription_data: {
description: `${authorName};${paymentObject.author};subscription;`
}```
the first one is for checkout session in mode payment
the second one is for checkout session on mode subscription
the first one does override the default description as seen in the first photo
the second one does not override the default : "Subscription creation" description
that's what i dont undertsand, why one does work and the other one doesnt?
The description is getting created on the Subscription. It's just not being used for that particular list view
I understand, then, is there a way to add a custom description to that view?
I need it there for the export
Or, do you know another way to make payments (one time/subscriptions) more recognizable; The only option I found was the description
Hello, snufkin had to step out but I can help. Catching up on your question...
Alrighty. Thanks for the help @lofty adder ๐
So basically you are looking to update the descriptions that show up on the "Payments" page as well?
yep, I need this to make them identifiable by my client when they export the whole payments table.
I am able to do this for checkout session in payment mode, but I cant do it for subscription mode
You can set this but you will need to do an extra API call. The descriptions you are seeing there are the descriptions of the various PaymentIntents on the Invoices that this subscription creates
That info is not automatically copied over so whenever an Invoice is generated, you can look up the description that you set on your Subscription and then make an update call on its PaymentIntent and pass the description in to the description parameter https://stripe.com/docs/api/payment_intents/update#update_payment_intent-description
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, I understand, but then, I do not get any payment intent returned from the checkout session when going into subscription mode
this is what I get from the checkout session as payload going into the webhook
or in this case, it doesnt even exist
Right, the payment intent is not on the Checkout Session or the Subscription, the subscription creates Invoice objects and those have PaymentIntents on them
You will likely want to set up a webhook and listen for the invoice.created event and then you can update the description i that event.
But to see a quick example of what I am talking about, if you look up the Subscription from that Checkout Session, it has a latest_invoice property, if you look up that Invoice, it has a payment_intent property and that is the PaymentIntent that you want to update for it to appear on how you want on the Payments page of the dashboard.
Oki doki, I have seen the steps also. From the checkout session object, get the sub id to get sub object; then get latest invoice for the invoice object, then payment intent, and update that payment intent
I will try this tomorrow to see if it works
Thanks for the help!
Oh, and also, this updated payment intent will only be for this payment, right?
The description will not be applied for the future payments by this subscription
If I understood correctly
thats why I need to catch tht invoice.created event?
Correct, it will only be for the one payment. There is not a setting to have every generated PaymentIntent have a certain description so you will need to set it on each PaymentIntent as they are created