Enhance API documentation tags and improve checkout URL handling in WaafiProvider

This commit is contained in:
Stephanos A
2026-05-24 16:40:50 +03:00
parent 882aef7fcf
commit 80cea364c7
2 changed files with 20 additions and 15 deletions

View File

@@ -100,7 +100,7 @@ export class WaafiProvider implements PaymentProvider {
}
const transactionId = response.params?.transactionId;
const checkoutUrl = response.params?.checkoutUrl;
const checkoutUrl = response.params?.checkoutUrl || `${this.baseUrl}/checkout?ref=${transactionId}`;
if (!transactionId) {
throw new Error(`Waafi returned no transactionId: ${JSON.stringify(response)}`);
@@ -110,9 +110,7 @@ export class WaafiProvider implements PaymentProvider {
return {
providerOrderId: transactionId,
clientAction: checkoutUrl
? { type: 'REDIRECT', url: checkoutUrl }
: { type: 'NONE' },
clientAction: { type: 'REDIRECT', url: checkoutUrl },
expiresAt,
rawInitiation: {
request: this.sanitize(requestBody),