最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - How to detect how long since a user's payment failed? - Stack Overflow

programmeradmin1浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论