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

I'm using Stripe to bill monthly for the use of our website.I figured out how to retrieve the cus

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742322674a4422128.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信