admin管理员组

文章数量:1332353

I'm using Stripe to bill monthly for the use of our website.

I figured out how to retrieve the customer's Subscription object. And I can check the Status property for active or trialing to see if it's currently active.

My question is about when it isn't currently active. I don't want to lock the user out immediately. I want to give them time to try and resolve the payment issue.

So, say I want to give them 10 days to resolve it before I lock the user out. Can someone tell me how I could do this? Is there a date somewhere in the Subscription object that tells me how much time has passed since their billing failed, and I could test whether 10 days has passed?

I'm using Stripe to bill monthly for the use of our website.

I figured out how to retrieve the customer's Subscription object. And I can check the Status property for active or trialing to see if it's currently active.

My question is about when it isn't currently active. I don't want to lock the user out immediately. I want to give them time to try and resolve the payment issue.

So, say I want to give them 10 days to resolve it before I lock the user out. Can someone tell me how I could do this? Is there a date somewhere in the Subscription object that tells me how much time has passed since their billing failed, and I could test whether 10 days has passed?

Share Improve this question asked Nov 20, 2024 at 23:03 Jonathan WoodJonathan Wood 67.4k82 gold badges303 silver badges529 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

There's no date on the Subscription itself to indicate how many days have passed since the first failed payment attempt on the latest Invoice. I think you probably want to use the smart retries feature to retry failed payments and mark a Subscription as unpaid after all retries fail. This way, you can continue to allow access to your service if a Subscription is in past_due state but block access once it transitions to unpaid.

本文标签: cHow to detect how long since a user39s payment failedStack Overflow