#.stevenp
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
hello! you can't update the statement_descriptor suffix on a PaymentIntent created by an Invoice
have you tried doing it via this API instead https://stripe.com/docs/api/invoices/update#update_invoice-statement_descriptor?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I dont see the suffix param on there
there's no suffix param there but you can update the entire statement descriptor
ok, so updating the suffix param takes the Stripe shortened billing descriptor and appends * to it and then has that as the final descriptor. * is a restricted character however, so if I try to set the entire string directly on the statement descriptor I don't think it would work
We are currently actually doing it this way (just not using the * char) but for some reason when we update the entire billing statement on the invoice.created webhook, it does not end up updating the billingstatement on every charge object, only a portion of them, and were told to update it on the payment_intent as that's the correct place to do this
you mentioned it does not end up updating the billingstatement on every charge object, only a portion of them - can you share some examples here?
yes
one moment
ch_3O7PrIAd9MgunUWe0qH2nicA -> this one failed to udpate the descriptor correctly
ch_3O7PenAd9MgunUWe00PiE29I -> this one updated the descriptor correctly
They are only a few seconds apart
gimme a while to look into this and get back to you
kk tyvm
for the one that failed - from what I'm seeing, you updated the invoice at 2023-10-31 21:52:38 UTC (https://dashboard.stripe.com/logs/req_TKRGwXTXdTqFQY), but the invoice was already paid at (2023-10-31 21:52:26 UTC). Also, that's the first invoice for a Subscription which is paid via a Checkout Session. The invoice is finalized and paid immediately typically and there's no draft 1 hour period for you to modify the invoice
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
hmmm, it looks like the statement descriptor which you want to use is based off the invoice number also
For the second charge that worked, your application happened to be lucky enough to make the change to the statement descriptor before the customer made payment.
There's really no great workaround here for the first payment I'm afraid.
is it possible to use the payment_intent.created
webhook for this case then?
how would one modify a billing statement for a payment that is created via checkout if not đ
It's not about using payment_intent.created Right now it's dependent on luck i.e. whether you can update the invoice before the customer pays.
For the first invoice, using Checkout Sessions, it's impossible right because of how Checkout with mode=subscription works. There's just no parameter to pass in for the statement descriptor for the first invoice in the Checkout Session
Ok, so the generally advised way to update the billing descriptor is to do it via the payment_intent object, per Stripe's docs, but in this case we cannot do it because the payment_intent is already created and it is being modified after the fact?
you cannot modify the PaymentIntent because the PaymentIntent is created by the Invoice
Ah ok i see
I guess I'm confused - why is the Stripe docs saying to do it on the PaymentIntent?
that's for payments that are created with a PaymentIntent
got it
which would basically be for payments made directly via checkout right?
could we modify the payment_intent for all the checkout sessinos and then the invoices for all the non-checkout subscriptions?
Do you mean you have Subscriptions that are not created via Checkout Sessions?
yea in theory. our use case is an app with merchants that could have all variations of payments. we're looking to implement a robust way of modifying the billing statement for any kind of charge that gets created for their account (i.e. checkout or not checkout, subscription vs one time etc.)
if we can't cover 100% of payment cases thats ok, but we'd like to get our coverage as high as possible
Statement descriptors are complicated. There's no one-size fits all solution here. It'll be easier for me to address specific issues that you're encountering.
Are you providing a service to only update the statement descriptor? Or will your service/app also help to create the payment / subscription?
Only update the descriptor
Could you provide a high level guide on how to update the descriptors to cover as many cases as possible?
Right now we listen to the invoice.created webhook and update it there, which seems to catch some cases
But for the checkout sessions it's unclear how we modify the billing_statement
Better yet, is there some way to globally set up the stripe account in a way where it uses the dynamic billing descriptors with the invoice numbers?
For Invoices, you'll want to listen for the invoice.created webhook. Whether or not the new statement descriptor applies is dependent if you manage to update it before the customer pays. There're certain situations whereby the first invoice will be immediately finalized and charged. There's no workaround for this for your service because you're not the one creating the Subscription / Invoice
Checkout Sessions first invoice for a Subscription is one such situation
Better yet, is there some way to globally set up the stripe account in a way where it uses the dynamic billing descriptors with the invoice numbers?
Unfortunately not. if you would like to see more support for such a feature, I'd suggest writing to https://support.stripe.com/contact/email to explain your use cases/feature request as that helps the product team capture demand for prioritisation
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
perhaps it could be done on the customer.subscription.created?
there's no real difference really. When the subscription is created, the invoice.created event should also have been sent. You can check your webhook events and the time it was sent in your Dashboard.
The reason why I recommend using invoice.created is so that you'll only listen for that and cover all cases where an invoice is generated/used
there's nothing that can be updated at the customer or the subscription level that tells stripe to use the suffix value for all charges?
And it looks like the subscription.created event fires before the invoice and the payment events
first event in the lifecycle is customer.subscription.created
you're changing the suffix for every invoice right?
for each customer it will be the same suffix for every charge on that customer
so if we can change it at the customer level that would be sufficient
first event in the lifecycle is customer.subscription.created
You can look at the time it was sent. Also, we don't guarantee order of delivery of events
we want the final billing statement to be
{{STRIPE_SHORTENED_DESCRIPTOR}}* INVOICE_NUMBER
im seeing subscription.customer.created as the first one for this customer
wouldnt the customer object have to exist within stripe's backend before it could create anything else though? so presumably we can at least guarantee this fires before the charge gets made?
where INVOICE_NUMBER is the value of the invoice on the customer object (i.e. AAAAAAAA, not AAAAAAAA-01)
If we had some way to set the billing statement suffix reliably that would handle this, as Stripe by default when there's a billing_statement_suffix on the payment_intent will use the shortened descriptor set on the account + *
https://stripe.com/docs/webhooks#event-ordering - Stripe doesnât guarantee delivery of events in the order in which theyâre generated.
lets take a step back. you mentioned For each customer it will be the same suffix for every charge on that customer, yet at the same time, you mentioned you want {{STRIPE_SHORTENED_DESCRIPTOR}}* INVOICE_NUMBER.
The invoice number will change every invoice.
so it's not going to be the same for every customer
I'm a little confused about your requirements
apologies, so on Stripe each invoice is of the form XXXXXXXX-DD where DD are two digits and the 8 alphanumeric characters are tied to the customer object
so each customer sees the same billing statement each time, it's tied to the invoice number, not the entire invoice id
invoice_prefix on the Customer object
so basically each statement is of the form
{{ACCOUNT.SHORTENED_BILLING_STATEMENT}}* {{customer.invoice_prefix}}
there's nothing that can be updated at the customer or the subscription level that tells stripe to use the suffix value for all charges
Not for your app.
Generally, how we determine the statement descriptor for the invoice for a Subscription is determined this way :
First off, we check if the current invoice that weâre charging for has a statement_descriptor property set or not. If there is one, we use it for the associated charge.
If there isnât, we then look at the Product (for the Price). When you create a Product, you can set a custom statement descriptor that will be used on all invoices associated with it. When an invoice is created, if it doesnât have a custom statement descriptor we take the one from the corresponding Product. If you have multiple Products, we take the statement descriptor associated with the first Price/Product in the list of items on the subscription, if any.
Got it understood.
So presumably we just need some way of setting that statement_descriptor for every invoice for payments that have invoices, and for the other payments, we perhaps find some workaround
It should be doable to adjust the billing_statement for anything that is a subscription/rebill, as Stripe has time to generate the invoice prior to the charge, correct?
As long as it's not the first payment for a Subscription that is using collection_method=charge_automatically, there will be an ~1 hour interval before the invoice is finalized and paid
yep got it, ty. this is an example of a customer that is on a subscription, however I am not seeing the invoice get created 1hr ahead
can you paste the invoice id here?
it looks like it was due to a failed payment attempt actually and then it retried
I have to head to bed but TYSM for the help here
is it possible for me to reopen this thread tomorrow?
you can ask the new question in the main channel again. You can make reference (by pointing us) to the previous thread. We generally prefer to start a new thread after some time has passed
ok roger that đ