-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for country-specific fixtures in
trigger
cmd (#1070)
* add support for named fixtures in `trigger` cmd 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) * add a comment * revert * add new triggers * reset generated code * reset pkg/plugins --------- Co-authored-by: Edd Morgan <[email protected]>
- Loading branch information
1 parent
c502ca2
commit c6cdfeb
Showing
7 changed files
with
284 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
pkg/fixtures/triggers/issuing_authorization.request.eu.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"_meta": { | ||
"template_version": 0 | ||
}, | ||
"fixtures": [ | ||
{ | ||
"name": "cardholder", | ||
"path": "/v1/issuing/cardholders", | ||
"method": "post", | ||
"params": { | ||
"name": "My Cardholder", | ||
"type": "individual", | ||
"phone_number": "+34666777888", | ||
"individual": { | ||
"first_name": "My", | ||
"last_name": "Cardholder", | ||
"card_issuing": { | ||
"user_terms_acceptance": { | ||
"date": 1470266163, | ||
"ip": "91.121.146.224" | ||
} | ||
} | ||
}, | ||
"billing": { | ||
"address": { | ||
"line1": "P. de la Castellana 43", | ||
"city": "Madrid", | ||
"state": "Madrid", | ||
"postal_code": "28046", | ||
"country": "ES" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "card", | ||
"path": "/v1/issuing/cards", | ||
"method": "post", | ||
"params": { | ||
"currency": "eur", | ||
"type": "virtual", | ||
"cardholder": "${cardholder:id}", | ||
"status": "active" | ||
} | ||
}, | ||
{ | ||
"name": "authorization_request", | ||
"path": "/v1/issuing/cards/${card:id}/test/authorizations", | ||
"method": "post", | ||
"params": { | ||
"held_amount": 100, | ||
"held_currency": "eur", | ||
"authorization_method": "online" | ||
} | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
pkg/fixtures/triggers/issuing_authorization.request.gb.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"_meta": { | ||
"template_version": 0 | ||
}, | ||
"fixtures": [ | ||
{ | ||
"name": "cardholder", | ||
"path": "/v1/issuing/cardholders", | ||
"method": "post", | ||
"params": { | ||
"name": "My Cardholder", | ||
"type": "individual", | ||
"phone_number": "+447700900000", | ||
"individual": { | ||
"first_name": "My", | ||
"last_name": "Cardholder", | ||
"card_issuing": { | ||
"user_terms_acceptance": { | ||
"date": 1470266163, | ||
"ip": "91.121.146.224" | ||
} | ||
} | ||
}, | ||
"billing": { | ||
"address": { | ||
"line1": "211 Old Street", | ||
"city": "London", | ||
"state": "London", | ||
"postal_code": "EC1V 9NR", | ||
"country": "GB" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "card", | ||
"path": "/v1/issuing/cards", | ||
"method": "post", | ||
"params": { | ||
"currency": "gbp", | ||
"type": "virtual", | ||
"cardholder": "${cardholder:id}", | ||
"status": "active" | ||
} | ||
}, | ||
{ | ||
"name": "authorization_request", | ||
"path": "/v1/issuing/cards/${card:id}/test/authorizations", | ||
"method": "post", | ||
"params": { | ||
"held_amount": 100, | ||
"held_currency": "gbp", | ||
"authorization_method": "online" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"_meta": { | ||
"template_version": 0 | ||
}, | ||
"fixtures": [ | ||
{ | ||
"name": "cardholder", | ||
"path": "/v1/issuing/cardholders", | ||
"method": "post", | ||
"params": { | ||
"name": "My Cardholder", | ||
"type": "individual", | ||
"phone_number": "+34666777888", | ||
"individual": { | ||
"first_name": "My", | ||
"last_name": "Cardholder", | ||
"card_issuing": { | ||
"user_terms_acceptance": { | ||
"date": 1470266163, | ||
"ip": "91.121.146.224" | ||
} | ||
} | ||
}, | ||
"billing": { | ||
"address": { | ||
"line1": "P. de la Castellana 43", | ||
"city": "Madrid", | ||
"state": "Madrid", | ||
"postal_code": "28046", | ||
"country": "ES" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "card", | ||
"path": "/v1/issuing/cards", | ||
"method": "post", | ||
"params": { | ||
"currency": "eur", | ||
"type": "virtual", | ||
"cardholder": "${cardholder:id}" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"_meta": { | ||
"template_version": 0 | ||
}, | ||
"fixtures": [ | ||
{ | ||
"name": "cardholder", | ||
"path": "/v1/issuing/cardholders", | ||
"method": "post", | ||
"params": { | ||
"name": "My Cardholder", | ||
"type": "individual", | ||
"phone_number": "+447700900000", | ||
"individual": { | ||
"first_name": "My", | ||
"last_name": "Cardholder", | ||
"card_issuing": { | ||
"user_terms_acceptance": { | ||
"date": 1470266163, | ||
"ip": "91.121.146.224" | ||
} | ||
} | ||
}, | ||
"billing": { | ||
"address": { | ||
"line1": "211 Old Street", | ||
"city": "London", | ||
"state": "London", | ||
"postal_code": "EC1V 9NR", | ||
"country": "GB" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "card", | ||
"path": "/v1/issuing/cards", | ||
"method": "post", | ||
"params": { | ||
"currency": "gbp", | ||
"type": "virtual", | ||
"cardholder": "${cardholder:id}" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"_meta": { | ||
"template_version": 0 | ||
}, | ||
"fixtures": [ | ||
{ | ||
"name": "cardholder", | ||
"path": "/v1/issuing/cardholders", | ||
"method": "post", | ||
"params": { | ||
"name": "My Cardholder", | ||
"type": "individual", | ||
"phone_number": "+34666777888", | ||
"individual": { | ||
"first_name": "My", | ||
"last_name": "Cardholder", | ||
"card_issuing": { | ||
"user_terms_acceptance": { | ||
"date": 1470266163, | ||
"ip": "91.121.146.224" | ||
} | ||
} | ||
}, | ||
"billing": { | ||
"address": { | ||
"line1": "P. de la Castellana 43", | ||
"city": "Madrid", | ||
"state": "Madrid", | ||
"postal_code": "28046", | ||
"country": "ES" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"_meta": { | ||
"template_version": 0 | ||
}, | ||
"fixtures": [ | ||
{ | ||
"name": "cardholder", | ||
"path": "/v1/issuing/cardholders", | ||
"method": "post", | ||
"params": { | ||
"name": "My Cardholder", | ||
"type": "individual", | ||
"phone_number": "+447700900000", | ||
"individual": { | ||
"first_name": "My", | ||
"last_name": "Cardholder", | ||
"card_issuing": { | ||
"user_terms_acceptance": { | ||
"date": 1470266163, | ||
"ip": "91.121.146.224" | ||
} | ||
} | ||
}, | ||
"billing": { | ||
"address": { | ||
"line1": "211 Old Street", | ||
"city": "London", | ||
"state": "London", | ||
"postal_code": "EC1V 9NR", | ||
"country": "GB" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |