docs: added order claim documentation (#2805)

This commit is contained in:
Shahed Nasser
2022-12-14 20:25:12 +02:00
committed by GitHub
parent c1659f81ac
commit e5e13cc40e
5 changed files with 387 additions and 3 deletions
@@ -54,7 +54,20 @@ constructor({ productService, eventBusService }) {
}
```
You can then use `this.productService` anywhere in your subscribers methods.
You can then use `this.productService` anywhere in your subscribers methods. For example:
```ts
handleOrder = async (data) => {
//...
const product = this.productService.list()
}
```
:::note
When using attributes defined in the subscriber, such as the `productService` in the example above, you must use an arrow function to declare the method. Otherwise, the attribute will be undefined when used.
:::
## Whats Next
@@ -2681,6 +2681,55 @@ Object of the following format:
</tbody>
</table>
## Token Events
This section holds all events related to tokens.
<table class="reference-table">
<thead>
<tr>
<th>
Event Name
</th>
<th>
Description
</th>
<th>
Event Data Payload
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
`order-update-token.created`
</td>
<td>
Triggered when a customer requests to claim an order and a token is created.
</td>
<td>
Object of the following format:
```js noReport noCopy
{
old_email, //string email of order
new_customer_id, //string ID of customer
orders, //array of string IDs of orders
token, //string token used for verification
}
```
</td>
</tr>
</tbody>
</table>
## User Events
This section holds all events related to users.