Skip to content

feat: add Razorpay payment gateway support#1245

Open
ritaban06 wants to merge 8 commits into
HiEventsDev:developfrom
ritaban06:razorpay
Open

feat: add Razorpay payment gateway support#1245
ritaban06 wants to merge 8 commits into
HiEventsDev:developfrom
ritaban06:razorpay

Conversation

@ritaban06

@ritaban06 ritaban06 commented Jul 3, 2026

Copy link
Copy Markdown

What changes I've made

  • Added support for Razorpay as a payment gateway.
  • Implemented payment creation using the Razorpay API.
  • Added configuration for Razorpay credentials through environment variables
  • Added webhook handling for payment verification and status updates.
  • Integrated Razorpay into the existing payment flow while preserving compatibility with the existing payment architecture.
  • Updated backend logic and configuration required for the new payment provider.
  • Added Razorpay payment method cards and UI components to the checkout page.
  • Updated the all-in-one docker-compose.yml to include the required Razorpay environment variables and configuration.

Why I've made these changes

Razorpay is one of the most widely used payment gateways in India and supports UPI, credit/debit cards, net banking, and wallets. Adding Razorpay enables Hi.Events to better support organizers in India by allowing them to accept local payments without relying on international payment providers.

How I've tested these changes

  • Verified successful payment order creation.
  • Completed test payments using Razorpay Test Mode.
  • Confirmed successful payment verification after checkout.
  • Verified webhook processing updates payment status correctly.
  • Confirmed failed payments are handled without affecting existing payment providers.
  • Ensured the application continues to function correctly when Razorpay is not configured.
  • Added Razorpay backend integration using Composer.
  • Deployed the application to Dokploy on an Oracle instance.
  • Tested the deployed application successfully in the Dokploy environment.

Checklist

  • I have read the contributing guidelines.
  • My code follows the coding standards of the project.
  • I have tested my changes, and they work as expected.
  • I understand that this PR will be closed if I do not follow the contributor guidelines and if this PR template is left unedited.

Closes #1246

ritaban06 added 8 commits July 3, 2026 15:24
Add a comprehensive Stripe integration reference at backend/docs/stripe-integration.md. The new doc details end-to-end Stripe handling for Hi.Events including environment variables, dependencies, architecture and checkout flow, database schema (stripe_customers, stripe_payments, stripe_payouts, account_stripe_platforms and order additions), backend infrastructure and domain services (configuration, client factory, payment intent creation/refunds, account sync, payout and fee extraction), application handlers and HTTP actions/routes, webhook security and idempotency, frontend React components and queries, SaaS vs open-source behaviours, multi-platform support, refund and payout reconciliation flows, testing commands and a key files reference.
Introduce full Razorpay payment provider support: add env keys, docs and docker updates, and a DB migration for razorpay_orders. New domain objects, Eloquent model, repository + interface, and generated RazorpayOrder domain class. Implement infrastructure services (client factory, configuration, signature verification), domain services (order creation, payment completion, refund), application handlers (create order, payment callback, incoming webhook, refund handler) and webhook/event handlers for payment.captured, payment.failed and refund.processed with idempotency via cache. Add HTTP actions (public create order, payment callback, webhook), integrate provider in RepositoryServiceProvider, and add a Razorpay-specific exception. Update refund flow to route between Stripe and Razorpay based on order payment provider and surface gateway errors generically. Frontend: add Razorpay payment method component, client call and a hook to create Razorpay orders. Composer and service config updated accordingly.
Add razorpay/razorpay (v2.9) to backend composer.json and update composer.lock. The lockfile now includes razorpay/razorpay and its dependency rmccue/requests, and updates content-hash and plugin-api-version. This change enables using the Razorpay PHP client in the backend.
Register Razorpay actions and routes in the API: import Razorpay webhook and payment action classes, add public endpoints for creating Razorpay orders and handling payment callbacks, and expose a /webhooks/razorpay webhook endpoint. This enables support for Razorpay as an additional payment gateway.
Add an id to the injected Razorpay script and early-return from the effect if an element with that id already exists. Also remove the cleanup that removed the script on unmount so the shared SDK isn't removed when individual components unmount. This prevents multiple injections and related side effects when the component mounts repeatedly.
Tighten pre-checks in CreateRazorpayOrderHandler: use getSessionId() for session verification and throw an UnauthorizedException with a user-friendly message when session verification fails. Add an explicit check that the order status is RESERVED and not expired, throwing a ResourceConflictException if the order is expired or in an invalid state. These changes prevent creating Razorpay orders for invalid or expired orders.
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@ritaban06

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🌟Add Razorpay payment gateway support

1 participant