Skip to content

Commit

Permalink
Fix Invoice fixtures to work with latest API version (stripe#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe authored Aug 15, 2022
1 parent bdd91b9 commit 1a2bbeb
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 44 deletions.
6 changes: 3 additions & 3 deletions pkg/fixtures/triggers/invoice.created.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"path": "/v1/customers",
"method": "post",
"params": {
"description": "(created by Stripe CLI)",
"source": "tok_visa"
"description": "(created by Stripe CLI)"
}
},
{
Expand All @@ -29,7 +28,8 @@
"method": "post",
"params": {
"customer": "${customer:id}",
"description": "(created by Stripe CLI)"
"description": "(created by Stripe CLI)",
"pending_invoice_items_behavior": "include"
}
}
]
Expand Down
6 changes: 3 additions & 3 deletions pkg/fixtures/triggers/invoice.finalized.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"path": "/v1/customers",
"method": "post",
"params": {
"description": "(created by Stripe CLI)",
"source": "tok_visa"
"description": "(created by Stripe CLI)"
}
},
{
Expand All @@ -29,7 +28,8 @@
"method": "post",
"params": {
"customer": "${customer:id}",
"description": "(created by Stripe CLI)"
"description": "(created by Stripe CLI)",
"pending_invoice_items_behavior": "include"
}
},
{
Expand Down
19 changes: 15 additions & 4 deletions pkg/fixtures/triggers/invoice.paid.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@
"path": "/v1/customers",
"method": "post",
"params": {
"description": "(created by Stripe CLI)",
"source": "tok_visa"
"description": "(created by Stripe CLI)"
}
},
{
"name": "payment_method",
"path": "/v1/payment_methods/pm_card_visa/attach",
"method": "post",
"params": {
"customer": "${customer:id}"
}
},
{
Expand All @@ -29,13 +36,17 @@
"method": "post",
"params": {
"customer": "${customer:id}",
"description": "(created by Stripe CLI)"
"description": "(created by Stripe CLI)",
"pending_invoice_items_behavior": "include"
}
},
{
"name": "invoice_pay",
"path": "/v1/invoices/${invoice:id}/pay",
"method": "post"
"method": "post",
"params": {
"payment_method": "${payment_method:id}"
}
}
]
}
36 changes: 11 additions & 25 deletions pkg/fixtures/triggers/invoice.payment_action_required.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@
"path": "/v1/customers",
"method": "post",
"params": {
"description": "(created by Stripe CLI)",
"source": "tok_visa"
"description": "(created by Stripe CLI)"
}
},
{
"name": "payment_method",
"path": "/v1/payment_methods/pm_card_threeDSecure2Required/attach",
"method": "post",
"params": {
"customer": "${customer:id}"
}
},
{
Expand All @@ -29,29 +36,8 @@
"method": "post",
"params": {
"customer": "${customer:id}",
"description": "(created by Stripe CLI)"
}
},
{
"name": "payment_method",
"path": "/v1/payment_methods",
"method": "post",
"params": {
"type": "card",
"card": {
"exp_month": 7,
"exp_year": 25,
"number": "4000000000003220",
"cvc": "424"
}
}
},
{
"name": "attach_payment_method",
"path": "/v1/payment_methods/${payment_method:id}/attach",
"method": "post",
"params": {
"customer": "${customer:id}"
"description": "(created by Stripe CLI)",
"pending_invoice_items_behavior": "include"
}
},
{
Expand Down
19 changes: 15 additions & 4 deletions pkg/fixtures/triggers/invoice.payment_failed.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@
"path": "/v1/customers",
"method": "post",
"params": {
"description": "(created by Stripe CLI)",
"source": "tok_chargeCustomerFail"
"description": "(created by Stripe CLI)"
}
},
{
"name": "payment_method",
"path": "/v1/payment_methods/pm_card_chargeCustomerFail/attach",
"method": "post",
"params": {
"customer": "${customer:id}"
}
},
{
Expand All @@ -29,14 +36,18 @@
"method": "post",
"params": {
"customer": "${customer:id}",
"description": "(created by Stripe CLI)"
"description": "(created by Stripe CLI)",
"pending_invoice_items_behavior": "include"
}
},
{
"name": "invoice_pay",
"expected_error_type": "card_error",
"path": "/v1/invoices/${invoice:id}/pay",
"method": "post"
"method": "post",
"params": {
"payment_method": "${payment_method:id}"
}
}
]
}
19 changes: 15 additions & 4 deletions pkg/fixtures/triggers/invoice.payment_succeeded.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@
"path": "/v1/customers",
"method": "post",
"params": {
"description": "(created by Stripe CLI)",
"source": "tok_visa"
"description": "(created by Stripe CLI)"
}
},
{
"name": "payment_method",
"path": "/v1/payment_methods/pm_card_visa/attach",
"method": "post",
"params": {
"customer": "${customer:id}"
}
},
{
Expand All @@ -29,13 +36,17 @@
"method": "post",
"params": {
"customer": "${customer:id}",
"description": "(created by Stripe CLI)"
"description": "(created by Stripe CLI)",
"pending_invoice_items_behavior": "include"
}
},
{
"name": "invoice_pay",
"path": "/v1/invoices/${invoice:id}/pay",
"method": "post"
"method": "post",
"params": {
"payment_method": "${payment_method:id}"
}
}
]
}
3 changes: 2 additions & 1 deletion pkg/fixtures/triggers/invoice.updated.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"method": "post",
"params": {
"customer": "${customer:id}",
"description": "(created by Stripe CLI)"
"description": "(created by Stripe CLI)",
"pending_invoice_items_behavior": "include"
}
},
{
Expand Down

0 comments on commit 1a2bbeb

Please sign in to comment.