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