UNIVERSAL PAYMENT GATEWAY SDK & API

Add UPI Checkout to Any Website, App & Software

Copy production-ready code for PHP, Node.js, Python, Flutter, React Native, Android, iOS, C# .NET, Java, WordPress, or use our instant no-code payment button. 0% gateway commission, instant direct-to-bank settlement.

Sandbox Demo Credentials (Login to auto-fill your keys)
API Key: pi_live_sample_key_99812903
API Secret: sk_live_••••••••••••••••••••••••
Log In for Live Keys →
ALL-IN-ONE AI MASTER PROMPT ChatGPT • Claude • Cursor • Copilot • Windsurf • Gemini

Copy Master Prompt for AI (Instant 1-Click Integration)

Bas is prompt ko copy karke kisi bhi AI (ChatGPT, Claude, Cursor, Copilot) ko de dijiye. AI aapke project ko inspect karega aur bina kisi existing code ya database ko nuksan pahuchaye Lion UPI Payment Gateway 100% seamlessly integrate kar dega. Isme aapke live API credentials aur endpoints pre-filled hain!

Zero-Harm Policy (Preserves Existing Code & DB) Auto-Populates Sandbox Demo Keys Any Stack: React, Next.js, PHP, Laravel, Flutter, Python, WP, C# Handles Order Creation, Status Verification & Webhooks
Full AI Master Prompt Content:
Ready to paste into Cursor, Claude, ChatGPT
lion_upi_ai_master_prompt.txt
================================================================================
LION UPI PAYMENT GATEWAY — UNIVERSAL AI INTEGRATION MASTER PROMPT
================================================================================

You are an expert full-stack engineer and payment integration specialist.
Your task is to integrate the Lion UPI Payment Gateway into my current project cleanly, safely, and without breaking, deleting, or modifying any existing functionality, routes, UI styles, database schemas, or business logic.

--------------------------------------------------------------------------------
1. MY GATEWAY CREDENTIALS & API ENDPOINTS
--------------------------------------------------------------------------------
• Gateway Name: MTG Pay (Universal UPI Gateway)
• Base API URL: https://mail.printin.space/api
• Create Order Endpoint: POST https://mail.printin.space/api/create-order
• Check Status Endpoint: POST https://mail.printin.space/api/check-status
• Payment Page Format: https://mail.printin.space/pay/{token}
• Mode: Production (0% Gateway Commission, Instant T+0 Peer-to-Bank Settlement)

My Production Credentials:
• API Key (X-API-Key): pi_live_sample_key_99812903
• API Secret (X-API-Secret): sk_live_sample_secret_74829104

