Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for country-specific fixtures in trigger cmd #1070

Merged

Conversation

edd-stripe
Copy link
Contributor

@edd-stripe edd-stripe commented May 3, 2023

Reviewers

r? @
cc @stripe/developer-products

Summary

Adds some additional "variants" to triggers that are country-specific.

Primary motivation is to provide better CLI support for users whose account contexts don't allow them to use the values hardcoded in the existing fixtures (for e.g. Issuing users in the EU are not permitted to issue cards to cardholders in the US) - and to do so as first-class support, instead of requiring those users to bring their own fixtures or provide overly complex override flags.

In other words, this should be considered a native replacement for frequently-used patterns of override flags or scenarios where users often provide similar custom fixtures.

Usage examples

$ stripe trigger issuing_authorization.request # default, US
$ stripe trigger issuing_authorization.request.gb # new
$ stripe trigger issuing_authorization.request.eu # new

Examples of previous usage to achieve the same effect:

$ stripe trigger issuing_authorization.request \
  --override cardholder:billing.address.country=GB \
  --override cardholder:phone_number=+440000009900 \
  --override card:currency=gbp \
  --add authorization_request:held_currency=gbp

$ stripe trigger issuing_authorization.request \
  --override cardholder:billing.address.country=ES \
  --override cardholder:phone_number=+34000000990 \
  --override card:currency=eur \
  --add authorization_request:held_currency=eur

$ stripe fixtures some_json_file_provided_by_the_user.json

Adds support for explicitly specifying which fixture file to use when
triggering an event with `stripe trigger`. Achieves this by adding a
`--fixture` flag to the executable, the value of which will be the name
of a fixture "variant" (_variant_ because it will still only use
fixtures that are explicitly allowed for the given event name)
@edd-stripe edd-stripe requested a review from a team as a code owner May 3, 2023 09:11
@CLAassistant
Copy link

CLAassistant commented May 3, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant

This comment was marked as duplicate.

@edd-stripe edd-stripe changed the title Add support for named fixtures in trigger cmd Add support for country-specific fixtures in trigger cmd May 12, 2023
@edd-stripe
Copy link
Contributor Author

r? @stripe/developer-products

@tomer-stripe tomer-stripe merged commit c6cdfeb into stripe:master May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants