#.zenru
1 messages · Page 1 of 1 (latest)
Hi there
No don't think this is possible without using the --edit flag and adjusting the fixtures
Since the Customer is going to be in multiple requests here
Sorry, I don't know the CLI very well yet, but I'm reading the documentation in the meantime. --edit allows me to modify a fixture like the customer one, for example to set the id that suits me and not create a new customer every time I try to test the webhook?
Ah actually can you try ```stripe trigger invoice.payment_succeeded --override invoice:customer=cus_123
Where you replace cus_123 with your own Customer
Hmm no that won't work
Becuase yeah like I said the earlier requests get associated to a different Customer
Ah
Try stripe trigger invoice.payment_succeeded --override payment_method:customer=cus_123 --override invoice:customer=cus_123
Believe that should work
Okay. Well, maybe by explaining the objective of what I'm trying to do, the solution will be easier to find. In fact, I'd like to see the status of a customer's subscription move with each passing month. In fact, I want to test the case where the direct debit falls into arrears or even succeeds. I want to test webhook events to test the change of state of my subscription at each interval.
Okay i will try ty
The best thing to do with this is to use a Test Clock
Triggering events via the CLI probably won't accomplish what you want here
But setting up an actual test using a Test Clock is likely to be best
Okay, I'll try the two solutions you suggest here. One last thing, does this let me know when my subscription changes, for example, and when my bill isn't paid? In fact, I need to implement a logic behind the webhook events.
I'd mostly recommend using the customer.subscription.updated event for monitoring the status of the Subscription
You can see https://stripe.com/docs/billing/subscriptions/webhooks for the different Webhooks for Billing
But yeah customer.subscription.updated will fire at every renewal and whenever the status of a Subscription changes.
However, by targeting this event with the CLI, a new customer is created, as well as a new subscription. But I want to test an existing sub.
Right that's why the CLI isn't really the best thing to do here.
What you want to do is write a quick test script on your side
And run the script to actually fire off the Events that you want that are related to the objects on your account
So I can do this via the clock? And can I set it to the time I want?
Yep
Then it triggers the desired events and I can launch a script (listener) to process them?
Yep you can have your Webhook handler running to handle the Events
You too!