diff --git a/apps/edr-payment-api/src/modules/webhooks/handlers/telebirr-webhook.service.ts b/apps/edr-payment-api/src/modules/webhooks/handlers/telebirr-webhook.service.ts index 44af7d985..8333e8e3b 100644 --- a/apps/edr-payment-api/src/modules/webhooks/handlers/telebirr-webhook.service.ts +++ b/apps/edr-payment-api/src/modules/webhooks/handlers/telebirr-webhook.service.ts @@ -18,7 +18,8 @@ export class TelebirrWebhookService { const signatureValid = true; const mapped = this.provider.mapWebhookTradeStatus(payload.trade_status); - const providerTxnId = payload.trans_id ?? payload.payment_order_id; + const providerTxnId = + payload.transId ?? payload.trans_id ?? payload.payment_order_id; await this.processor.process({ provider: this.provider.method, diff --git a/packages/payment-providers/src/webhooks/telebirr-webhook.types.ts b/packages/payment-providers/src/webhooks/telebirr-webhook.types.ts index 39a0f60f8..d9174627b 100644 --- a/packages/payment-providers/src/webhooks/telebirr-webhook.types.ts +++ b/packages/payment-providers/src/webhooks/telebirr-webhook.types.ts @@ -2,6 +2,9 @@ export interface TelebirrWebhookPayload { merch_order_id: string; payment_order_id: string; trade_status: string; + /** Telebirr's webhook (notify) sends the transaction id as camelCase `transId`; + * the queryOrder/status-query biz_content uses snake_case `trans_id`. Support both. */ + transId?: string; trans_id?: string; total_amount?: string; trans_currency?: string;