mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
refactor: ( payment ) increase timeout
This commit is contained in:
@@ -10,4 +10,7 @@ export default registerAs("cac", () => ({
|
||||
currency: process.env.CAC_CURRENCY || "DJF",
|
||||
tokenTtlMs: Number(process.env.CAC_TOKEN_TTL_MS || 23 * 60 * 60 * 1000),
|
||||
otpExpiryMs: Number(process.env.CAC_OTP_EXPIRY_MS || 10 * 60 * 1000),
|
||||
// The bank's PaymentInitiateRequest sends an OTP by SMS and can be slow; the bank asked us
|
||||
// to raise the client timeout. Generous default, overridable via env.
|
||||
httpTimeoutMs: Number(process.env.CAC_HTTP_TIMEOUT_MS || 60_000),
|
||||
}));
|
||||
|
||||
@@ -180,7 +180,12 @@ export class IntentsService {
|
||||
);
|
||||
}
|
||||
|
||||
if (intent.status !== ProviderPaymentStatus.REQUIRES_ACTION) {
|
||||
// REQUIRES_ACTION is the normal awaiting-OTP state; PROCESSING is tolerated so an intent
|
||||
// that a poll/sweep nudged forward can still be confirmed. Terminal states are rejected.
|
||||
if (
|
||||
intent.status !== ProviderPaymentStatus.REQUIRES_ACTION &&
|
||||
intent.status !== ProviderPaymentStatus.PROCESSING
|
||||
) {
|
||||
throw new BadRequestException(
|
||||
`Intent is not awaiting confirmation (status=${intent.status})`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user