'Stripe: How to simulate the life cycle of a recurring subscription via CLI

I have active subscription, and I need simulate

  1. normal recurring payment
  2. failure recurring payment for example 2 times I have set up in (Manage failed payments) 2 times (Retry 1 day after the previous attempt)
  3. If all retries for a payment fail,

how can I do it? or can I use another solution for testing?

I have web hook listener, and I listen on:

invoice.payment_succeeded: normal subscription renewal and sending the client an email about it

invoice.payment_failed: the failure to pay and sending the client an email about it

customer.subscription.deleted: If all retries for a payment fail stop subscription for client and sending the client an email about it



Solution 1:[1]

You can simulate Billing events (such as successful and failing recurring payments) using test clocks.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jonathan Steele