@deiondz/better-auth-razorpay 2.0.13 → 2.0.15
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.
- package/README.md +4 -2
- package/dist/client/hooks.d.ts +3 -3
- package/dist/client.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +47 -17
- package/dist/index.js.map +1 -1
- package/dist/{types-BC0odu_S.d.ts → types-CpjgfbVJ.d.ts} +13 -1
- package/dist/{types-B91GdcpF.d.ts → types-I97EgC8r.d.ts} +5 -1
- package/package.json +1 -1
|
@@ -35,6 +35,8 @@ type SubscriptionStatus = 'created' | 'active' | 'pending' | 'halted' | 'cancell
|
|
|
35
35
|
interface SubscriptionRecord {
|
|
36
36
|
id: string;
|
|
37
37
|
plan: string;
|
|
38
|
+
/** Razorpay plan ID (e.g. plan_xxx) for the subscription. */
|
|
39
|
+
planId?: string | null;
|
|
38
40
|
referenceId: string;
|
|
39
41
|
razorpayCustomerId?: string | null;
|
|
40
42
|
razorpaySubscriptionId?: string | null;
|
|
@@ -61,6 +63,16 @@ interface PlanFreeTrial {
|
|
|
61
63
|
subscription: SubscriptionRecord;
|
|
62
64
|
}) => Promise<void>;
|
|
63
65
|
}
|
|
66
|
+
/** Price details for a plan variant (from Razorpay Plan API). Amount is in smallest currency unit (e.g. paise, cents). */
|
|
67
|
+
interface PlanPriceDetail {
|
|
68
|
+
/** Amount in smallest currency unit (e.g. 89900 = ₹899.00, 1000 = $10.00). */
|
|
69
|
+
amount: number;
|
|
70
|
+
currency: string;
|
|
71
|
+
/** Billing period: daily | weekly | monthly | quarterly | yearly. */
|
|
72
|
+
period: string;
|
|
73
|
+
/** Billing interval (e.g. 1 for every 1 month, 2 for every 2 months). */
|
|
74
|
+
interval?: number;
|
|
75
|
+
}
|
|
64
76
|
/** Named plan with monthly/annual Razorpay plan IDs and optional trial. */
|
|
65
77
|
interface RazorpayPlan {
|
|
66
78
|
name: string;
|
|
@@ -217,4 +229,4 @@ interface RazorpayErrorResponse {
|
|
|
217
229
|
}
|
|
218
230
|
type RazorpayApiResponse<T = unknown> = RazorpaySuccessResponse<T> | RazorpayErrorResponse;
|
|
219
231
|
|
|
220
|
-
export type { OnWebhookEventCallback as O, RazorpayPluginOptions as R, SubscriptionRecord as S, RazorpayApiResponse as a, RazorpayErrorResponse as b, RazorpayPlan as c, RazorpaySubscription as d, RazorpaySuccessResponse as e, RazorpayUserRecord as f, RazorpayWebhookContext as g, RazorpayWebhookEvent as h, RazorpayWebhookPayload as i, SubscriptionStatus as j };
|
|
232
|
+
export type { OnWebhookEventCallback as O, PlanPriceDetail as P, RazorpayPluginOptions as R, SubscriptionRecord as S, RazorpayApiResponse as a, RazorpayErrorResponse as b, RazorpayPlan as c, RazorpaySubscription as d, RazorpaySuccessResponse as e, RazorpayUserRecord as f, RazorpayWebhookContext as g, RazorpayWebhookEvent as h, RazorpayWebhookPayload as i, SubscriptionStatus as j };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SubscriptionRecord } from './types-
|
|
1
|
+
import { P as PlanPriceDetail, S as SubscriptionRecord } from './types-CpjgfbVJ.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Client-side types for Razorpay plugin hooks and API responses.
|
|
@@ -14,6 +14,10 @@ interface PlanSummary {
|
|
|
14
14
|
freeTrial?: {
|
|
15
15
|
days: number;
|
|
16
16
|
};
|
|
17
|
+
/** Price for monthly plan (from Razorpay). Omitted if fetch failed or unavailable. */
|
|
18
|
+
monthly?: PlanPriceDetail;
|
|
19
|
+
/** Price for annual plan (from Razorpay). Omitted if not configured or fetch failed. */
|
|
20
|
+
annual?: PlanPriceDetail;
|
|
17
21
|
}
|
|
18
22
|
/** Response shape for get-plans (success). */
|
|
19
23
|
interface GetPlansResponse {
|