#.zenru

1 messages · Page 1 of 1 (latest)

trail sandalBOT
rough portal
#

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

exotic schooner
#

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?

rough portal
#

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

exotic schooner
#

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.

rough portal
#

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

exotic schooner
#

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.

rough portal
#

I'd mostly recommend using the customer.subscription.updated event for monitoring the status of the Subscription

#

But yeah customer.subscription.updated will fire at every renewal and whenever the status of a Subscription changes.

exotic schooner
#

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.

rough portal
#

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

exotic schooner
#

So I can do this via the clock? And can I set it to the time I want?

rough portal
#

Yep

exotic schooner
#

Then it triggers the desired events and I can launch a script (listener) to process them?

rough portal
#

Yep you can have your Webhook handler running to handle the Events

exotic schooner
#

Okay thank you very much i will try

#

have a nice day

rough portal
#

You too!