upigateways / sdk
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
Requires
- php: >=7.4
- ext-curl: *
- ext-json: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
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
- Official Documentation
- 0% Fee Payment Gateway Calculator
- Bank UPI Daily Limits Directory
- WooCommerce UPI Plugin
- Node.js & TypeScript SDK
License
MIT © UPI Gateways