mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 13:28:11 +00:00
Enhance API documentation tags and improve checkout URL handling in WaafiProvider
This commit is contained in:
@@ -210,23 +210,30 @@ Payment providers send notifications to:
|
|||||||
{ type: "http", scheme: "bearer", bearerFormat: "JWT", in: "header" },
|
{ type: "http", scheme: "bearer", bearerFormat: "JWT", in: "header" },
|
||||||
"JWT-auth",
|
"JWT-auth",
|
||||||
)
|
)
|
||||||
|
.addTag("Agents", "Counter booking and management")
|
||||||
.addTag("Auth", "Registration and login")
|
.addTag("Auth", "Registration and login")
|
||||||
.addTag("Stations", "Station directory")
|
.addTag("Booking", "Booking lifecycle")
|
||||||
|
.addTag("Dashboard", "Home dashboard aggregate")
|
||||||
.addTag("Fleet", "Train services and coaches")
|
.addTag("Fleet", "Train services and coaches")
|
||||||
|
.addTag("Fraud Detection", "Fraud detection and monitoring")
|
||||||
|
.addTag("Live Tracking", "Real-time trip status and crowd signals")
|
||||||
|
.addTag("Loyalty", "Points, tiers, and rewards")
|
||||||
|
.addTag("Notifications", "Push and email notifications")
|
||||||
|
.addTag("Passenger", "Profiles, traveler profiles, saved routes")
|
||||||
|
.addTag("Payment", "Payment intents and refunds")
|
||||||
|
.addTag("Payment Webhooks", "Endpoints for payment provider notifications")
|
||||||
|
.addTag("Promotions", "Promo codes and campaigns")
|
||||||
|
.addTag("Reports", "Sales and operational reports")
|
||||||
|
.addTag("Routes", "Route information and management")
|
||||||
.addTag("Schedule", "Trips and fare rules")
|
.addTag("Schedule", "Trips and fare rules")
|
||||||
.addTag("Search", "Trip search and fare quotes")
|
.addTag("Search", "Trip search and fare quotes")
|
||||||
|
.addTag("Seat Classes", "Economy Regular, Economy Bed, VIP Bed")
|
||||||
.addTag("Seats", "Seat maps and holds")
|
.addTag("Seats", "Seat maps and holds")
|
||||||
.addTag("Booking", "Booking lifecycle")
|
.addTag("Segment-based Seats", "Seats assigned and released by trip segments")
|
||||||
.addTag("Payment", "Payment intents and refunds")
|
.addTag("Stations", "Station directory")
|
||||||
.addTag("Tickets", "QR ticket generation and validation")
|
|
||||||
.addTag("Passenger", "Profiles, traveler profiles, saved routes")
|
|
||||||
.addTag("Notifications", "Push and email notifications")
|
|
||||||
.addTag("Loyalty", "Points, tiers, and rewards")
|
|
||||||
.addTag("Wallet", "Wallet balance and ledger")
|
|
||||||
.addTag("Promotions", "Promo codes and campaigns")
|
|
||||||
.addTag("Live Tracking", "Real-time trip status and crowd signals")
|
|
||||||
.addTag("Support", "FAQ and chat support")
|
.addTag("Support", "FAQ and chat support")
|
||||||
.addTag("Dashboard", "Home dashboard aggregate")
|
.addTag("Tickets", "QR ticket generation and validation")
|
||||||
|
.addTag("Wallet", "Wallet balance and ledger")
|
||||||
//.addServer('http://localhost:4000', 'Development')
|
//.addServer('http://localhost:4000', 'Development')
|
||||||
// .addServer("https://api.edr-platform.com", "Production")
|
// .addServer("https://api.edr-platform.com", "Production")
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export class WaafiProvider implements PaymentProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const transactionId = response.params?.transactionId;
|
const transactionId = response.params?.transactionId;
|
||||||
const checkoutUrl = response.params?.checkoutUrl;
|
const checkoutUrl = response.params?.checkoutUrl || `${this.baseUrl}/checkout?ref=${transactionId}`;
|
||||||
|
|
||||||
if (!transactionId) {
|
if (!transactionId) {
|
||||||
throw new Error(`Waafi returned no transactionId: ${JSON.stringify(response)}`);
|
throw new Error(`Waafi returned no transactionId: ${JSON.stringify(response)}`);
|
||||||
@@ -110,9 +110,7 @@ export class WaafiProvider implements PaymentProvider {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
providerOrderId: transactionId,
|
providerOrderId: transactionId,
|
||||||
clientAction: checkoutUrl
|
clientAction: { type: 'REDIRECT', url: checkoutUrl },
|
||||||
? { type: 'REDIRECT', url: checkoutUrl }
|
|
||||||
: { type: 'NONE' },
|
|
||||||
expiresAt,
|
expiresAt,
|
||||||
rawInitiation: {
|
rawInitiation: {
|
||||||
request: this.sanitize(requestBody),
|
request: this.sanitize(requestBody),
|
||||||
|
|||||||
Reference in New Issue
Block a user