#cnguyen-invoices
1 messages · Page 1 of 1 (latest)
when I check the log, I see invoice.created => payment_intent.succeeded
is that for the first invoice of a subscription specifically?
because those ones are created and charged immediately usually so you can't change the descriptor first! But it depends on the exact details and how you integrate. What invoice ID in_xxx was that?
No. The first invoice is £0 because there is a trial period. Then I test it by ending the trial period now in the stripe dashboard.
in_1KLoiiED5xkfDv2cKgcZXAdI
I have a membership with 7 days trial. I create one. Listen the invoice.created. And I update the statement_descriptor on each invoice.created.
So I update it on the first £0 invoice. But also for the next one
yeah if you end the trial period immediately it creates and charges the invoice immediately
that doesn't happen if you let it expire naturally, in that case it does the thing where it waits an hour and you can change it. (this flow https://stripe.com/docs/billing/invoices/subscription#subscription-renewal)
And maybe it works. It's just I d'ont know how to check it. And I see that the pi generated just after the invoice.created doesn't mention my statement_descriptor but only the calculated one
it definitely doesn't work if you directly force the end of the trial as that's an immediate payment
if you want to test it, use a short trial period (like set trial_end in the API (https://stripe.com/docs/api/subscriptions/create#create_subscription-trial_end) to 5 minutes from now when creating the subscription via the API), then update the invoice during the hour after it's created, then wait and see what the PaymentIntent does after that
If I update the invoice in the invoice.created webhook. It will be good too ?
yes