Search by

Official PHP SDK for UPI Gateways - Zero Transaction Fee (0% MDR) UPI Payment Gateway with instant direct bank settlement.

v1.0.1 2026-11-23 10:46 UTC

This package is auto-updated.

Last update: 2026-11-23 10:53:20 UTC


README

Packagist Version License: MIT PHP: >=7.4

Official PHP & Laravel SDK for UPI Gateways — The 0% Transaction Fee (0% MDR) UPI Payment Infrastructure for Indian Developers and Businesses.

Connect multiple merchant UPI accounts (Paytm Business, PhonePe, BharatPe, HDFC SmartHub Vyapar) into Laravel, CodeIgniter, Symfony, or custom PHP applications with zero commission deductions and instant T+0 direct bank settlement.

Installation

Install via Composer:

composer require upigateways/sdk

Quickstart

1. Initialize the Client

Retrieve your API credentials from your UPI Gateways Dashboard.

use UpiGateways\Client;

$client = new Client(
    apiKey: getenv('UPI_GATEWAYS_API_KEY'),
    apiSecret: getenv('UPI_GATEWAYS_API_SECRET')
);

2. Create a Payment Session

$order = $client->createOrder(499.00, [
    'customer_name' => 'Aditi Rao',
    'customer_mobile' => '9876543210',
    'customer_email' => 'aditi@example.com',
    'order_id' => 'ORDER_100452',
    'redirect_url' => 'https://yourstore.com/checkout/success',
    'webhook_url' => 'https://api.yourstore.com/webhooks/upi',
    'note' => 'Subscription Plan Renewal',
]);

echo "Checkout URL: " . $order['payment_url'];
echo "UPI Intent: " . $order['upi_intent'];

3. Check Order Status

$status = $client->getOrderStatus('ORDER_100452');

if ($status['status'] === 'Success') {
    echo "Payment verified! UTR: " . $status['utr_number'];
} else {
    echo "Current Status: " . $status['status'];
}

4. Verify Webhooks (Laravel / Native PHP)

use UpiGateways\Webhooks;

$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_SIGNATURE'] ?? '';
$secret = getenv('UPI_GATEWAYS_API_SECRET');

if (!Webhooks::verifySignature($rawBody, $signature, $secret)) {
    http_response_code(401);
    exit('Invalid webhook signature');
}

$payload = Webhooks::parsePayload($rawBody);
if ($payload['status'] === 'SUCCESS') {
    // Fulfill order in database
    $utr = $payload['utr'] ?? 'N/A';
}

Useful Links

License

MIT © UPI Gateways