Razorpay Adapter
Adds Razorpay as a payment method to Payload's ecommerce plugin, handling order creation, payment capture verification, and transaction recording.
Installation
pnpm add @codenik/payload-razorpay About
This adapter plugs Razorpay into the official Payload Ecommerce plugin as a payment method. It implements the `PaymentAdapter` contract that `@payloadcms/plugin-ecommerce` expects, so you register it inside `ecommercePlugin({ payments: { paymentMethods: [razorpayAdapter({...})] } })` next to any other providers. `initiatePayment` calls Razorpay's Orders API to create an order, stores the order id and a flattened cart snapshot inside a Payload transaction, and returns the id to the frontend. After the customer finishes Razorpay Checkout, `confirmOrder` fetches the payment through the Razorpay SDK, checks that the status is `captured`, then creates the Payload order, marks the cart as purchased, and updates the transaction to `succeeded`. A webhook endpoint is registered at `POST /webhooks`, though the handler is a stub that returns `200` and does not verify Razorpay signatures server-side, so webhook-driven reconciliation is not wired up. You pass `publishableKey` and `secretKey` to the server adapter and `publishableKey` to the `razorpayAdapterClient` frontend helper. The README pairs this package with the third-party `react-razorpay` library for opening the checkout modal in the browser, since the adapter itself only owns the backend lifecycle. It targets Payload 3.x with `@payloadcms/plugin-ecommerce` as a peer dependency and ships ESM TypeScript output for Node.js 20+ and Next.js 15+.
Package info
- Package name
@codenik/payload-razorpay- Latest version
1.0.2- Unpacked size
- 35 kB
- Weekly downloads
- 5
- Last publish
- Aug 6, 2026
Similar plugins
More in CommerceStripe
Syncs Payload collections with Stripe resources and routes Stripe webhooks and API calls through Payload.
Google Merchant Center Ecommerce Integration
Sync products with Google Merchant Center from Payload CMS.
Barcodes
Adds Code 128, EAN-13 and QR code generation to Payload product collections with a printable label page and optional admin print buttons.
AI Manager
Writes product titles, descriptions, attributes and translations into Payload fields via Claude, ChatGPT, Gemini or Kimi, and skips content it already generated.
EU VAT
Records EU VAT on Payload ecommerce orders: country rates, B2B reverse charge, VIES validation, and OSS reporting totals.
Stock Reservation
Validates variant stock and price before checkout and holds reserved inventory until payment settles, extending the official Payload ecommerce plugin.