@deiondz/better-auth-razorpay 2.0.10 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { S as SubscriptionRecord } from './types-B25gyPpX.js';
1
+ import { S as SubscriptionRecord } from './types-VZW_XCzQ.js';
2
2
 
3
3
  /**
4
4
  * Client-side types for Razorpay plugin hooks and API responses.
@@ -156,14 +156,16 @@ interface RazorpayWebhookContext {
156
156
  };
157
157
  }
158
158
  type OnWebhookEventCallback = (payload: RazorpayWebhookPayload, context: RazorpayWebhookContext) => Promise<void>;
159
- /** Main plugin options: client, webhook secret, customer creation, subscription config, callbacks. */
159
+ /** Main plugin options: client or credentials, webhook secret, customer creation, subscription config, callbacks. */
160
160
  interface RazorpayPluginOptions {
161
- /** Initialized Razorpay client instance. */
162
- razorpayClient: razorpay;
161
+ /** Initialized Razorpay client instance. Omit if using razorpayKeyId + razorpayKeySecret (plugin creates the instance). */
162
+ razorpayClient?: razorpay;
163
+ /** Razorpay API key ID. Required when razorpayClient is not provided; plugin creates the Razorpay instance. */
164
+ razorpayKeyId?: string;
165
+ /** Razorpay API key secret. Required when razorpayClient is not provided (plugin creates the instance). When set, also enables POST /razorpay/verify-payment (same as Razorpay client secret, not webhook secret). */
166
+ razorpayKeySecret?: string;
163
167
  /** Webhook secret for signature verification. */
164
168
  razorpayWebhookSecret?: string;
165
- /** API key secret for payment signature verification. When set, enables POST /razorpay/verify-payment (same secret as Razorpay client, not webhook secret). */
166
- razorpayKeySecret?: string;
167
169
  /** Create Razorpay customer when user signs up. Default: false. */
168
170
  createCustomerOnSignUp?: boolean;
169
171
  /** Called after a Razorpay customer is created. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deiondz/better-auth-razorpay",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "Better Auth plugin for Razorpay subscriptions and payments",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",