This commit is contained in:
Roba Boru
2026-07-16 13:54:22 +03:00
33 changed files with 2000 additions and 503 deletions

View File

@@ -129,13 +129,17 @@ export class WaafiProvider implements PaymentProvider, OnModuleInit {
requestBody,
);
this.logger.log(
`Waafi HPP_GETTRANINFO ref=${merchantOrderId} response: ${JSON.stringify(response)}`,
);
// Waafi returns transaction info (params.status) ONLY when responseCode is 2001. For an
// unpaid or not-yet-existing transaction it returns an error envelope (e.g. 5001 / E10206
// "Failed to get transaction info") with no status. Treat that as still-pending (PROCESSING),
// never terminal — so the intent keeps waiting for the webhook / its expiry rather than being
// wrongly resolved off a "no info" response.
if (response.responseCode !== WAAFI_SUCCESS_CODE) {
this.logger.debug(
this.logger.warn(
`Waafi HPP_GETTRANINFO ${merchantOrderId}: ${response.responseCode}/${response.errorCode} ${response.responseMsg} — treating as pending`,
);
return {

View File

@@ -100,6 +100,7 @@ export enum PaymentService {
export enum PaymentReferenceType {
BOOKING = "BOOKING",
SHIPMENT = "SHIPMENT",
SUPPLEMENTARY_CHARGE = "SUPPLEMENTARY_CHARGE",
}