Skip to content

Commit f5f29a1

Browse files
committed
feat: add refunds webhooks
1 parent 763035a commit f5f29a1

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

src/types/webhook.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export const WEBHOOK_EVENTS = [
2020
'scheduled_payment/completed',
2121
'scheduled_payment/error',
2222
'scheduled_payment/canceled',
23+
'payment_refund/completed',
24+
'payment_refund/error'
2325
] as const
2426
/**
2527
* @typedef WebhookEvent
@@ -63,20 +65,20 @@ export type WebhookEventPayload = {
6365
/** Primary identifier of the event that was notified */
6466
eventId: string
6567
} & (
66-
| {
68+
| {
6769
/** Type of event subscribed */
6870
event:
69-
| 'item/created'
70-
| 'item/updated'
71-
| 'item/waiting_user_input'
72-
| 'item/login_succeeded'
73-
| 'item/deleted'
71+
| 'item/created'
72+
| 'item/updated'
73+
| 'item/waiting_user_input'
74+
| 'item/login_succeeded'
75+
| 'item/deleted'
7476
/** Primary identifier of the item related to the event */
7577
itemId: string
7678
/** Who trigger the event */
7779
triggeredBy?: TriggeredBy | null
7880
}
79-
| {
81+
| {
8082
/** Type of event subscribed */
8183
event: 'item/error'
8284
/** Primary identifier of the item related to the event */
@@ -89,15 +91,15 @@ export type WebhookEventPayload = {
8991
/** Who trigger the event */
9092
triggeredBy?: TriggeredBy | null
9193
}
92-
| {
94+
| {
9395
/** Type of event subscribed */
9496
event: 'connector/status_updated'
9597
/** Object with extra information of the connector updated */
9698
data: {
9799
status: string
98100
}
99101
}
100-
| {
102+
| {
101103
/** Type of event subscribed */
102104
event: 'transactions/deleted' | 'transactions/updated'
103105
/** Primary identifier of the item related to the event */
@@ -109,18 +111,18 @@ export type WebhookEventPayload = {
109111
/** Primary identifier of the transactions related to the event */
110112
transactionIds: string[]
111113
}
112-
| {
114+
| {
113115
event: 'payment_intent/created' | 'payment_intent/completed' | 'payment_intent/error'
114116
paymentIntentId: string
115117
paymentRequestId: string
116118
}
117-
| {
119+
| {
118120
event:
119-
| 'scheduled_payment/created'
120-
| 'scheduled_payment/completed'
121-
| 'scheduled_payment/error'
122-
| 'scheduled_payment/canceled'
121+
| 'scheduled_payment/created'
122+
| 'scheduled_payment/completed'
123+
| 'scheduled_payment/error'
124+
| 'scheduled_payment/canceled'
123125
paymentRequestId: string
124126
scheduledPaymentId: string
125127
}
126-
)
128+
)

0 commit comments

Comments
 (0)