@funnelfox/payments-sdk 0.1.2-beta.4 → 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 +5 -2
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -2
- 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");
|
|
@@ -175,7 +177,8 @@ var StripeProvider = class {
|
|
|
175
177
|
subscriptionId: session.subscription_id ?? void 0,
|
|
176
178
|
invoiceId: session.invoice_id ?? void 0,
|
|
177
179
|
amountPaid: session.amount_total ?? void 0,
|
|
178
|
-
currency: session.currency ?? void 0
|
|
180
|
+
currency: session.currency ?? void 0,
|
|
181
|
+
email: session.email ?? void 0
|
|
179
182
|
});
|
|
180
183
|
} catch {
|
|
181
184
|
this.callbacks.onComplete?.({ provider: "stripe" });
|
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 {
|
|
@@ -61,6 +65,7 @@ interface CheckoutCompleteEvent {
|
|
|
61
65
|
invoiceId?: string;
|
|
62
66
|
amountPaid?: number;
|
|
63
67
|
currency?: string;
|
|
68
|
+
email?: string;
|
|
64
69
|
}
|
|
65
70
|
interface CheckoutErrorEvent {
|
|
66
71
|
provider: ProviderName;
|
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 {
|
|
@@ -61,6 +65,7 @@ interface CheckoutCompleteEvent {
|
|
|
61
65
|
invoiceId?: string;
|
|
62
66
|
amountPaid?: number;
|
|
63
67
|
currency?: string;
|
|
68
|
+
email?: string;
|
|
64
69
|
}
|
|
65
70
|
interface CheckoutErrorEvent {
|
|
66
71
|
provider: ProviderName;
|
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");
|
|
@@ -148,7 +150,8 @@ var StripeProvider = class {
|
|
|
148
150
|
subscriptionId: session.subscription_id ?? void 0,
|
|
149
151
|
invoiceId: session.invoice_id ?? void 0,
|
|
150
152
|
amountPaid: session.amount_total ?? void 0,
|
|
151
|
-
currency: session.currency ?? void 0
|
|
153
|
+
currency: session.currency ?? void 0,
|
|
154
|
+
email: session.email ?? void 0
|
|
152
155
|
});
|
|
153
156
|
} catch {
|
|
154
157
|
this.callbacks.onComplete?.({ provider: "stripe" });
|