Skip to content

Commit

Permalink
Merge pull request #890 from lesliepoolman/implement_tax_rate_webhooks
Browse files Browse the repository at this point in the history
Added webhooks for "tax_rate.updated" and "tax_rate.created"
  • Loading branch information
alexmamonchik committed Nov 23, 2023
2 parents 1779149 + 5a5d854 commit 32b1ded
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/stripe_mock/api/webhooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def self.event_list
'subscription_schedule.created',
'subscription_schedule.released',
'subscription_schedule.updated',
'tax_rate.created',
'tax_rate.updated',
'transfer.created',
'transfer.failed',
'transfer.paid',
Expand Down
32 changes: 32 additions & 0 deletions lib/stripe_mock/webhook_fixtures/tax_rate.created.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"id": "evt_000000000000000000000000",
"object": "event",
"api_version": "2020-08-27",
"created": 1700752531,
"data": {
"object": {
"id": "txr_00000000000000",
"object": "tax_rate",
"active": true,
"country": "DE",
"created": 1700750289,
"description": "VAT Germany",
"display_name": "VAT",
"effective_percentage": null,
"inclusive": false,
"jurisdiction": "DE",
"livemode": false,
"metadata": {},
"percentage": 16.0,
"state": null,
"tax_type": "vat"
}
},
"livemode": false,
"pending_webhooks": 2,
"request": {
"id": "req_00000000000000",
"idempotency_key": "cd3e4fc0-9d4c-42fd-a818-1b9789537ce9"
},
"type": "tax_rate.created"
}
37 changes: 37 additions & 0 deletions lib/stripe_mock/webhook_fixtures/tax_rate.updated.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"id": "evt_000000000000000000000000",
"object": "event",
"api_version": "2020-08-27",
"created": 1700752371,
"data": {
"object": {
"id": "txr_00000000000000",
"object": "tax_rate",
"active": true,
"country": "DE",
"created": 1700750289,
"description": "VAT Germany",
"display_name": "VAT",
"effective_percentage": null,
"inclusive": false,
"jurisdiction": "DE",
"livemode": false,
"metadata": {},
"percentage": 16.0,
"state": null,
"tax_type": "vat"
},
"previous_attributes": {
"metadata": {
"foo": null
}
}
},
"livemode": false,
"pending_webhooks": 2,
"request": {
"id": "req_00000000000000",
"idempotency_key": "7eb234a6-64bc-4320-bc7f-780c546ab026"
},
"type": "tax_rate.updated"
}

0 comments on commit 32b1ded

Please sign in to comment.