@plyaz/types 1.16.8 → 1.16.9
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.
|
@@ -5,6 +5,17 @@ import type { PROVIDER_PRODUCT_STATUS } from './enums';
|
|
|
5
5
|
* Billing cycle for subscription or recurring payments
|
|
6
6
|
*/
|
|
7
7
|
export type BillingCycle = 'daily' | 'weekly' | 'monthly' | 'quarterly' | 'yearly' | 'one-time';
|
|
8
|
+
export type Interval = 'day' | 'week' | 'month' | 'year';
|
|
9
|
+
export interface CustomInterval {
|
|
10
|
+
/** Stripe-compatible interval (for fixed intervals) */
|
|
11
|
+
interval?: Interval;
|
|
12
|
+
/** Number of intervals (for fixed intervals) */
|
|
13
|
+
interval_count?: number;
|
|
14
|
+
/** Custom start date (optional) */
|
|
15
|
+
startDate?: Date;
|
|
16
|
+
/** Custom end date (optional) */
|
|
17
|
+
endDate?: Date;
|
|
18
|
+
}
|
|
8
19
|
/**
|
|
9
20
|
* Parameters to create a new product in the payment provider
|
|
10
21
|
*/
|
|
@@ -353,9 +353,17 @@ export interface SavedPaymentMethod<TMetadata extends object = object> {
|
|
|
353
353
|
export interface CreateSubscriptionParams<TMetadata extends object = object> {
|
|
354
354
|
/** Plyaz user ID (Stripe customer ID or your internal user ID mapped to Stripe) */
|
|
355
355
|
userId: string;
|
|
356
|
+
/** Selected payment method from supported options */
|
|
356
357
|
paymentMethod: PAYMENT_METHOD;
|
|
358
|
+
/**
|
|
359
|
+
* Optional provider override for advanced use cases
|
|
360
|
+
* If not specified, optimal provider will be auto-selected
|
|
361
|
+
*/
|
|
362
|
+
provider?: PAYMENT_PROVIDER_TYPE;
|
|
357
363
|
/** Plan to subscribe the user to (internal plan name) */
|
|
358
364
|
plan: string;
|
|
365
|
+
/** Product pricing */
|
|
366
|
+
priceId: string;
|
|
359
367
|
/** Optional trial period in days */
|
|
360
368
|
trialDays?: number;
|
|
361
369
|
/** URL to redirect user after successful payment completion */
|
package/package.json
CHANGED