mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Update webhooks.controller.ts
This commit is contained in:
@@ -51,8 +51,22 @@ export class WebhooksController {
|
||||
@ApiOperation({
|
||||
summary: "Telebirr payment notification callback (Ethiopia)",
|
||||
})
|
||||
async receiveTelebirr(@Body() payload: TelebirrWebhookPayload) {
|
||||
this.logger.log("Telebirr webhook called");
|
||||
async receiveTelebirr(
|
||||
@Body() payload: TelebirrWebhookPayload,
|
||||
@Headers() headers: Record<string, string>,
|
||||
@Req() req: { method?: string; rawBody?: Buffer },
|
||||
) {
|
||||
this.logger.log(
|
||||
`Telebirr webhook hit: method=${req.method ?? "n/a"} ` +
|
||||
`merchOrderId=${payload?.merch_order_id ?? "n/a"} ` +
|
||||
`paymentOrderId=${payload?.payment_order_id ?? "n/a"} ` +
|
||||
`tradeStatus=${payload?.trade_status ?? "n/a"}`,
|
||||
);
|
||||
this.logger.log(`Telebirr webhook headers: ${JSON.stringify(headers)}`);
|
||||
this.logger.log(`Telebirr webhook payload: ${JSON.stringify(payload)}`);
|
||||
this.logger.log(
|
||||
`Telebirr webhook raw body: ${req.rawBody?.toString("utf8") ?? "(none)"}`,
|
||||
);
|
||||
try {
|
||||
await this.telebirr.handle(payload);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user