Skip to content

A self-hosted UPI & COD payment gateway with zero per-transaction platform fees, universal JavaScript checkout integration, dynamic QR payments, WhatsApp OTP authentication, and automated payment verification.

JavaScript

fix(security): sync with upstream/main and resolve gateway invariant conflicts

ArunGupta1526ea50076b9a5c
diff --cc apps/payment-api/src/routes/checkout.routes.js
index 9e2c09c,dd38d61..3e6e928
--- a/apps/payment-api/src/routes/checkout.routes.js
+++ b/apps/payment-api/src/routes/checkout.routes.js
@@@ -1019,8 -1024,13 +1024,13 @@@ export function registerCheckoutRoutes(
return;
}
- if ([PaymentStatus.SUCCESS, PaymentStatus.FAILED, PaymentStatus.EXPIRED, PaymentStatus.CANCELLED, PaymentStatus.PROCESSING].includes(session.status)) {
- if ([PaymentStatus.SUCCESS, PaymentStatus.FAILED, PaymentStatus.EXPIRED, PaymentStatus.CANCELLED].includes(session.status)) {
- HttpServer.json(res, 400, { error: `Cannot switch payment method for terminal session in status '${session.status}'` });
++ if (session.status === PaymentStatus.PROCESSING) {
++ HttpServer.json(res, 400, { error: `Cannot switch payment method while payment is in PROCESSING status` });
+ return;
+ }
+
- if (session.status === PaymentStatus.PROCESSING) {
- HttpServer.json(res, 400, { error: `Cannot switch payment method while payment is in PROCESSING status` });
++ if ([PaymentStatus.SUCCESS, PaymentStatus.FAILED, PaymentStatus.EXPIRED, PaymentStatus.CANCELLED].includes(session.status)) {
+ HttpServer.json(res, 400, { error: `Cannot switch payment method for session in status '${session.status}'` });
return;
}