@@ -20,6 +20,8 @@ export const WEBHOOK_EVENTS = [
20
20
'scheduled_payment/completed' ,
21
21
'scheduled_payment/error' ,
22
22
'scheduled_payment/canceled' ,
23
+ 'payment_refund/completed' ,
24
+ 'payment_refund/error'
23
25
] as const
24
26
/**
25
27
* @typedef WebhookEvent
@@ -63,20 +65,20 @@ export type WebhookEventPayload = {
63
65
/** Primary identifier of the event that was notified */
64
66
eventId : string
65
67
} & (
66
- | {
68
+ | {
67
69
/** Type of event subscribed */
68
70
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'
74
76
/** Primary identifier of the item related to the event */
75
77
itemId : string
76
78
/** Who trigger the event */
77
79
triggeredBy ?: TriggeredBy | null
78
80
}
79
- | {
81
+ | {
80
82
/** Type of event subscribed */
81
83
event : 'item/error'
82
84
/** Primary identifier of the item related to the event */
@@ -89,15 +91,15 @@ export type WebhookEventPayload = {
89
91
/** Who trigger the event */
90
92
triggeredBy ?: TriggeredBy | null
91
93
}
92
- | {
94
+ | {
93
95
/** Type of event subscribed */
94
96
event : 'connector/status_updated'
95
97
/** Object with extra information of the connector updated */
96
98
data : {
97
99
status : string
98
100
}
99
101
}
100
- | {
102
+ | {
101
103
/** Type of event subscribed */
102
104
event : 'transactions/deleted' | 'transactions/updated'
103
105
/** Primary identifier of the item related to the event */
@@ -109,18 +111,18 @@ export type WebhookEventPayload = {
109
111
/** Primary identifier of the transactions related to the event */
110
112
transactionIds : string [ ]
111
113
}
112
- | {
114
+ | {
113
115
event : 'payment_intent/created' | 'payment_intent/completed' | 'payment_intent/error'
114
116
paymentIntentId : string
115
117
paymentRequestId : string
116
118
}
117
- | {
119
+ | {
118
120
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'
123
125
paymentRequestId : string
124
126
scheduledPaymentId : string
125
127
}
126
- )
128
+ )
0 commit comments