@sintecinformatik/checkout 1.1.0 → 1.2.0
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.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -12,6 +12,8 @@ interface StartCheckoutParams {
|
|
|
12
12
|
licenseType: LicenseType;
|
|
13
13
|
/** Customer email (optional, pre-fills Stripe checkout) */
|
|
14
14
|
customerEmail?: string;
|
|
15
|
+
/** Customer name (optional, stored with license) */
|
|
16
|
+
customerName?: string;
|
|
15
17
|
}
|
|
16
18
|
interface CheckoutButtonProps extends StartCheckoutParams {
|
|
17
19
|
/** Base URL of the license server */
|
|
@@ -44,7 +46,7 @@ interface ProductPricing {
|
|
|
44
46
|
trialDaysLimit: number;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
declare function CheckoutButton({ productSlug, licenseType, customerEmail, serverUrl, className, children, onCheckoutStart, onError, }: CheckoutButtonProps): react_jsx_runtime.JSX.Element;
|
|
49
|
+
declare function CheckoutButton({ productSlug, licenseType, customerEmail, customerName, serverUrl, className, children, onCheckoutStart, onError, }: CheckoutButtonProps): react_jsx_runtime.JSX.Element;
|
|
48
50
|
|
|
49
51
|
interface UseCheckoutReturn {
|
|
50
52
|
/** Start the checkout process */
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ interface StartCheckoutParams {
|
|
|
12
12
|
licenseType: LicenseType;
|
|
13
13
|
/** Customer email (optional, pre-fills Stripe checkout) */
|
|
14
14
|
customerEmail?: string;
|
|
15
|
+
/** Customer name (optional, stored with license) */
|
|
16
|
+
customerName?: string;
|
|
15
17
|
}
|
|
16
18
|
interface CheckoutButtonProps extends StartCheckoutParams {
|
|
17
19
|
/** Base URL of the license server */
|
|
@@ -44,7 +46,7 @@ interface ProductPricing {
|
|
|
44
46
|
trialDaysLimit: number;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
declare function CheckoutButton({ productSlug, licenseType, customerEmail, serverUrl, className, children, onCheckoutStart, onError, }: CheckoutButtonProps): react_jsx_runtime.JSX.Element;
|
|
49
|
+
declare function CheckoutButton({ productSlug, licenseType, customerEmail, customerName, serverUrl, className, children, onCheckoutStart, onError, }: CheckoutButtonProps): react_jsx_runtime.JSX.Element;
|
|
48
50
|
|
|
49
51
|
interface UseCheckoutReturn {
|
|
50
52
|
/** Start the checkout process */
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,8 @@ function useCheckout(options = {}) {
|
|
|
46
46
|
body: JSON.stringify({
|
|
47
47
|
productSlug: params.productSlug,
|
|
48
48
|
licenseType: params.licenseType,
|
|
49
|
-
customerEmail: params.customerEmail
|
|
49
|
+
customerEmail: params.customerEmail,
|
|
50
|
+
customerName: params.customerName
|
|
50
51
|
})
|
|
51
52
|
});
|
|
52
53
|
const data = await response.json();
|
|
@@ -83,6 +84,7 @@ function CheckoutButton({
|
|
|
83
84
|
productSlug,
|
|
84
85
|
licenseType,
|
|
85
86
|
customerEmail,
|
|
87
|
+
customerName,
|
|
86
88
|
serverUrl,
|
|
87
89
|
className,
|
|
88
90
|
children = "Buy Now",
|
|
@@ -96,7 +98,8 @@ function CheckoutButton({
|
|
|
96
98
|
await startCheckout({
|
|
97
99
|
productSlug,
|
|
98
100
|
licenseType,
|
|
99
|
-
customerEmail
|
|
101
|
+
customerEmail,
|
|
102
|
+
customerName
|
|
100
103
|
});
|
|
101
104
|
} catch (err) {
|
|
102
105
|
const message = err instanceof Error ? err.message : "Checkout failed";
|
package/dist/index.mjs
CHANGED
|
@@ -18,7 +18,8 @@ function useCheckout(options = {}) {
|
|
|
18
18
|
body: JSON.stringify({
|
|
19
19
|
productSlug: params.productSlug,
|
|
20
20
|
licenseType: params.licenseType,
|
|
21
|
-
customerEmail: params.customerEmail
|
|
21
|
+
customerEmail: params.customerEmail,
|
|
22
|
+
customerName: params.customerName
|
|
22
23
|
})
|
|
23
24
|
});
|
|
24
25
|
const data = await response.json();
|
|
@@ -55,6 +56,7 @@ function CheckoutButton({
|
|
|
55
56
|
productSlug,
|
|
56
57
|
licenseType,
|
|
57
58
|
customerEmail,
|
|
59
|
+
customerName,
|
|
58
60
|
serverUrl,
|
|
59
61
|
className,
|
|
60
62
|
children = "Buy Now",
|
|
@@ -68,7 +70,8 @@ function CheckoutButton({
|
|
|
68
70
|
await startCheckout({
|
|
69
71
|
productSlug,
|
|
70
72
|
licenseType,
|
|
71
|
-
customerEmail
|
|
73
|
+
customerEmail,
|
|
74
|
+
customerName
|
|
72
75
|
});
|
|
73
76
|
} catch (err) {
|
|
74
77
|
const message = err instanceof Error ? err.message : "Checkout failed";
|