RazorpayX example code and offline checks

Download the RazorpayX examples ZIP. Extract the archive before following the commands below.

These programs make one GET request to https://ip.quotaguard.com, through an explicitly configured authenticated proxy. They do not call Razorpay, read destination API credentials, or create financial operations. They parse the JSON ip field and compare it with two supplied IPv4 addresses.

Configure a deployed runtime

Set QUOTAGUARDSTATIC_URL from the selected QuotaGuard subscription’s HTTP connection URL. Set EXPECTED_EGRESS_IPS to its two distinct dashboard IPv4 addresses, separated by a comma. Use your platform’s server-side secret store for the URL. .env.example contains non-working placeholders only; these programs do not automatically load a .env file.

Install dependencies in your application-managed environment, review the resolved versions, and commit the normal dependency lockfile without secrets.

Python:

python -m pip install requests
python check_egress.py

Node.js with a currently supported runtime compatible with the selected dependency:

npm install https-proxy-agent
node check-egress.mjs

The current upstream https-proxy-agent package metadata specifies Node 20 or newer. Check the actual installed release’s runtime requirements. Upstream source and an installed package are not necessarily the same version.

Read the result

A successful run prints a JSON object with egress_ip and matches_configured_pair. The observed address must match either member of the configured pair. No sample output in this packet represents an actual proxied result.

Failures return a nonzero exit code. The examples reject missing configuration, malformed pairs, redirects/non-200 responses, oversized bodies, invalid JSON or IP fields, and addresses outside the pair. There is no direct fallback or automatic retry. TLS certificate verification remains enabled. Proxy errors are deliberately sanitized rather than printed verbatim.

The Node program applies a 30-second overall request deadline. Python applies separate connection and read timeouts; those are not a complete wall-clock deadline. Use a process-level deadline in automation if required.

What to reuse

The route configuration, fail-closed behavior, timeouts, TLS verification, and secret handling are patterns for an integration-specific transport. The diagnostic itself is not a payout client. Do not add financial API credentials to the IP-check request, and do not change its URL to a state-changing operation.

The Python Session deliberately disables environment-derived proxies and .netrc behavior with trust_env = False. It also stops environment-derived CA settings from being applied. If your deployment requires an approved custom CA bundle, configure its path explicitly instead of disabling verification.

The Node example uses the built-in https API plus HttpsProxyAgent. Its agent setting is not a configuration for built-in fetch or for an arbitrary SDK. Use the transport interface documented for the actual client.

Primary references

Offline tests check configuration and response handling; they do not establish live proxy or provider acceptance.


Ready to Get Started?

Get in touch or create a free trial account

Back to top ↑

Copyright © 2009 - 2026 QuotaGuard. All rights reserved.