2019-10-14 17:43:19 -07:00
|
|
|
All Stripe webhook events are taken from docs:
|
2019-10-16 02:43:34 -07:00
|
|
|
[https://stripe.com/docs/api/events/types#event_types](https://stripe.com/docs/api/events/types#event_types)
|
2019-10-14 17:43:19 -07:00
|
|
|
|
|
|
|
To get the entire list of events as a JS array, scrape the website:
|
|
|
|
|
2019-10-16 02:43:34 -07:00
|
|
|
1. manually add the id #event-types to `<ul>` that contains all event types
|
|
|
|
2. copy-paste the function in the JS console
|
|
|
|
3. the result is copied into in the clipboard
|
|
|
|
4. paste the prepared array in StripeTrigger.node.ts
|
2019-10-14 17:43:19 -07:00
|
|
|
|
|
|
|
```js
|
|
|
|
types = []
|
|
|
|
$$('ul#event-types li').forEach(el => {
|
2020-05-11 15:06:51 -07:00
|
|
|
const value = el.querySelector('.method-list-item-label-name').innerText
|
2019-10-14 17:43:19 -07:00
|
|
|
|
2020-05-11 15:06:51 -07:00
|
|
|
types.push({
|
|
|
|
name: value
|
|
|
|
.replace(/(\.|_)/, ' ')
|
|
|
|
.split(' ')
|
|
|
|
.map((s) => s.charAt(0).toUpperCase() + s.substring(1))
|
|
|
|
.join(' '),
|
|
|
|
value,
|
|
|
|
description: el.querySelector('.method-list-item-description').innerText
|
|
|
|
})
|
2019-10-14 17:43:19 -07:00
|
|
|
})
|
|
|
|
copy(types)
|
2019-10-16 02:43:34 -07:00
|
|
|
```
|