#Andres2792

1 messages · Page 1 of 1 (latest)

signal vigilBOT
fresh ruin
#

Okay in that case you would want to use the --override flag. However, it can be hard to understand what you need to override

#

But all the events that you trigger are defined by JSON fixtures

obtuse olive
#

ohh just need to give name to the Customer the CLI creates to be included in the JSON payload so my server do something special for a customer

fresh ruin
#

Well if you look at the fixture for customer.created:

"fixtures": [
    {
      "name": "customer",
      "path": "/v1/customers",
      "method": "post",
      "params": {
        "description": "(created by Stripe CLI)"
      }
    }

The only param is the Description. So in that case --override wouldn't work because the fixture doesn't use the name parameter. In those cases you use the --add flag
https://stripe.com/docs/cli/trigger#trigger-add

#

This fixture describes exactly what the CLI will do to trigger the customer.created event. For the step called customer it will make a POST request to /v1/customers and pass the parameter description with the value provided.

obtuse olive
#

so the add will add the parameter to my local fixture?

fresh ruin
#

If you use it during the CLI command it will add it to the params used for that call.

obtuse olive
#

so for example the CLI command should be Stripe trigger customer.create --add customer:name=whatever

fresh ruin
#

If you want to write your own fixtures you can get seriously custom. We document that here: https://stripe.com/docs/cli/fixtures
Yes the command stripe trigger customer.create --add customer:name=Sue will create a customer named Sue

obtuse olive
#

great! that was it! really thanks for your help !