@deiondz/better-auth-razorpay 2.0.11 → 2.0.12

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.
@@ -25,11 +25,12 @@ interface ListSubscriptionsResponse {
25
25
  success: true;
26
26
  data: SubscriptionRecord[];
27
27
  }
28
- /** Response shape for create-or-update (success). */
28
+ /** Response shape for create-or-update (success). When `embed: true`, checkoutUrl is omitted; use openRazorpaySubscriptionCheckout with razorpaySubscriptionId for in-page modal. */
29
29
  interface CreateOrUpdateSubscriptionResponse {
30
30
  success: true;
31
31
  data: {
32
- checkoutUrl: string;
32
+ /** Present when not using embed; omit when embed is true (use in-page modal instead). */
33
+ checkoutUrl?: string | null;
33
34
  subscriptionId: string;
34
35
  razorpaySubscriptionId: string;
35
36
  };
@@ -114,6 +115,8 @@ interface CreateOrUpdateSubscriptionInput {
114
115
  subscriptionId?: string;
115
116
  successUrl?: string;
116
117
  disableRedirect?: boolean;
118
+ /** When true, checkout runs in-page via Razorpay modal; no redirect to checkoutUrl. */
119
+ embed?: boolean;
117
120
  }
118
121
  /** Input for cancel subscription. */
119
122
  interface CancelSubscriptionInput {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deiondz/better-auth-razorpay",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
4
4
  "description": "Better Auth plugin for Razorpay subscriptions and payments",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",