NEWUse coupon code SMX20 to get 20% OFF your first billing cycle on any game server or VPS!Explore Store

VPS HOSTING

VPS Hosting for Payment Gateway Integrations

Integrate payment gateways from your own VPS: hosted checkout vs direct integration, webhook security and idempotency, order state machines, reconciliation, refunds, UPI specifics, secrets management, PCI scope reduction and monitoring.

Payment code is where small mistakes become financial losses: an order marked paid when it was not, a customer charged twice, a refund that never happened. Indian payment gateways make the mechanics straightforward, but correctness and security depend on how your server handles the flow. This guide covers the patterns that keep it right.

Integration Models

ModelCard/UPI details touch your server?Effort
Hosted checkout / payment pageNoLowest
Embedded checkout (gateway's JavaScript SDK)No (sent directly to the gateway)Low
Direct server-side card handlingYesHigh; large compliance scope

For almost every business, hosted or embedded checkout is the right choice: the gateway handles card data and authentication, and your server never stores or sees it.

The Safe Payment Flow

  1. Your server creates an order with the gateway, using the amount and currency your server calculated (never an amount sent from the browser).
  2. The customer pays in the gateway's checkout.
  3. The browser returns to your site; you show "processing" but do not mark the order paid yet.
  4. The gateway sends a webhook (or you verify server-to-server) with a signature.
  5. Your server verifies the signature and the amount, records the payment, and moves the order to paid.

Webhook Security and Idempotency

  • Verify signatures with the gateway's webhook secret on every request; reject anything that fails.
  • Check details: the payment amount, currency and order ID must match your records.
  • Respond fast: store the event and return 200, then process in a background job.
  • Idempotency: store processed event and payment IDs; ignore duplicates, since gateways retry.
  • Handle out-of-order events using states and timestamps.

Our webhook processing guide covers the general pattern in detail.

Order State Machine

created → pending_payment → paid → fulfilled
                 │             └→ refund_requested → refunded
                 └→ failed / expired

Allow only valid transitions, record who or what triggered each, and make actions such as fulfilment happen only from the paid state. This prevents shipping unpaid orders and double refunds.

UPI Considerations

  • UPI payments can complete after the customer leaves your page; rely on webhooks and status checks, not the redirect.
  • Some payments remain pending for a while; show a clear pending status and resolve it from webhooks or periodic status checks.
  • For subscriptions, UPI AutoPay mandates have their own lifecycle events to handle.

Refunds and Disputes

Initiate refunds through the gateway's API from your admin interface, record them against the order, and update status from refund webhooks. Keep logs and evidence (order details, delivery confirmation) for disputes and chargebacks.

Reconciliation

Every day, compare your recorded payments with the gateway's payment and settlement reports. Investigate mismatches: payments without orders, orders marked paid without payments, refunds missing on either side. Automate the comparison as a scheduled job and alert on differences.

Secrets and Keys

  • Store API keys and webhook secrets in environment files readable only by the app, never in code or the repository.
  • Use separate test and live keys; staging uses test mode only.
  • Rotate keys if anyone who had access leaves or a leak is suspected.
  • Never log full keys, secrets or payment instrument details.

Hosting Requirements

  • HTTPS with a valid certificate; the webhook URL must be reachable by the gateway.
  • Zero-downtime deploys so webhooks are not refused during releases (see our zero-downtime guide).
  • Background workers supervised with automatic restarts (see our workers guide).
  • Database backups with point-in-time recovery; payment records must never be lost.
  • Monitoring of webhook errors, payment success rates and queue backlogs.

Keeping Compliance Scope Small

With hosted or embedded checkout, card data never reaches your server, which keeps your PCI DSS obligations much simpler; confirm the exact requirements with your gateway. Never build your own card form that posts to your server unless you are prepared for full compliance.

Testing

Use the gateway's test mode on staging to test every path: success, failure, pending UPI, duplicate webhooks, refunds and timeouts. Replay real webhook payloads from the test dashboard against your endpoint.

Common Mistakes

  • Marking orders paid from the browser redirect.
  • Trusting amounts sent from the browser.
  • Not verifying webhook signatures.
  • Processing webhooks twice and fulfilling orders twice.
  • No daily reconciliation.

In Short

Let the gateway handle payment details, decide payment status only from verified server-side events, process them idempotently through a state machine, reconcile daily and protect your keys.

What to Monitor

  • Payment success rate by method (UPI, cards, net banking).
  • Webhook signature failures and processing errors.
  • Orders stuck in pending payment longer than expected.
  • Daily reconciliation differences.

A drop in UPI success rate, for example, often reflects a gateway or bank issue you should communicate to customers quickly. Document the setup in a short runbook covering where data lives, how integrations run, how to restore from backup and whom to contact, so the system stays dependable even when the person who configured it is unavailable or has moved on to another role. Review the setup every quarter with the people who use it, because needs change as the business grows, and small adjustments made early are far cheaper than large changes made under pressure.

ServoMix Plans for This Workload

Payment integration adds little load; size for your application. Most shops and SaaS apps handle payments comfortably on 2–4 vCores. What matters most is reliability: monitoring, backups and zero-downtime deploys.

AMD EPYC 7C13 VPS

Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
SMX vPro XS (AMD EPYC)28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹420/moWebsites, small APIs, bots, staging and VPN serversOrder
SMX vPro S (AMD EPYC)416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹560/moWooCommerce, Node.js/Python backends, Docker Compose stacks, CI runnersOrder
SMX vPro M (AMD EPYC)832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹840/moProduction databases, high-traffic sites, multi-container appsOrder
SMX vPro L (AMD EPYC)1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹1,120/moLarge production workloads, SaaS platforms, analytics, in-memory cachesOrder

Intel Xeon Platinum 8269CY VPS

KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.

PlanvCoresRAMStorageNetworkPriceGood forBuy
SMX vCore XS (Intel Xeon)28 GB DDR4 ECC40 GB NVMe SSD1 Gbps, unmetered₹270/moBusiness websites, small apps, scheduled jobs and botsOrder
SMX vCore S (Intel Xeon)416 GB DDR4 ECC80 GB NVMe SSD1 Gbps, unmetered₹1,169/monthBusiness software, mid-size databases, several sites on one serverCheck stock
SMX vCore M (Intel Xeon)832 GB DDR4 ECC150 GB NVMe SSD1 Gbps, unmetered₹2,249/monthERP/CRM stacks, heavier databases, multiple production appsCheck stock
SMX vCore L (Intel Xeon)1664 GB DDR4 ECC250 GB NVMe SSD1 Gbps, unmetered₹4,248/monthHigh-memory workloads and consolidated production serversCheck stock

Prices are monthly in INR as listed on the ServoMix store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.

Frequently Asked Questions

Should card details pass through my server?
No. Use the gateway's hosted or embedded checkout so card and UPI details go directly to the gateway.
When should an order be marked paid?
Only after a signature-verified webhook or server-to-server verification confirms the payment and amount.
Why not trust the redirect after payment?
Redirects can be manipulated or fail to arrive; UPI payments may complete later. Server-side confirmation is authoritative.
How do I verify webhooks?
Validate the signature with the webhook secret, then check amount, currency and order ID against your records.
Why must webhook processing be idempotent?
Gateways retry events, so the same event can arrive more than once; duplicates must not repeat fulfilment or refunds.
How do I handle pending UPI payments?
Show a pending status and resolve it from webhooks or periodic status checks.
What is payment reconciliation?
Comparing your records with the gateway's payment and settlement reports daily to catch mismatches.
Where should API keys be stored?
In environment files readable only by the app, never in code or logs, with separate test and live keys.
Does hosted checkout reduce PCI DSS requirements?
Yes, significantly, because card data never reaches your servers; confirm specifics with your gateway.
What server do I need for payments?
Payment handling adds little load; size for your application and focus on reliability, monitoring and backups.

Frequently Asked Questions

Should card details pass through my server?

No. Use the gateway's hosted or embedded checkout so card and UPI details go directly to the gateway.

When should an order be marked paid?

Only after a signature-verified webhook or server-to-server verification confirms the payment and amount.

Why not trust the redirect after payment?

Redirects can be manipulated or fail to arrive; UPI payments may complete later. Server-side confirmation is authoritative.

How do I verify webhooks?

Validate the signature with the webhook secret, then check amount, currency and order ID against your records.

Why must webhook processing be idempotent?

Gateways retry events, so the same event can arrive more than once; duplicates must not repeat fulfilment or refunds.

How do I handle pending UPI payments?

Show a pending status and resolve it from webhooks or periodic status checks.

What is payment reconciliation?

Comparing your records with the gateway's payment and settlement reports daily to catch mismatches.

Where should API keys be stored?

In environment files readable only by the app, never in code or logs, with separate test and live keys.

Does hosted checkout reduce PCI DSS requirements?

Yes, significantly, because card data never reaches your servers; confirm specifics with your gateway.

What server do I need for payments?

Payment handling adds little load; size for your application and focus on reliability, monitoring and backups.

Was this article helpful?

Your feedback helps us continuously improve ServoMix guides.

Share this article

Know someone who may find this guide useful?

Hosting Payment Gateway Integrations Securely on a VPS | ServoMix