Skip to content

Commit 15f0185

Browse files
committed
feat: add Shopware webhook classes for order events (cancelled, paid, placed)
1 parent 47e8b3e commit 15f0185

3 files changed

Lines changed: 99 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {
2+
Description,
3+
DisplayIcon,
4+
DisplayMessage,
5+
EventSetting,
6+
Identifier,
7+
Name,
8+
Rest,
9+
Signature
10+
} from "@code0-tech/hercules";
11+
12+
@Identifier("ShopwareOrderCancelledWebhook")
13+
@DisplayIcon("simple:shopware")
14+
@Name({code: "en-US", content: "Shopware order cancelled"})
15+
@Description({code: "en-US", content: "Triggered when an order enters the cancelled state in Shopware (state_enter.order.state.cancelled)."})
16+
@DisplayMessage({code: "en-US", content: "Shopware order cancelled on ${httpURL}"})
17+
@Signature("<A extends REST_AUTH_TYPE>(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE<A>, input_schema?: ShopwareOrderCancelledWebhookPayload): REST_ADAPTER_INPUT<ShopwareOrderCancelledWebhookPayload>")
18+
@EventSetting({
19+
identifier: "input_schema",
20+
hidden: true
21+
})
22+
@EventSetting({
23+
identifier: "httpMethod",
24+
hidden: true,
25+
defaultValue: "POST"
26+
})
27+
@EventSetting({
28+
identifier: "httpSchema",
29+
hidden: true,
30+
defaultValue: "application/json"
31+
})
32+
export class ShopwareOrderCancelledWebhook extends Rest {
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {
2+
Description,
3+
DisplayIcon,
4+
DisplayMessage,
5+
EventSetting,
6+
Identifier,
7+
Name,
8+
Rest,
9+
Signature
10+
} from "@code0-tech/hercules";
11+
12+
@Identifier("ShopwareOrderPaidWebhook")
13+
@DisplayIcon("simple:shopware")
14+
@Name({code: "en-US", content: "Shopware order paid"})
15+
@Description({code: "en-US", content: "Triggered when an order transaction enters the paid state in Shopware (state_enter.order_transaction.state.paid)."})
16+
@DisplayMessage({code: "en-US", content: "Shopware order paid on ${httpURL}"})
17+
@Signature("<A extends REST_AUTH_TYPE>(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE<A>, input_schema?: ShopwareOrderPaidWebhookPayload): REST_ADAPTER_INPUT<ShopwareOrderPaidWebhookPayload>")
18+
@EventSetting({
19+
identifier: "input_schema",
20+
hidden: true
21+
})
22+
@EventSetting({
23+
identifier: "httpMethod",
24+
hidden: true,
25+
defaultValue: "POST"
26+
})
27+
@EventSetting({
28+
identifier: "httpSchema",
29+
hidden: true,
30+
defaultValue: "application/json"
31+
})
32+
export class ShopwareOrderPaidWebhook extends Rest {
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import {
2+
Description,
3+
DisplayIcon,
4+
DisplayMessage,
5+
EventSetting,
6+
Identifier,
7+
Name,
8+
Rest,
9+
Signature
10+
} from "@code0-tech/hercules";
11+
12+
@Identifier("ShopwareOrderPlacedWebhook")
13+
@DisplayIcon("simple:shopware")
14+
@Name({code: "en-US", content: "Shopware order placed"})
15+
@Description({code: "en-US", content: "Triggered when an order is placed in Shopware (checkout.order.placed)."})
16+
@DisplayMessage({code: "en-US", content: "Shopware order placed on ${httpURL}"})
17+
@Signature("<A extends REST_AUTH_TYPE>(httpSchema: HTTP_SCHEMA, httpURL: HTTP_URL, httpMethod: HTTP_METHOD, httpAuth: A, httpAuthValue: REST_AUTH_VALUE<A>, input_schema?: ShopwareOrderPlacedWebhookPayload): REST_ADAPTER_INPUT<ShopwareOrderPlacedWebhookPayload>")
18+
@EventSetting({
19+
identifier: "input_schema",
20+
hidden: true
21+
})
22+
@EventSetting({
23+
identifier: "httpMethod",
24+
hidden: true,
25+
defaultValue: "POST"
26+
})
27+
@EventSetting({
28+
identifier: "httpSchema",
29+
hidden: true,
30+
defaultValue: "application/json"
31+
})
32+
export class ShopwareOrderPlacedWebhook extends Rest {
33+
}

0 commit comments

Comments
 (0)