--------------------------------------------------------------------------------
2. CRITICAL ZERO-HARM INTEGRATION RULES (DO NOT BREAK MY PROJECT)
--------------------------------------------------------------------------------
1. ANALYZE FIRST: Inspect my existing codebase structure, framework (e.g. Next.js, React, Node/Express, PHP/Laravel, WordPress/WooCommerce, Python/Django/Flask, Flutter, React Native, Android Kotlin, iOS Swift, C# .NET, Java, or HTML/JS), router, database models, and existing checkout/cart flow.
2. ZERO HARM: Do NOT delete, rewrite, or break any existing code, routes, tables, or design systems. Only append or integrate the necessary payment initiation and verification hooks.
3. SECURITY FIRST: Never expose `X-API-Secret` in frontend client-side bundles or public JavaScript. Store credentials in server-side environment variables (.env as LION_UPI_API_KEY and LION_UPI_API_SECRET) or server config.
4. MATCH MY DESIGN: Any checkout button, modal, or status confirmation screen you create must seamlessly match my project's existing UI, CSS framework (Tailwind, Bootstrap, styled-components, or custom CSS), and font styling.

--------------------------------------------------------------------------------
3. STEP-BY-STEP IMPLEMENTATION SPECIFICATION
--------------------------------------------------------------------------------

STEP 1: INITIATE PAYMENT ORDER (SERVER-SIDE)
When the customer clicks 'Pay' or 'Checkout', create a server-side POST request to:
POST https://mail.printin.space/api/create-order

Required Headers:
  Content-Type: application/json
  X-API-Key: pi_live_sample_key_99812903
  X-API-Secret: sk_live_sample_secret_74829104

JSON Request Body:
{
  "amount": <order_amount_in_inr_as_number_or_float>,
  "order_id": "<unique_order_id_string_from_my_database>",
  "customer_name": "<buyer_name>",
  "customer_mobile": "<buyer_10_digit_mobile_optional>",
  "callback_url": "<my_app_return_callback_url>",
  "description": "<order_description_or_product_name>"
}

Success Response (HTTP 201):
{
  "status": "success",
  "message": "Order created successfully",
  "data": {
    "payment_url": "https://mail.printin.space/pay/TOKEN_XXXXXX",
    "order_id": "<order_id>",
    "token": "TOKEN_XXXXXX",
    "amount": 499.00,
    "currency": "INR"
  }
}

Action: Redirect the customer to `data.payment_url` (or open via native UPI Intent / Deep-Link / in-app WebView for mobile apps).

--------------------------------------------------------------------------------
STEP 2: PAYMENT STATUS VERIFICATION (ON RETURN CALLBACK)
--------------------------------------------------------------------------------
When the customer finishes payment, the gateway redirects them back to:
<my_app_callback_url>?order_id=<order_id>&status=<status>

Do NOT trust frontend query parameters alone. Always verify securely from your server by calling:
POST https://mail.printin.space/api/check-status

Headers:
  Content-Type: application/json
  X-API-Key: pi_live_sample_key_99812903
  X-API-Secret: sk_live_sample_secret_74829104

JSON Body:
{
  "order_id": "<order_id>"
}

Response (HTTP 200):
{
  "status": "success",
  "data": {
    "order_id": "<order_id>",
    "status": "success",          // Possible values: 'success', 'pending', 'failed'
    "amount": 499.00,
    "utr": "425983742918",        // Bank UPI UTR Reference Number
    "payment_method": "UPI",
    "paid_at": "2026-09-18 12:00:00"
  }
}

Action:
• If data.status === 'success', update the order status in my database to 'PAID', store the bank utr, and display the confirmation receipt.
• If pending or failed, show an appropriate friendly message and allow the customer to retry.

--------------------------------------------------------------------------------
STEP 3: WEBHOOK RECONCILIATION (OPTIONAL BUT RECOMMENDED)
--------------------------------------------------------------------------------
Set up a webhook endpoint (e.g. /api/webhooks/lion-upi):
1. Read raw JSON body.
2. Read header X-PayIndia-Signature.
3. Compute HMAC-SHA256 of raw body using API Secret:
   expected_sig = hmac_sha256(raw_body, "sk_live_sample_secret_74829104")
4. If signature matches and event === 'payment.success', update order status to PAID in background.

--------------------------------------------------------------------------------
4. HOW YOU SHOULD PROCEED NOW
--------------------------------------------------------------------------------
1. First, tell me what framework/stack you detected in my project.
2. Show the proposed file additions (e.g. .env additions, backend controller/route, and checkout button hook).
3. Ensure no existing feature is broken.
4. Implement the integration cleanly and verify syntax.

Websites & Web Applications

Server-side checkout creation and client-side redirection.

checkout.php (Initiate Order & Redirect)
checkout.php
<?php
$payload = [
    'amount'          => 499.00,
    'order_id'        => 'ORD_' . time(),
    'customer_name'   => 'Aarav Sharma',
    'customer_mobile' => '9876543210',
    'callback_url'    => 'https://yourwebsite.com/payment-callback.php',
    'description'     => 'Digital Product Order'
];

$ch = curl_init('https://mail.printin.space/api/create-order');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => json_encode($payload),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 15,
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
        'X-API-Key: pi_live_sample_key_99812903',
        'X-API-Secret: sk_live_sample_secret_74829104'
    ]
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

if (!empty($response['data']['payment_url'])) {
    header('Location: ' . $response['data']['payment_url']);
    exit;
} else {
    die('Payment Error: ' . ($response['details'] ?? 'Could not create payment order'));
}
?>
Node.js Express Route
server.js
const express = require('express');
const axios = require('axios');
const app = express();
app.use(express.json());

