Laravel and PHP development
Payment gateway integration for Laravel, PHP and WooCommerce
I handle payment gateway integration for Laravel, core PHP, CodeIgniter and WooCommerce, connecting Razorpay, Stripe, PayPal, PayU or Cashfree to the software you already run. The checkout button is the easy part. The work that protects your revenue is server-side verification, webhooks that survive retries and duplicates, and refunds and reports that match the gateway dashboard to the rupee or cent.
What’s included
- Gateway choice and account setup advice: Razorpay, Stripe, PayPal, PayU or Cashfree
- Checkout with hosted pages or embedded forms, so card data never touches your server
- Server-side payment verification and signature checks on every callback
- Webhook endpoints with signature verification, idempotency and event logging
- Full and partial refunds, from your admin panel instead of the gateway dashboard
- Subscriptions and recurring billing: plans, trials, upgrades, failed renewals
- Order, invoice and payment status kept in step with database transactions and row locks
- Daily reconciliation report that compares your records with gateway settlements
- Sandbox testing plan, go-live checklist and handover notes
What payment gateway integration covers, and who it is for
Payment gateway integration means connecting your website or application to a provider that takes the money, then making your own system react correctly to everything that provider reports: success, failure, pending UPI payments, disputes, refunds and renewals. The visible part is a pay button. The invisible part is the order state machine behind it.
This service suits businesses with a Laravel, CodeIgniter or core PHP application that need to start taking payments, SaaS products adding paid plans, WooCommerce stores that want a different or additional gateway, and teams whose current integration loses orders or marks unpaid orders as paid. It also suits Indian businesses that need UPI, netbanking and wallets alongside international cards.
It is not for you if a hosted payment link or a no-code store already does what you need. If you sell a handful of products and the gateway's own payment pages are enough, use them: I would rather tell you that on a short call than build something you do not need.
Where payment integrations break, and how I build them so they don't
Payment bugs are rarely exotic. They come from shortcuts that look fine in testing and fail with real customers, slow networks and gateway retries. Here is what I build against:
- Trusting the browser redirect. A customer can close the tab before the success page loads, or tamper with the query string. Payment status is confirmed on the server, by verifying the gateway signature or fetching the payment from the gateway API, and by the webhook.
- Skipping signature checks. Razorpay signs the order and payment IDs with HMAC SHA256 using your key secret. Stripe signs webhooks in the Stripe-Signature header against the raw request body, which breaks if middleware parses the JSON first. PayU uses a SHA-512 hash with your salt, including a reverse hash on the response. Cashfree signs webhooks with a timestamp. Each one is verified before anything changes in your database.
- Processing the same event twice. Gateways retry webhooks, and the redirect and the webhook often arrive at the same moment. I store each event ID behind a unique index and lock the order row inside a database transaction, so an order is marked paid once and stock or credits are granted once.
- Money stored as floats. Amounts go to gateways in the smallest unit (paise or cents) as integers, and are stored as decimals, so rounding never creates a one-paisa mismatch on an invoice.
- No idempotency on outgoing calls. Refunds and charges sent to Stripe carry an Idempotency-Key, so a timeout followed by a retry does not refund a customer twice.
- Nobody reconciles. A scheduled job compares your payments with the gateway's settlement data and flags anything that does not match, before your accountant finds it.
Razorpay, Stripe or PayPal: which gateway fits your business?
The right gateway depends on where your customers are, which currencies you charge in and whether you bill once or every month. Many businesses end up with two: an Indian gateway for domestic customers and Stripe or PayPal for international ones. I wrote a longer comparison in Razorpay vs Stripe for Indian businesses.
For a Razorpay integration in website checkouts aimed at Indian buyers, Razorpay, PayU and Cashfree all support UPI, cards, netbanking and wallets, and each has subscription features. Cashfree is also often chosen for payouts. Stripe is strong for international cards, multi-currency pricing and subscription billing, but new Stripe accounts for India-registered businesses have been invite-only since 2024, so check your eligibility before we design around it. PayPal is worth adding when your buyers are international and already trust it; a PayPal integration in PHP uses its REST Orders API with webhooks for capture and refund events.
For payment gateway integration India-side, also plan for the paperwork: GST on the invoice, the right business category on the gateway account, and RBI e-mandate rules for recurring payments. These affect the build, so I ask about them early.
Payment gateway integration in Laravel: subscriptions and recurring billing
For a stripe subscription Laravel setup, Laravel Cashier is usually the right starting point: it manages customers, subscriptions, trials, plan swaps and Stripe invoices, and ships a webhook controller you extend. A clean Laravel Stripe integration still needs decisions Cashier cannot make for you: what happens to access when a renewal fails, how long the grace period is, how proration should look on an upgrade, and which events your app must react to.
Razorpay subscriptions work differently: plans and subscriptions are created through its API, the customer authorizes a mandate, and charges arrive as webhook events. Under RBI rules, recurring card and UPI payments need an authorized e-mandate, and larger amounts can need extra customer authentication, so renewals can fail for reasons that have nothing to do with your code. I build the retry, reminder and access logic around that reality, and log every state change so support can answer a customer's question in seconds. If you are building the whole product, my SaaS and MVP development work covers plans, roles and billing together.
Why hire me for payment work in Laravel and PHP
Payments are a transactions problem before they are an API problem. My daily work is PHP 8 and Laravel with MySQL transactions, row-level locking, queued jobs, webhooks and signed-request verification, which is exactly what keeps a payment flow correct under load. I also work in CodeIgniter 3 and core PHP, so an older application does not need a rewrite to accept payments properly.
You deal directly with the engineer who writes the code, and I explain trade-offs in plain language: what a webhook failure would mean for your customers, and what I would not build. I am based in India, which helps with Razorpay, UPI and GST details, and I work remotely with clients in different time zones; we agree on update times at the start.
I will not list past payment projects here that I cannot show you. On a call I will walk you through how I would structure your flow, step by step, and you can judge the approach before you commit. The same platform knowledge applies whether the gateway sits in WooCommerce development, a Perfex CRM customization or a custom Laravel app.
What affects the cost and timeline
There is no flat price, because two integrations that look alike from the outside can differ a lot underneath. After a short call or a written brief I send a fixed quote. These are the things that move it:
- How many gateways, and whether customers choose between them or they split by country or currency
- One-time payments only, or subscriptions with trials, upgrades and failed-renewal handling
- The platform: configuring an official WooCommerce plugin is smaller than a custom flow in Laravel or legacy PHP
- The state of the existing code, especially if orders and payments are already out of sync
- Refunds, partial captures and admin tools for your support team
- Reconciliation reports, GST invoices and accounting exports
How the work runs
Map the money flow
We list every way money moves: checkout, renewals, refunds, cancellations and disputes. I confirm which gateway accounts you have, or which you can get approved, before any code is written.
Build in sandbox mode
I build against the gateway's test environment with test keys, starting with server-side verification and the webhook endpoint, then the checkout and admin screens.
Break it on purpose
I test declined cards, abandoned UPI payments, duplicate and out-of-order webhooks, timeouts and refunds, using tools like the Stripe CLI to replay events, and fix what fails.
Go live carefully
Live keys go into environment config, never the code. We run a small real payment and refund, confirm the webhook arrives in production, and watch the first days of transactions.
Hand over
You get notes on where keys live, which events are handled, how to issue refunds and how to read the reconciliation report, plus access to all code in your repository.
Tools and technologies
- Laravel
- PHP 8
- CodeIgniter 3
- WooCommerce
- Laravel Cashier (Stripe)
- Stripe API and Stripe CLI
- Razorpay API
- PayPal REST API
- PayU
- Cashfree Payments
- MySQL transactions
- Laravel queues
- Postman
About past work
Client work for this service is private, so it is not shown here. On a call I can walk you through comparable projects, what was done and how it turned out. The case studies show how I approach engineering problems in general.
Questions
Which payment gateway should I use: Razorpay, Stripe or PayPal?
Use an Indian gateway such as Razorpay for INR and UPI, and Stripe or PayPal for international cards and currencies. Many businesses selling both in India and abroad run two gateways side by side. If you are an India-registered business, check Stripe's invite-only status for new accounts before planning around it.
Do you handle webhooks and failed payments?
Yes, webhooks are the core of the work. Every event is signature-checked, stored once and processed in a queued job, and failed or pending payments move the order to a clear state your team can see.
Is my payment integration PCI compliant?
With hosted checkout or the gateway's embedded fields, card numbers go straight to the gateway and never touch your server, which keeps your PCI DSS scope as small as it can be. You still complete the gateway's self-assessment, and I make sure nothing in your code logs or stores card data.
Can you set up subscriptions and recurring billing?
Yes, with Stripe through Laravel Cashier, or with Razorpay subscriptions and mandates. I build trials, plan changes, grace periods and failed-renewal handling, and log every billing event for support.
Can you add Razorpay to WooCommerce or Perfex CRM?
Yes. For WooCommerce I usually start with the gateway's official plugin and customize around it. Perfex CRM supports custom gateways as modules, so Razorpay, PayU or Cashfree can be added without editing core files.
What is the Razorpay integration cost?
The integration is a one-time fixed quote based on scope, and the gateway's transaction fees are separate and paid to the gateway. A simple one-time checkout costs far less than subscriptions with refunds and reconciliation. I quote after a short call or a written brief.
Can I accept international payments as an Indian business?
Yes, through gateways that support international cards and currency settlement, subject to the gateway approving your account for it. Expect extra documentation, and plan for different settlement times and fees on foreign payments.
How long does a payment gateway integration take?
A single gateway with one-time payments on a clean codebase is usually a matter of days, not weeks. Subscriptions, multiple gateways or an older codebase with order bugs take longer, and I give you a timeline with the quote.
Related services
Further reading
Tell me what you are building.
A few lines about the project, who will use it and when it needs to ship are enough to start. You get a straight answer on whether payment gateway integration is the right fit, and what it would take.
- Status
- Available for new projects
- Reply time
- I reply within an hour during working hours.
- Working hours
- 9 AM to 9 PM IST (UTC+5:30)
- Languages
- English, Hindi, Gujarati
Prefer email? Write to jaygajjar.dev@gmail.com.