mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Commiting stop based booking
This commit is contained in:
@@ -135,15 +135,18 @@ export class WaafiProvider implements PaymentProvider, OnModuleInit {
|
||||
|
||||
// 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.
|
||||
// "Failed to get transaction info") with no status — i.e. the payer hasn't done anything at
|
||||
// the hosted page yet. That's REQUIRES_ACTION (still awaiting the payer), NOT PROCESSING:
|
||||
// returning PROCESSING here would let the reconciliation sweep persist that guess and block
|
||||
// the payer from switching providers on a session they never touched (see cac-bank.provider's
|
||||
// queryStatus for the same convention). The intent still resolves correctly either way — via
|
||||
// the webhook on a genuine payment, or via expiresAt once the 5-minute HPP session lapses.
|
||||
if (response.responseCode !== WAAFI_SUCCESS_CODE) {
|
||||
this.logger.warn(
|
||||
`Waafi HPP_GETTRANINFO ${merchantOrderId}: ${response.responseCode}/${response.errorCode} ${response.responseMsg} — treating as pending`,
|
||||
`Waafi HPP_GETTRANINFO ${merchantOrderId}: ${response.responseCode}/${response.errorCode} ${response.responseMsg} — treating as still awaiting the payer`,
|
||||
);
|
||||
return {
|
||||
status: ProviderPaymentStatus.PROCESSING,
|
||||
status: ProviderPaymentStatus.REQUIRES_ACTION,
|
||||
rawResponse: response as unknown as Record<string, unknown>,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user