Skip to content

Commit

Permalink
Invoice action required trigger (stripe#625)
Browse files Browse the repository at this point in the history
* Invoice action required trigger

* Add expected error
  • Loading branch information
tomer-stripe authored Apr 9, 2021
1 parent e90728c commit d594d7d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/fixtures/triggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var Events = map[string]string{
"customer.subscription.updated": "triggers/customer.subscription.updated.json",
"invoice.created": "triggers/invoice.created.json",
"invoice.finalized": "triggers/invoice.finalized.json",
"invoice.payment_action_required": "triggers/invoice.payment_action_required.json",
"invoice.payment_failed": "triggers/invoice.payment_failed.json",
"invoice.payment_succeeded": "triggers/invoice.payment_succeeded.json",
"invoice.updated": "triggers/invoice.updated.json",
Expand Down
67 changes: 67 additions & 0 deletions pkg/fixtures/triggers/invoice.payment_action_required.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"_meta": {
"template_version": 0
},
"fixtures": [
{
"name": "customer",
"path": "/v1/customers",
"method": "post",
"params": {
"description": "(created by Stripe CLI)",
"source": "tok_visa"
}
},
{
"name": "invoiceitem",
"path": "/v1/invoiceitems",
"method": "post",
"params": {
"amount": 2000,
"currency": "usd",
"customer": "${customer:id}",
"description": "(created by Stripe CLI)"
}
},
{
"name": "invoice",
"path": "/v1/invoices",
"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}"
}
},
{
"name": "pay_invoice",
"path": "/v1/invoices/${invoice:id}/pay",
"method": "post",
"expected_error_type": "card_error",
"params": {
"payment_method": "${payment_method:id}"
}
}
]
}

0 comments on commit d594d7d

Please sign in to comment.