| 1 | export interface ProviderConfig { |
| 2 | publishableKey: string; |
| 3 | secretKey: string; |
| 4 | webhookSecret: string; |
| 5 | serviceId?: string |
| 6 | sandbox?: boolean |
| 7 | } |
| 8 | |
| 9 | export interface WebhookContext |
| 10 | rawBody: string; |
| 11 | headers: Record |
| 12 | config: ProviderConfig |
| 13 | gatewayId: string; |
| 14 | sourceIp?: string |
| 15 | } |
| 16 | |
| 17 | export type WebhookPayload |
| 18 | | { |
| 19 | type: "topup.succeeded |
| 20 | userId: string |
| 21 | amountCents: number |
| 22 | currency: string |
| 23 | providerTransactionId: string |
| 24 | gatewayId: string |
| 25 | } |
| 26 | | { |
| 27 | type: "topup.failed |
| 28 | userId: string |
| 29 | providerTransactionId: string |
| 30 | gatewayId: string |
| 31 | }; |