app.post('/api/checkout', async (req, res) => {
    try {
        const response = await axios.post('https://mail.printin.space/api/create-order', {
            amount: req.body.amount || 299.00,
            order_id: `ORD_${Date.now()}`,
            customer_name: req.body.customerName || 'Customer',
            customer_mobile: '9876543210',
            callback_url: 'https://yourwebsite.com/success'
        }, {
            headers: {
                'Content-Type': 'application/json',
                'X-API-Key': 'pi_live_sample_key_99812903',
                'X-API-Secret': 'sk_live_sample_secret_74829104'
            }
        });

        res.json({ payment_url: response.data.data.payment_url });
    } catch (err) {
        res.status(500).json({ error: err.message });
    }
});

app.listen(3000, () => console.log('Checkout API running on :3000'));
Python Flask / Django
app.py
import requests, time
from flask import Flask, redirect

app = Flask(__name__)

@app.route('/checkout')
def checkout():
    res = requests.post(
        "https://mail.printin.space/api/create-order",
        json={
            "amount": 499.00,
            "order_id": f"ORD_{int(time.time())}",
            "customer_name": "Pooja Verma",
            "callback_url": "https://yourwebsite.com/success"
        },
        headers={
            "Content-Type": "application/json",
            "X-API-Key": "pi_live_sample_key_99812903",
            "X-API-Secret": "sk_live_sample_secret_74829104"
        }
    ).json()

    return redirect(res['data']['payment_url'])
OFFICIAL RELEASE v2.0.0 WooCommerce 8+ & HPOS Ready 0% Gateway Fee

Lion UPI Automated Payment Gateway for WooCommerce

Zero coding required! Upload the plugin ZIP to your WordPress site, paste your credentials, and start accepting direct UPI payments (Google Pay, PhonePe, Paytm, BHIM & QR) with instant automated bank status reconciliation and 0% gateway commission.

Download WordPress Plugin (.ZIP) upi-qr-code-payment-gateway.zip (207 KB)
Plugin Highlights
  • Dynamic UPI QR & Intent Checkout
  • Instant Bank Reconciliation & UTR Sync
  • Built-in Connection Tester
  • Instant Webhook & Callback Support
3-Step Quick Setup Guide (Pre-filled with your Live Credentials)

Follow these 3 simple steps to connect your WooCommerce store with Lion UPI in less than 2 minutes.

1
Upload & Activate

In your WordPress Admin, go to Plugins > Add New > Upload Plugin. Choose the downloaded upi-qr-code-payment-gateway.zip and click Activate.

2
Configure Credentials

Navigate to WooCommerce > Settings > Payments > Lion UPI. Enter the following details:

Gateway URL:
API Key:
API Secret:
3
Test & Go Live

Click the "Test Gateway Connection" button inside WooCommerce settings. Once verified, check "Enable Lion UPI" and save changes.

Orders will automatically reconcile directly with your bank account in real-time!
Alternative: Manual functions.php Snippet (For developers who prefer not to use a plugin)
functions.php
add_action('woocommerce_thankyou', 'lion_upi_redirect_checkout', 1);
function lion_upi_redirect_checkout($order_id) {
    if (!$order_id) return;
    $order = wc_get_order($order_id);
    if ($order->get_status() !== 'pending') return;

    $res = wp_remote_post('https://mail.printin.space/api/create-order', [
        'headers' => [
            'Content-Type' => 'application/json',
            'X-API-Key'    => 'pi_live_sample_key_99812903',
            'X-API-Secret' => 'sk_live_sample_secret_74829104'
        ],
        'body' => json_encode([
            'amount'        => (float)$order->get_total(),
            'order_id'      => 'WC_' . $order->get_id(),
            'customer_name' => $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(),
            'callback_url'  => $order->get_checkout_order_received_url()
        ])
    ]);
    if (!is_wp_error($res)) {
        $body = json_decode(wp_remote_retrieve_body($res), true);
        if (!empty($body['data']['payment_url'])) {
            wp_redirect($body['data']['payment_url']);
            exit;
        }
    }
}

Mobile Applications (Android & iOS)

Native UPI Intent launchers for Flutter, React Native, Android & iOS.

