@seaverse/payment-sdk 0.6.0 → 0.6.2

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 CHANGED
@@ -77,6 +77,7 @@ await checkoutClient.subscribe({
77
77
  productId: 'pro',
78
78
  period: 'month',
79
79
  periodAmount: 24.99,
80
+ billing_period: 'month', // Optional: billing period - 'month' | 'year'
80
81
  onSuccess: (res) => console.log('Subscription success:', res),
81
82
  });
82
83
  ```
@@ -145,6 +146,27 @@ interface CheckoutClientConfig {
145
146
  }
146
147
  ```
147
148
 
149
+ ### Subscription Options
150
+
151
+ ```typescript
152
+ interface SubscribeOptions {
153
+ productId?: string; // Product ID (recommended)
154
+ productName?: string; // Product name (if no productId)
155
+ price?: number; // Price in USD (if no productId)
156
+ period: SubscriptionPeriod; // Subscription period: 'week' | 'month' | 'year'
157
+ periodAmount: number; // Amount per period (USD)
158
+ firstDays?: number; // First billing delay in days (default: 0)
159
+ billing_period?: 'month' | 'year'; // Optional: billing period
160
+ extra?: Record<string, unknown>; // Extra custom data
161
+ language?: string; // Language setting
162
+ userName?: string; // User name for display
163
+ redirectUrl?: string; // Redirect URL after payment
164
+ onSuccess?: (result: PaymentResult) => void; // Success callback
165
+ onError?: (error: CheckoutPaymentError) => void; // Error callback
166
+ onClose?: () => void; // Close callback
167
+ }
168
+ ```
169
+
148
170
  ### Environment Configuration
149
171
 
150
172
  | Environment | API Host |
@@ -813,6 +813,7 @@ class PaymentCheckoutClient {
813
813
  period: options.period,
814
814
  periodAmount: options.periodAmount,
815
815
  firstDays: options.firstDays ?? 0,
816
+ billing_period: options.billing_period,
816
817
  },
817
818
  extra: options.extra,
818
819
  redirectUrl: options.redirectUrl,
@@ -1166,7 +1167,7 @@ function getSDKLocale(locale) {
1166
1167
  /**
1167
1168
  * SDK version
1168
1169
  */
1169
- const VERSION$2 = '0.6.0';
1170
+ const VERSION$2 = '0.6.1';
1170
1171
 
1171
1172
  var __defProp = Object.defineProperty;
1172
1173
  var __defProps = Object.defineProperties;