feat: implement early fraud warning handling in webhooks

This commit is contained in:
Dries Augustyns
2026-05-01 21:55:32 +02:00
parent 532293e52a
commit 48425d1df1
2 changed files with 102 additions and 0 deletions
+22
View File
@@ -799,6 +799,28 @@ export class NtfyService {
});
}
public static async notifyEarlyFraudWarning(
chargeId: string,
fraudType: string,
cardFingerprint: string | null,
customerEmail: string | null,
): Promise<void> {
const details = [
`Charge: ${chargeId}`,
`Fraud type: ${fraudType}`,
cardFingerprint ? `Card fingerprint: ${cardFingerprint}` : null,
customerEmail ? `Customer: ${customerEmail}` : null,
]
.filter(Boolean)
.join(' | ');
await this.sendUrgent('Stripe Early Fraud Warning', `Refunded and blocklisted. ${details}`, [
NtfyTag.SHIELD,
NtfyTag.MONEY,
NtfyTag.SKULL,
]);
}
/**
* Initialize the ntfy service with the configured URL
*/