Flutter UPI Service (Dart)
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:url_launcher/url_launcher.dart';

Future<void> launchLionPayment(double amount, String orderId) async {
  final res = await http.post(
    Uri.parse('https://mail.printin.space/api/create-order'),
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': 'pi_live_sample_key_99812903',
      'X-API-Secret': 'sk_live_sample_secret_74829104',
    },
    body: jsonEncode({
      'amount': amount,
      'order_id': orderId,
      'customer_name': 'Mobile User',
      'callback_url': 'myapp://payment-callback'
    }),
  );

  if (res.statusCode == 201) {
    final paymentUrl = jsonDecode(res.body)['data']['payment_url'];
    final uri = Uri.parse(paymentUrl);
    if (await canLaunchUrl(uri)) {
      await launchUrl(uri, mode: LaunchMode.externalApplication);
    }
  }
}
React Native Linking
import { Linking } from 'react-native';

async function startUpiCheckout(amount) {
  const res = await fetch('https://mail.printin.space/api/create-order', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-API-Key': 'pi_live_sample_key_99812903',
      'X-API-Secret': 'sk_live_sample_secret_74829104'
    },
    body: JSON.stringify({
      amount: amount,
      order_id: `RN_${Date.now()}`,
      customer_name: 'Mobile App Customer'
    })
  });
  const data = await res.json();
  if (data.data?.payment_url) {
    await Linking.openURL(data.data.payment_url);
  }
}
fun openCheckout(paymentUrl: String) {
    val intent = Intent(Intent.ACTION_VIEW, Uri.parse(paymentUrl))
    startActivity(Intent.createChooser(intent, "Pay via UPI"))
}
import SafariServices

func openPayment(paymentUrl: String) {
    if let url = URL(string: paymentUrl) {
        let safari = SFSafariViewController(url: url)
        present(safari, animated: true)
    }
}

Software, Desktop POS & Billing Systems

Integrate dynamic QR codes on thermal receipts, billing counters, and desktop software.

using System.Net.Http;
using System.Text.Json;

var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "pi_live_sample_key_99812903");
client.DefaultRequestHeaders.Add("X-API-Secret", "sk_live_sample_secret_74829104");

var payload = new { amount = 250.00, order_id = "BILL_1001", customer_name = "Retail Buyer" };
var content = new StringContent(JsonSerializer.Serialize(payload), System.Text.Encoding.UTF8, "application/json");

var res = await client.PostAsync("https://mail.printin.space/api/create-order", content);
var json = await res.Content.ReadAsStringAsync();
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://mail.printin.space/api/create-order"))
    .header("Content-Type", "application/json")
    .header("X-API-Key", "pi_live_sample_key_99812903")
    .header("X-API-Secret", "sk_live_sample_secret_74829104")
    .POST(HttpRequest.BodyPublishers.ofString("{\"amount\": 399, \"order_id\": \"INV_501\"}"))
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
# Print Dynamic UPI QR on POS Receipt
import requests, qrcode

res = requests.post("https://mail.printin.space/api/create-order", json={"amount": 450, "order_id": "POS_49"},
    headers={"X-API-Key": "pi_live_sample_key_99812903", "X-API-Secret": "sk_live_sample_secret_74829104"}).json()

payment_url = res["data"]["payment_url"]
img = qrcode.make(payment_url)
img.save("receipt_qr.png")
curl -X POST "https://mail.printin.space/api/create-order" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: pi_live_sample_key_99812903" \
  -H "X-API-Secret: sk_live_sample_secret_74829104" \
  -d '{"amount": "199.00", "order_id": "CLI_1234", "customer_name": "Terminal Test"}'

Instant No-Code Embed Button

Generate a ready-to-paste checkout button for Shopify, Wix, Webflow, Blogger, WordPress, or any HTML page.

Product: Premium Course Membership

100% Direct Instant Settlement Guarantee
Embed HTML Code:
<!-- Paste into your website -->
<button onclick="window.open('https://mail.printin.space/api/create-order')" style="background:#10B981;color:#fff;padding:14px 28px;border-radius:12px;font-weight:700;border:none;cursor:pointer;">
  Pay ₹499 with UPI
</button>