@funnelfox/payments-sdk 0.1.2-beta.5 → 0.1.2-beta.6
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/dist/index.cjs +3 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -90,7 +90,9 @@ var StripeCheckoutService = class extends HttpService {
|
|
|
90
90
|
customer_id: params.customerId,
|
|
91
91
|
customer: params.customer,
|
|
92
92
|
return_url: params.returnUrl,
|
|
93
|
-
allow_promotion_codes: params.allowPromoCodes
|
|
93
|
+
...params.allowPromoCodes && { allow_promotion_codes: params.allowPromoCodes },
|
|
94
|
+
...params.coupon && { coupon: params.coupon },
|
|
95
|
+
...params.trialPeriodDays && { trial: { period_days: params.trialPeriodDays } }
|
|
94
96
|
});
|
|
95
97
|
if (!data.client_secret) {
|
|
96
98
|
throw new CheckoutError("Backend returned no client_secret");
|
package/dist/index.d.cts
CHANGED
|
@@ -25,6 +25,10 @@ interface StripeConfig {
|
|
|
25
25
|
returnUrl?: string;
|
|
26
26
|
/** When true, Stripe displays a promotional code input field in the embedded checkout */
|
|
27
27
|
allowPromoCodes?: boolean;
|
|
28
|
+
/** Pre-apply a specific coupon/discount code to the checkout session */
|
|
29
|
+
coupon?: string;
|
|
30
|
+
/** Free trial period in days before billing starts */
|
|
31
|
+
trialPeriodDays?: number;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
interface FastSpringConfig {
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,10 @@ interface StripeConfig {
|
|
|
25
25
|
returnUrl?: string;
|
|
26
26
|
/** When true, Stripe displays a promotional code input field in the embedded checkout */
|
|
27
27
|
allowPromoCodes?: boolean;
|
|
28
|
+
/** Pre-apply a specific coupon/discount code to the checkout session */
|
|
29
|
+
coupon?: string;
|
|
30
|
+
/** Free trial period in days before billing starts */
|
|
31
|
+
trialPeriodDays?: number;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
interface FastSpringConfig {
|
package/dist/index.js
CHANGED
|
@@ -63,7 +63,9 @@ var StripeCheckoutService = class extends HttpService {
|
|
|
63
63
|
customer_id: params.customerId,
|
|
64
64
|
customer: params.customer,
|
|
65
65
|
return_url: params.returnUrl,
|
|
66
|
-
allow_promotion_codes: params.allowPromoCodes
|
|
66
|
+
...params.allowPromoCodes && { allow_promotion_codes: params.allowPromoCodes },
|
|
67
|
+
...params.coupon && { coupon: params.coupon },
|
|
68
|
+
...params.trialPeriodDays && { trial: { period_days: params.trialPeriodDays } }
|
|
67
69
|
});
|
|
68
70
|
if (!data.client_secret) {
|
|
69
71
|
throw new CheckoutError("Backend returned no client_secret");
|