{"_id":"@akshay4362/razorpay-plugin","_rev":"2-1d6e3bc3369bd15cdfd43198f42b84e1","name":"@akshay4362/razorpay-plugin","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"@akshay4362/razorpay-plugin","version":"1.0.0","license":"GPL-3.0-or-later","_id":"@akshay4362/razorpay-plugin@1.0.0","maintainers":[{"name":"akshay4362","email":"akshay.t@softobotics.com"}],"homepage":"https://www.vendure.io/","dist":{"shasum":"adcf164b0109c89dd570ef05216679cbcc784f9c","tarball":"https://registry.npmjs.org/@akshay4362/razorpay-plugin/-/razorpay-plugin-1.0.0.tgz","fileCount":38,"integrity":"sha512-IhsIwxWHX9EwhLSXzaxtNwViYlEhwIY6px/+wTJGPXQxSrTKvGDeSJJIqD8NR5d0gA3aeghXCzVMeYYD3x97BA==","signatures":[{"sig":"MEUCIF7BUmKHzSCV+AIa8WElxNrYgrA9NvycvOThXFBxzRxYAiEA9c0dhfG7OA+0l5JO7POWYJNvTxbbC3E6hJrq3j6arQM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61539},"main":"lib/index.js","types":"lib/index.d.ts","funding":"https://github.com/sponsors/michaelbromley","gitHead":"9179ea205b5b905b627457f2f60e59d172a88f6a","private":false,"scripts":{"ci":"npm run build","e2e":"cross-env PACKAGE=razorpay-plugin vitest --config ../../e2e-common/vitest.config.mts --run","lint":"eslint .","build":"rimraf lib && tsc -p ./tsconfig.build.json","watch":"tsc -p ./tsconfig.build.json --watch","e2e:watch":"cross-env PACKAGE=razorpay-plugin vitest --config ../../e2e-common/vitest.config.mts","dev-server":"npm run build && DB=sqlite node -r ts-node/register e2e/razorpay-dev-server.ts"},"_npmUser":{"name":"akshay4362","email":"akshay.t@softobotics.com"},"_npmVersion":"10.9.8","description":"Plugin to enable payments through [Razorpay](https://razorpay.com/docs/) via the Orders API and Checkout.js.","directories":{},"_nodeVersion":"22.23.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"nock":"^13.1.4","rimraf":"^5.0.5","razorpay":"^2.9.8","typescript":"5.8.2","@vendure/core":"3.6.0-minor-202603280303","@vendure/common":"3.6.0-minor-202603280303","@vendure/testing":"3.6.0-minor-202603280303","@vendure/admin-ui-plugin":"3.6.0-minor-202603280303"},"peerDependencies":{"razorpay":"^2.x","@vendure/core":"^3.6.0-0","@vendure/common":"^3.6.0-0"},"_npmOperationalInternal":{"tmp":"tmp/razorpay-plugin_1.0.0_1788260138044_0.9685710037075086","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"@akshay4362/razorpay-plugin","version":"3.0.0","license":"GPL-3.0-or-later","main":"lib/index.js","types":"lib/index.d.ts","private":false,"scripts":{"watch":"tsc -p ./tsconfig.build.json --watch","build":"rimraf lib && tsc -p ./tsconfig.build.json","e2e":"cross-env PACKAGE=razorpay-plugin vitest --config ../../e2e-common/vitest.config.mts --run","e2e:watch":"cross-env PACKAGE=razorpay-plugin vitest --config ../../e2e-common/vitest.config.mts","lint":"eslint .","ci":"npm run build","dev-server":"npm run build && DB=sqlite node -r ts-node/register e2e/razorpay-dev-server.ts"},"homepage":"https://www.vendure.io/","funding":"https://github.com/sponsors/michaelbromley","publishConfig":{"access":"public"},"peerDependencies":{"@vendure/core":"^3.6.0-0","@vendure/common":"^3.6.0-0","razorpay":"^2.x"},"devDependencies":{"@vendure/common":"3.6.0-minor-202603280303","@vendure/core":"3.6.0-minor-202603280303","@vendure/testing":"3.6.0-minor-202603280303","nock":"^13.1.4","razorpay":"^2.9.8","rimraf":"^5.0.5","typescript":"5.8.2"},"_id":"@akshay4362/razorpay-plugin@3.0.0","gitHead":"9179ea205b5b905b627457f2f60e59d172a88f6a","description":"Plugin to enable payments through [Razorpay](https://razorpay.com/docs/) via the Orders API and Checkout.js.","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-unHr6Oz6mrur5utAg4Xg3n0b+uuMe/bf2oBerUGTQI+pAu+JgPwE74+PeKgQpjrDXjRnZfx7Phhs9BXJbNHcYg==","shasum":"b7e941a51a9e9eb15d40abe9a7893d8a043c1295","tarball":"https://registry.npmjs.org/@akshay4362/razorpay-plugin/-/razorpay-plugin-3.0.0.tgz","fileCount":38,"unpackedSize":68074,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDTMZmfxAEVkOQtNFlSLOQ0jI/VH0OfDJhtnabeUuzGAQIgK/qVaJikZqZvPCsuUeehxjDKMMu6flOPhvtGt6EqX90="}]},"_npmUser":{"name":"akshay4362","email":"akshay.t@softobotics.com"},"directories":{},"maintainers":[{"name":"akshay4362","email":"akshay.t@softobotics.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/razorpay-plugin_3.0.0_1788267932869_0.3728828121487835"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-01T10:55:37.788Z","modified":"2026-09-01T13:05:33.170Z","1.0.0":"2026-09-01T10:55:38.192Z","3.0.0":"2026-09-01T13:05:33.006Z"},"license":"GPL-3.0-or-later","homepage":"https://www.vendure.io/","description":"Plugin to enable payments through [Razorpay](https://razorpay.com/docs/) via the Orders API and Checkout.js.","maintainers":[{"name":"akshay4362","email":"akshay.t@softobotics.com"}],"readme":"# Razorpay Payment Plugin\n\nPlugin to enable payments through [Razorpay](https://razorpay.com/docs/) via the Orders API and Checkout.js.\n\n## Requirements\n\n1. You will need a Razorpay account and your Key ID / Key Secret from the dashboard (Settings -> API Keys).\n2. Create a webhook in the Razorpay dashboard (Settings -> Webhooks, \"Add New Webhook\") which listens to the\n   `payment.captured`, `payment.failed`, `refund.processed`, and `refund.failed` events. The URL should be\n   `https://my-server.com/payments/razorpay`, where `my-server.com` is the host of your Vendure server.\n3. Get the webhook secret for the newly created webhook.\n4. Install the plugin and the Razorpay Node library:\n\n    ```shell\n    npm install @vendure-community/razorpay-plugin razorpay\n    ```\n\n## Setup\n\n1. Add the plugin to your VendureConfig `plugins` array:\n    ```ts\n    import { RazorpayPlugin } from '@vendure-community/razorpay-plugin';\n\n    // ...\n\n    plugins: [\n      RazorpayPlugin.init({\n        // optional: see the RazorpayPluginOptions type for storeCustomersInRazorpay / refundSpeed\n      }),\n    ]\n    ```\n2. Create a new PaymentMethod in the Admin UI, and select \"Razorpay payments\" as the handler.\n3. Set the \"Key ID\", \"Key Secret\", and \"Webhook Secret\" arguments on the PaymentMethod form. Each\n   PaymentMethod using the Razorpay handler can be configured with its own Razorpay account, so\n   different channels/PaymentMethods can point at different accounts. Only one enabled PaymentMethod\n   using the Razorpay handler is supported per channel at a time.\n\n## Storefront Usage\n\n1. Call the `createRazorpayOrder` mutation to create a Razorpay Order for the active order, returning\n   `{ orderId, amount, currency, keyId }`.\n2. Pass these values into [Razorpay Checkout.js](https://razorpay.com/docs/payments/payment-gateway/web-integration/standard/):\n   ```js\n   const options = {\n     key: keyId,\n     amount,\n     currency,\n     order_id: orderId,\n     handler: function (response) {\n       // response.razorpay_order_id, response.razorpay_payment_id, response.razorpay_signature\n     },\n   };\n   new Razorpay(options).open();\n   ```\n3. On success, call Vendure's standard `addPaymentToOrder` mutation with:\n   ```json\n   {\n     \"method\": \"<your payment method code>\",\n     \"metadata\": {\n       \"razorpayOrderId\": \"<razorpay_order_id>\",\n       \"razorpayPaymentId\": \"<razorpay_payment_id>\",\n       \"razorpaySignature\": \"<razorpay_signature>\"\n     }\n   }\n   ```\n   The plugin verifies the signature server-side before settling the payment.\n\nThe `/payments/razorpay` webhook acts as a reconciliation backstop only — it settles the order if the\nstorefront's `addPaymentToOrder` call never completes (e.g. the browser tab closed after payment).\n\n## Refunds\n\nCreating a refund via the Admin UI (or the `refundOrder` mutation) calls the\n[Razorpay Refunds API](https://razorpay.com/docs/api/refunds/create). By default, refunds are processed at\nRazorpay's `'normal'` speed and settle asynchronously (typically 5-7 days later); set the `refundSpeed` plugin\noption to `'optimum'` to let Razorpay attempt an instant refund where supported, falling back to normal\nprocessing otherwise.\n\nBecause a `'normal'`-speed refund is created in a `Pending` state, the plugin registers a custom refund\nprocess that permits a `Pending -> Pending` self-transition (Vendure's default process only allows\n`Pending -> Settled | Failed`). The `/payments/razorpay` webhook then reconciles the refund to `Settled` or\n`Failed` once Razorpay sends the corresponding `refund.processed`/`refund.failed` event.\n\n## Local Development\n\nSet `RAZORPAY_KEY_ID`, `RAZORPAY_KEY_SECRET`, and `RAZORPAY_WEBHOOK_SECRET` in a `.env` file in this package\n(these seed the dev-server's Razorpay PaymentMethod handler arguments, not `RazorpayPlugin.init()`), then run:\n\n```shell\nnpm run dev-server\n```\n","readmeFilename":"README.md"}