#Gizmo-past due subscription
1 messages ยท Page 1 of 1 (latest)
Hi tarzan, thank you!
I don't have a straight forward of way of doing this
I might need to ask my colleagues, could you please hold on a bit
Sure, thank you. I'm looking for the number of days a subscription is past due and the date it was paid through.
do you need this on past subscriptions?
as analysis data
or do you want to implement this going on forward
Just going forward. For a current unexpired subscription I need to know how many days overdue it is, and ideally the paid through date (when it became overdue). I need to display how many days a subscription payment is overdue is on my site, and after a certain number of days I end the subscription.
I also email users n days in advance of their subscription renewal so they're not surprised and there are fewer complaints, so I use the paid through date for that as well
Hey, taking over here
Hi ynnoj
There's no past due state stored on the Subscription object
Thinking if there's a way to compute these values
Thank you for giving this thought!
I assume you're using collection_method: 'charge_automatically' on your Subscriptions?
I'll double check
I'm calling the PHP library subscriptions->create with, in part,
'expand' => ['latest_invoice.payment_intent'],
'payment_settings' => [
'save_default_payment_method' => 'on_subscription'
]```
Then I'm using the latest_invoice payment intent as the payment intent for my customer to pay
There is no explicit mention of collection_method, I followed these instructions, https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements&card-or-payment-element=payment-element
Yep, it's not a required parameter: https://stripe.com/docs/api/subscriptions/create#create_subscription-collection_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Reason I ask is if you use send_invoice then the due date of the invoice is tracked on the Invoice object. But not for charge_automatically (default)
Gotcha. So given that I don't, there isn't a due date? Is there any way to calculate it based on what we have? I originally thought the number of days past due would be the number of days since the current period start (which is available) if the status is past_due.
Hmm, not sure if that will work. The subscription will keep cycling through billing periods, regardless of invoice status
Yeah that's what I realized. Is there any way you can think of? Is there a way to get the last successful payment for a subscription?
Also, will the subscription renew/charge automatically even if I haven't explicitly set collection_method=charge_automatically?
Yes, that's the default behaviour
Thanks
So if my subscriptions are annual
Would it be safe to regard the billing_period_start as the paid through date if the current status is past_due?
If I'm going to terminate the subscription after 90 days of non payment such that it should never remain past due over another year threshold?
I think that makes sense yes. current_period_start (assuming that's what you meant) is basically the time the most recent invoice was issued
so that makes sense as a date from which payment is due
Yes, current period start.
I'm trying to get the date through which the subscription is paid for/paid up, so it seems it should be the current_period_start for any subscription in a past_due state, and a current_period_end for any subscription in an active state, right?
that seems reasonable
Thanks. Is there a discrete state for subscriptions that are over as opposed to subscriptions which are canceled, which I know can still be "active" until the end of the current billing period?
Hi there. Catching up
Also, what do you mean by "subscriptions that are over"?
Thanks for this link, I hadn't read it yet. By "over" I mean if a subscription's renewal fails and the customer hasn't addressed it within n days, I want to end their subscription.
Oh you can customize that behavior here: https://dashboard.stripe.com/settings/billing/automatic. In your "manage failed payments" section
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Thanks, it looks like I have a good amount of reading to do. Do people typically send their own upcoming renewal email or let Stripe handle it? I had created it in my application, but I wonder if I should just let Stripe take care of it
Totally up to you. If you let stripe do it, you can customize the branding: https://dashboard.stripe.com/settings/branding
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Terrific, thank you. I'll read through all of this after work. Have a great day
No problem! Same to you