{"id":562,"date":"2026-11-04T01:00:00","date_gmt":"2026-11-04T01:00:00","guid":{"rendered":"https:\/\/paymentsetu.com\/blog\/?p=562"},"modified":"2026-11-04T01:00:00","modified_gmt":"2026-11-04T01:00:00","slug":"upi-payment-integration-laravel","status":"publish","type":"post","link":"https:\/\/paymentsetu.com\/blog\/upi-payment-integration-laravel\/","title":{"rendered":"UPI Payment Integration in Laravel: A Secure Guide"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">UPI payment integration in Laravel is easiest to maintain when order creation, payment verification, and fulfilment are separate steps. This guide shows a Laravel-idiomatic flow with PaymentSetu: your customer pays directly to your own UPI merchant account, PaymentSetu verifies the transaction, and a signed webhook tells your app when to mark the order paid.<\/p>\n\n\n\n<aside class=\"ap-card\" aria-label=\"PaymentSetu Pro\">\n<span class=\"ap-card__badge\">Recommended<\/span>\n<div class=\"ap-card__body\"><p class=\"ap-card__name\">PaymentSetu Pro<\/p><p class=\"ap-card__best\">Best for growing WooCommerce \/ WHMCS stores and service businesses with up to 1,000 UPI payments a month (most popular)<\/p><ul class=\"ap-card__features\"><li>1,000 credits (1 credit = 1 successful payment verified)<\/li><li>0% commission, direct-to-bank UPI settlement<\/li><li>Dynamic QR, webhooks and API access<\/li><li>WooCommerce and WHMCS plugins<\/li><li>Priority support<\/li><\/ul><\/div>\n<div class=\"ap-card__side\"><p class=\"ap-card__price\">\u20b9999 <small>Most popular \u00b7 \u20b9999 \/ 30 days \u00b7 1,000 verified payments<\/small><\/p><a class=\"ap-card__btn\" href=\"https:\/\/paymentsetu.com\/auth\/register\">Get Pro \u2192<\/a><\/div>\n<\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">What you are building<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The finished flow has four parts:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Your Laravel app creates a local order with a unique <code>client_txn_id<\/code>.<\/li>\n\n\n<li>Laravel calls <code>POST \/api\/create_order<\/code> and displays the dynamic QR returned by the API.<\/li>\n\n\n<li>The customer pays by UPI directly to your merchant account.<\/li>\n\n\n<li>PaymentSetu sends a signed webhook. Laravel verifies the signature, queues the update, and marks the matching order paid only after checking the transaction ID, status, and amount.<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">PaymentSetu is a payment verification service, not a payment gateway. It does not hold the customer\u2019s money; the payment goes to your connected merchant account. The Pro plan is \u20b9999 per 30 days and includes 1,000 verified-payment credits, API access, dynamic QR, webhooks, and priority support.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Prepare Laravel and PaymentSetu<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why this matters: keeping credentials in environment variables and storing a local order before calling the API makes retries and reconciliation safe.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create an account, connect your supported merchant account, create an API key, and configure your webhook URL in the PaymentSetu dashboard. You can <a href=\"https:\/\/paymentsetu.com\/auth\/register\">create your PaymentSetu account here<\/a> before configuring the integration. Your webhook should use HTTPS in production, for example <code>https:\/\/example.com\/paymentsetu\/webhook<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generate the Laravel classes and run the migration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php artisan make:model PaymentOrder -m\nphp artisan make:controller PaymentController\nphp artisan make:job ProcessPaymentWebhook\nphp artisan migrate<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the credentials to <code>.env<\/code>. The default header names below are variables so you can match the exact names shown in your current PaymentSetu API documentation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PAYMENTSETU_BASE_URL=https:\/\/paymentsetu.com\nPAYMENTSETU_API_KEY=replace-with-your-api-key\nPAYMENTSETU_API_KEY_HEADER=X-API-Key\nPAYMENTSETU_WEBHOOK_SECRET=replace-with-your-webhook-secret\nPAYMENTSETU_SIGNATURE_HEADER=X-Webhook-Signature<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add the service configuration in <code>config\/services.php<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'paymentsetu' =&gt; [\n    'base_url' =&gt; env('PAYMENTSETU_BASE_URL'),\n    'api_key' =&gt; env('PAYMENTSETU_API_KEY'),\n    'api_key_header' =&gt; env('PAYMENTSETU_API_KEY_HEADER', 'X-API-Key'),\n    'webhook_secret' =&gt; env('PAYMENTSETU_WEBHOOK_SECRET'),\n    'signature_header' =&gt; env('PAYMENTSETU_SIGNATURE_HEADER', 'X-Webhook-Signature'),\n],<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use a migration that can identify an order without relying on a QR image or a browser session:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Schema::create('payment_orders', function (Blueprint $table) {\n    $table-&gt;id();\n    $table-&gt;string('client_txn_id')-&gt;unique();\n    $table-&gt;unsignedBigInteger('amount_paise');\n    $table-&gt;string('status')-&gt;default('pending');\n    $table-&gt;string('utr')-&gt;nullable();\n    $table-&gt;json('qr_response')-&gt;nullable();\n    $table-&gt;json('webhook_payload')-&gt;nullable();\n    $table-&gt;timestamp('paid_at')-&gt;nullable();\n    $table-&gt;timestamps();\n});<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Store money as integer paise in your database. This avoids comparing floating-point rupee values when a webhook arrives.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like this: <code>php artisan migrate<\/code> completes, the API key is not committed to Git, and one local order can be uniquely identified by <code>client_txn_id<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Create a UPI order with Laravel\u2019s HTTP client<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why this matters: Laravel\u2019s HTTP client gives you JSON negotiation, headers, timeouts, retries, and test fakes without hand-written cURL code. The official <a href=\"https:\/\/laravel.com\/docs\/http-client\" target=\"_blank\" rel=\"noopener\">Laravel HTTP client documentation<\/a> covers these methods.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, validate the amount and create a pending record. Use an application-generated ID rather than accepting a client-supplied ID without validation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ app\/Http\/Controllers\/PaymentController.php\nnamespace App\\Http\\Controllers;\n\nuse App\\Models\\PaymentOrder;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Facades\\Http;\nuse Illuminate\\Support\\Str;\n\nclass PaymentController extends Controller\n{\n    public function create(Request $request)\n    {\n        $validated = $request-&gt;validate([\n            'amount' =&gt; ['required', 'numeric', 'gt:0'],\n        ]);\n\n        $clientTxnId = 'order-' . Str::uuid();\n        $amountPaise = (int) round(((float) $validated['amount']) * 100);\n\n        $order = PaymentOrder::create([\n            'client_txn_id' =&gt; $clientTxnId,\n            'amount_paise' =&gt; $amountPaise,\n            'status' =&gt; 'pending',\n        ]);\n\n        $headers = [\n            config('services.paymentsetu.api_key_header') =&gt;\n                config('services.paymentsetu.api_key'),\n        ];\n\n        $response = Http::acceptJson()\n            -&gt;withHeaders($headers)\n            -&gt;timeout(15)\n            -&gt;retry(2, 250)\n            -&gt;post(rtrim(config('services.paymentsetu.base_url'), '\/') . '\/api\/create_order', [\n                'client_txn_id' =&gt; $order-&gt;client_txn_id,\n                'amount' =&gt; number_format($amountPaise \/ 100, 2, '.', ''),\n                'webhook_url' =&gt; route('paymentsetu.webhook'),\n            ]);\n\n        $response-&gt;throw();\n        $body = $response-&gt;json();\n\n        $order-&gt;update(['qr_response' =&gt; $body]);\n\n        return response()-&gt;json([\n            'client_txn_id' =&gt; $order-&gt;client_txn_id,\n            'payment' =&gt; $body,\n        ]);\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The endpoint and authentication method are part of the PaymentSetu API contract. Keep the <code>amount<\/code> unit and the API-key header exactly as specified in your dashboard documentation. The response is stored as JSON so your frontend can use the documented QR image or UPI payload without losing fields that may be added later.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add the route:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ routes\/web.php\nuse App\\Http\\Controllers\\PaymentController;\n\nRoute::post('\/payments\/upi', [PaymentController::class, 'create'])\n    -&gt;name('payments.upi.create');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like this: the response contains your unique transaction ID and the API\u2019s QR data, while the database row remains <code>pending<\/code> until a verified webhook arrives.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Add the webhook route and CSRF exception<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why this matters: PaymentSetu\u2019s server cannot provide a browser session token. You should exempt only the webhook URI from Laravel\u2019s CSRF check, then protect it with the HMAC signature.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create a named route that accepts only POST requests:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ routes\/web.php\nuse App\\Http\\Controllers\\PaymentWebhookController;\n\nRoute::post('\/paymentsetu\/webhook', [PaymentWebhookController::class, 'handle'])\n    -&gt;name('paymentsetu.webhook');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On Laravel 13, exclude this one URI in <code>bootstrap\/app.php<\/code>. Laravel\u2019s <a href=\"https:\/\/laravel.com\/docs\/csrf\" target=\"_blank\" rel=\"noopener\">CSRF documentation<\/a> recommends excluding a webhook URI rather than disabling protection for the whole application.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use Illuminate\\Foundation\\Configuration\\Middleware;\n\n-&gt;withMiddleware(function (Middleware $middleware): void {\n    $middleware-&gt;preventRequestForgery(except: [\n        'paymentsetu\/webhook',\n    ]);\n})<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If your project is on an older Laravel version, use the CSRF-exclusion method documented for that version. Do not remove CSRF protection from normal checkout, account, or admin routes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like this: a POST to <code>\/paymentsetu\/webhook<\/code> reaches your controller without a 419 response, while other browser form routes still require CSRF protection.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Verify HMAC and queue the order update<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why this matters: a webhook request is not proof of payment until its signature, transaction ID, status, and amount have passed your checks. Returning quickly after verification also keeps the webhook endpoint small and lets a queue worker perform database work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Generate the controller:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php artisan make:controller PaymentWebhookController<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Read the raw request body before decoding JSON. HMAC must be calculated over the exact bytes that were signed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ app\/Http\/Controllers\/PaymentWebhookController.php\nnamespace App\\Http\\Controllers;\n\nuse App\\Jobs\\ProcessPaymentWebhook;\nuse Illuminate\\Http\\Request;\n\nclass PaymentWebhookController extends Controller\n{\n    public function handle(Request $request)\n    {\n        $rawBody = $request-&gt;getContent();\n        $header = config('services.paymentsetu.signature_header');\n        $received = (string) $request-&gt;header($header);\n        $expected = hash_hmac(\n            'sha256',\n            $rawBody,\n            config('services.paymentsetu.webhook_secret')\n        );\n\n        \/\/ If the API documentation specifies a prefix such as \"sha256=\",\n        \/\/ normalise that documented format before this comparison.\n        abort_unless(\n            $received !== '' &amp;&amp; hash_equals($expected, $received),\n            401,\n            'Invalid webhook signature'\n        );\n\n        $payload = json_decode($rawBody, true, flags: JSON_THROW_ON_ERROR);\n        ProcessPaymentWebhook::dispatch($payload);\n\n        return response()-&gt;json(['accepted' =&gt; true]);\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The signature header name and the exact JSON field names must match the current PaymentSetu API reference. The job below uses the documented integration concepts\u2014<code>client_txn_id<\/code>, payment status, amount, and UTR\u2014so keep the small mapping at the top of the job aligned with your actual payload.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ app\/Jobs\/ProcessPaymentWebhook.php\nnamespace App\\Jobs;\n\nuse App\\Models\\PaymentOrder;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Illuminate\\Foundation\\Queue\\Queueable;\nuse Illuminate\\Support\\Facades\\DB;\n\nclass ProcessPaymentWebhook implements ShouldQueue\n{\n    use Queueable;\n\n    public function __construct(public array $payload) {}\n\n    public function handle(): void\n    {\n        $clientTxnId = $this-&gt;payload['client_txn_id'] ?? null;\n        $status = strtolower((string) ($this-&gt;payload['status'] ?? ''));\n        $amount = (float) ($this-&gt;payload['amount'] ?? 0);\n\n        if (!$clientTxnId || $status !== 'success') {\n            return;\n        }\n\n        DB::transaction(function () use ($clientTxnId, $amount): void {\n            $order = PaymentOrder::where('client_txn_id', $clientTxnId)\n                -&gt;lockForUpdate()\n                -&gt;first();\n\n            if (!$order || $order-&gt;status === 'paid') {\n                return;\n            }\n\n            $receivedPaise = (int) round($amount * 100);\n            if ($receivedPaise !== $order-&gt;amount_paise) {\n                return;\n            }\n\n            $order-&gt;update([\n                'status' =&gt; 'paid',\n                'utr' =&gt; $this-&gt;payload['utr'] ?? null,\n                'webhook_payload' =&gt; $this-&gt;payload,\n                'paid_at' =&gt; now(),\n            ]);\n        });\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This job is idempotent: a repeated signed webhook finds an already-paid order and makes no second fulfilment decision. In a real application, put email, stock release, subscription activation, or digital delivery behind the same paid-state transition so it cannot run twice.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel\u2019s queue worker must be running for the job to execute:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php artisan queue:work<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel\u2019s <a href=\"https:\/\/laravel.com\/docs\/queues\" target=\"_blank\" rel=\"noopener\">queue documentation<\/a> explains job generation, workers, retries, and failed jobs. Configure a persistent queue connection in production and monitor failed jobs rather than silently discarding them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like this: an invalid signature receives 401, a valid signed event receives a fast JSON acknowledgement, and only a matching successful payment can change the order to <code>paid<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Add status checks and local testing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why this matters: webhooks should drive fulfilment, while a status endpoint is useful for a customer-facing \u201cwaiting for payment\u201d screen or a reconciliation command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PaymentSetu exposes <code>GET \/api\/order_status\/{client_txn_id}<\/code>. Keep the API key on the server and use the same configured header:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$statusResponse = Http::acceptJson()\n    -&gt;withHeaders([\n        config('services.paymentsetu.api_key_header') =&gt;\n            config('services.paymentsetu.api_key'),\n    ])\n    -&gt;timeout(10)\n    -&gt;get(\n        rtrim(config('services.paymentsetu.base_url'), '\/') .\n        '\/api\/order_status\/' . rawurlencode($order-&gt;client_txn_id)\n    )\n    -&gt;throw();\n\n$statusBody = $statusResponse-&gt;json();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use the status response to refresh a pending screen, not to bypass HMAC verification or mark an order paid from an unvalidated browser request. You can also check remaining credits with <code>GET \/api\/check_credits<\/code> before a batch import or scheduled reconciliation job.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a local test, use a Laravel HTTP fake for the create-order call. Laravel documents <code>Http::fake()<\/code> and request assertions in its HTTP client testing section.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Http::fake([\n    'paymentsetu.com\/api\/create_order' =&gt; Http::response([\n        'data' =&gt; ['qr_code' =&gt; 'test-qr-payload'],\n    ], 200),\n]);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then test the webhook separately with a JSON body and an HMAC computed using the same secret as <code>.env<\/code>. For an end-to-end test, expose your local HTTPS app through a secure tunnel, register that temporary URL in the PaymentSetu dashboard, create a small test order, scan the QR, and confirm this sequence:<\/p>\n\n\n\n<figure class=\"wp-block-table ap-table\"><table><thead><tr><th>Check<\/th><th>Expected result<\/th><\/tr><\/thead><tbody><tr><td>Local row created<\/td><td><code>pending<\/code> with a unique <code>client_txn_id<\/code><\/td><\/tr><tr><td>Create-order response<\/td><td>QR data is saved without exposing the API key<\/td><\/tr><tr><td>Signed webhook<\/td><td>HTTP 200 JSON acknowledgement<\/td><\/tr><tr><td>Queue worker<\/td><td>Job completes without an exception<\/td><\/tr><tr><td>Amount and ID match<\/td><td>The correct row becomes <code>paid<\/code><\/td><\/tr><tr><td>Duplicate webhook<\/td><td>No second fulfilment action<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting common Laravel integration errors<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>419 response from the webhook:<\/strong> confirm the exact path in <code>preventRequestForgery(except: ...)<\/code>, or move the webhook to a route group without browser CSRF middleware. Keep the HMAC check in either case.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>401 from the webhook:<\/strong> log the signature header name and a request ID, not the secret or full payment payload. Confirm whether the documented signature is raw hexadecimal HMAC or has a prefix, then normalise only that documented format.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The order stays pending:<\/strong> check that the queue worker is running, the webhook URL is publicly reachable over HTTPS, and the webhook\u2019s <code>client_txn_id<\/code> matches your database value exactly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Amount mismatch:<\/strong> do not compare formatted rupee strings. Store integer paise and map the webhook\u2019s amount unit once, based on the API documentation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>QR data does not render:<\/strong> inspect the saved API response and use the documented QR image or UPI payload field. Do not expose the API response or API key to logs in production.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Is PaymentSetu a Laravel payment gateway?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. PaymentSetu is a payment verification service. The customer pays directly to your own UPI merchant account, and PaymentSetu matches the transaction and sends your Laravel app a webhook.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Which API endpoints do I need for Laravel UPI payments?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The core flow uses <code>POST \/api\/create_order<\/code>, <code>GET \/api\/order_status\/{client_txn_id}<\/code>, and <code>GET \/api\/check_credits<\/code>. Your server also needs a public webhook route to receive signed payment notifications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why should the webhook be excluded from CSRF protection?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">CSRF tokens are intended for browser sessions, while a server-to-server webhook does not have your Laravel session token. Exclude only the webhook URI and authenticate it with HMAC over the raw request body.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I use Laravel queues for payment webhooks?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. A controller can verify the signature, dispatch a <code>ShouldQueue<\/code> job, and return an acknowledgement quickly. Make the job idempotent and compare the transaction ID, success status, and amount before fulfilment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Which PaymentSetu plan fits a Laravel store?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">PaymentSetu Pro is \u20b9999 per 30 days for 1,000 verified-payment credits and includes API access, dynamic QR, webhooks, and priority support. Higher-volume SaaS or multi-branch businesses can review the Business plan at \u20b91,499 per 30 days for 100,000 credits.<\/p>\n\n\n\n<aside class=\"ap-cta\" aria-label=\"Start with PaymentSetu\"><div class=\"ap-cta__content\"><p class=\"ap-cta__eyebrow\">Laravel UPI setup<\/p><p class=\"ap-cta__title\">Start with PaymentSetu<\/p><p class=\"ap-cta__text\">Create your account and connect your Laravel webhook to verified UPI orders.<\/p><\/div><a class=\"ap-cta__btn\" href=\"https:\/\/paymentsetu.com\/auth\/register\">Create your account<\/a><\/aside>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Is PaymentSetu a Laravel payment gateway?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. PaymentSetu is a payment verification service. The customer pays directly to your own UPI merchant account, and PaymentSetu matches the transaction and sends your Laravel app a webhook.\"}}, {\"@type\": \"Question\", \"name\": \"Which API endpoints do I need for Laravel UPI payments?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"The core flow uses POST \/api\/create_order, GET \/api\/order_status\/{client_txn_id}, and GET \/api\/check_credits. Your server also needs a public webhook route to receive signed payment notifications.\"}}, {\"@type\": \"Question\", \"name\": \"Why should the webhook be excluded from CSRF protection?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"CSRF tokens are intended for browser sessions, while a server-to-server webhook does not have your Laravel session token. Exclude only the webhook URI and authenticate it with HMAC over the raw request body.\"}}, {\"@type\": \"Question\", \"name\": \"Can I use Laravel queues for payment webhooks?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Yes. A controller can verify the signature, dispatch a ShouldQueue job, and return an acknowledgement quickly. Make the job idempotent and compare the transaction ID, success status, and amount before fulfilment.\"}}, {\"@type\": \"Question\", \"name\": \"Which PaymentSetu plan fits a Laravel store?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"PaymentSetu Pro is \u20b9999 per 30 days for 1,000 verified-payment credits and includes API access, dynamic QR, webhooks, and priority support. Higher-volume SaaS or multi-branch businesses can review the Business plan at \u20b91,499 per 30 days for 100,000 credits.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Learn upi payment integration in laravel with HTTP client, dynamic QR orders, HMAC webhooks, CSRF setup, queues, testing, and secure order updates.","protected":false},"author":1,"featured_media":561,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[29],"tags":[131,6,132,109,17],"class_list":["post-562","post","type-post","status-publish","format-standard","has-post-thumbnail","category-upi-payment-verification","tag-laravel","tag-payment-verification","tag-payment-webhook","tag-php","tag-upi-payments","cs-entry"],"_links":{"self":[{"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/posts\/562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/comments?post=562"}],"version-history":[{"count":1,"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/posts\/562\/revisions"}],"predecessor-version":[{"id":765,"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/posts\/562\/revisions\/765"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/media\/561"}],"wp:attachment":[{"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/media?parent=562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/categories?post=562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paymentsetu.com\/blog\/wp-json\/wp\/v2\/tags?post=562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}