mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +00:00
Update webhooks.controller.ts
This commit is contained in:
@@ -51,8 +51,22 @@ export class WebhooksController {
|
|||||||
@ApiOperation({
|
@ApiOperation({
|
||||||
summary: "Telebirr payment notification callback (Ethiopia)",
|
summary: "Telebirr payment notification callback (Ethiopia)",
|
||||||
})
|
})
|
||||||
async receiveTelebirr(@Body() payload: TelebirrWebhookPayload) {
|
async receiveTelebirr(
|
||||||
this.logger.log("Telebirr webhook called");
|
@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 {
|
try {
|
||||||
await this.telebirr.handle(payload);
|
await this.telebirr.handle(payload);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user