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

Configure YouPI-PG API for Render demo deployment

rafiq150632b37d69f70f
diff --git a/apps/payment-api/src/__tests__/whatsapp-berry-auth.test.js b/apps/payment-api/src/__tests__/whatsapp-berry-auth.test.js
index b8b9d0a..5d52e52 100644
--- a/apps/payment-api/src/__tests__/whatsapp-berry-auth.test.js
+++ b/apps/payment-api/src/__tests__/whatsapp-berry-auth.test.js
@@ -123,6 +123,10 @@ test('WhatsApp Berry Protocol OTP Customer Auth & Merchant Configuration Suite',
let loginOtp = null;
+ // The signup OTP was requested moments earlier.
+ // Wait until the 30-second resend cooldown expires.
+ await new Promise(resolve => setTimeout(resolve, 31_000));
+
await t.test('7. POST /api/v1/customer/send-otp dispatches WhatsApp OTP for existing user', async () => {
const res = await authFetch(`${apiBase}/api/v1/customer/send-otp`, {
method: 'POST',
diff --git a/apps/payment-api/src/index.js b/apps/payment-api/src/index.js
index e1d9bf1..86d8081 100644
--- a/apps/payment-api/src/index.js
+++ b/apps/payment-api/src/index.js
@@ -477,12 +477,14 @@ export function createPaymentApp(customDb = null, options = {}) {
}
export function startServer(port = null, customDb = null) {
- const finalPort = port || Number(process.env.PAYMENT_API_PORT || 6100);
+ const finalPort = port ?? Number(
+ process.env.PORT || process.env.PAYMENT_API_PORT || 6100
+ );
const app = createPaymentApp(customDb);
return new Promise(resolve => {
// Loopback by default; reach this service via the local Cloudflare Tunnel, not 0.0.0.0.
- const bindHost = process.env.YOUPI_BIND_HOST || '127.0.0.1';
+ const bindHost = process.env.YOUPI_BIND_HOST || (process.env.RENDER ? '0.0.0.0' : '127.0.0.1');
const instance = app.rawServer.listen(finalPort, bindHost, () => {
console.log(`[Payment API] Server listening on port ${finalPort}`);
resolve({
diff --git a/package.json b/package.json
index 867b8f7..f584341 100644
--- a/package.json
+++ b/package.json
@@ -32,5 +32,10 @@
"node": ">=24.22.1"
},
"author": "Antigravity Systems",
- "license": "Commercial"
+ "license": "Commercial",
+ "allowScripts": {
+ }
}
diff --git a/render.yaml b/render.yaml
new file mode 100644
index 0000000..b98d78b
--- /dev/null
+++ b/render.yaml
@@ -0,0 +1,34 @@
+
+services:
+ - type: web
+ name: youpi-pg-demo
+ runtime: node
+ plan: free
+ buildCommand: npm ci
+ startCommand: npm run start:prod:api
+ healthCheckPath: /health
+
+ envVars:
+ - key: NODE_VERSION
+ value: 24.22.1
+
+ - key: NODE_ENV
+ value: production
+
+ - key: YOUPI_BIND_HOST
+ value: 0.0.0.0
+
+ - key: USE_SQLITE_FALLBACK
+ value: "true"
+
+ - key: ENCRYPTION_MASTER_KEY
+ generateValue: true
+
+ - key: JWT_SECRET
+ generateValue: true
+
+ - key: YOUPI_ALLOW_DEV_TOOLS
+ value: "false"
+
+ - key: YOUPI_EXPOSE_DEV_OTP
+ value: "false"