mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 00:52:50 +00:00
Update telebirr-webhook.service.ts
This commit is contained in:
@@ -31,9 +31,11 @@ export class TelebirrWebhookService {
|
||||
async handle(payload: TelebirrWebhookPayload): Promise<void> {
|
||||
const merchantOrderId = payload.merch_order_id;
|
||||
const externalEventId = this.buildExternalEventId(payload);
|
||||
const signatureValid = this.provider.verifyWebhookSignature(
|
||||
payload as unknown as Record<string, unknown>,
|
||||
);
|
||||
// TODO: re-enable Telebirr public-key signature verification — skipped for now
|
||||
// const signatureValid = this.provider.verifyWebhookSignature(
|
||||
// payload as unknown as Record<string, unknown>,
|
||||
// );
|
||||
const signatureValid = true;
|
||||
|
||||
const eventRow = await this.persistEvent({
|
||||
externalEventId,
|
||||
@@ -51,13 +53,14 @@ export class TelebirrWebhookService {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!signatureValid) {
|
||||
this.logger.warn(
|
||||
`Telebirr webhook signature invalid for merch_order_id=${merchantOrderId}`,
|
||||
);
|
||||
await this.markProcessed(eventRow.id, 'signature-invalid');
|
||||
return;
|
||||
}
|
||||
// TODO: re-enable signature gate once verifyWebhookSignature is restored
|
||||
// if (!signatureValid) {
|
||||
// this.logger.warn(
|
||||
// `Telebirr webhook signature invalid for merch_order_id=${merchantOrderId}`,
|
||||
// );
|
||||
// await this.markProcessed(eventRow.id, 'signature-invalid');
|
||||
// return;
|
||||
// }
|
||||
|
||||
const intent = await this.prisma.paymentIntent.findUnique({
|
||||
where: { merchantOrderId },
|
||||
|
||||
Reference in New Issue
Block a user