@sintecinformatik/checkout 1.1.0 → 1.3.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 CHANGED
@@ -12,6 +12,10 @@ 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;
17
+ /** Skip trial period and charge immediately (default: false) */
18
+ skipTrial?: boolean;
15
19
  }
16
20
  interface CheckoutButtonProps extends StartCheckoutParams {
17
21
  /** Base URL of the license server */
@@ -44,7 +48,7 @@ interface ProductPricing {
44
48
  trialDaysLimit: number;
45
49
  }
46
50
 
47
- declare function CheckoutButton({ productSlug, licenseType, customerEmail, serverUrl, className, children, onCheckoutStart, onError, }: CheckoutButtonProps): react_jsx_runtime.JSX.Element;
51
+ declare function CheckoutButton({ productSlug, licenseType, customerEmail, customerName, serverUrl, className, children, onCheckoutStart, onError, }: CheckoutButtonProps): react_jsx_runtime.JSX.Element;
48
52
 
49
53
  interface UseCheckoutReturn {
50
54
  /** Start the checkout process */
package/dist/index.d.ts CHANGED
@@ -12,6 +12,10 @@ 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;
17
+ /** Skip trial period and charge immediately (default: false) */
18
+ skipTrial?: boolean;
15
19
  }
16
20
  interface CheckoutButtonProps extends StartCheckoutParams {
17
21
  /** Base URL of the license server */
@@ -44,7 +48,7 @@ interface ProductPricing {
44
48
  trialDaysLimit: number;
45
49
  }
46
50
 
47
- declare function CheckoutButton({ productSlug, licenseType, customerEmail, serverUrl, className, children, onCheckoutStart, onError, }: CheckoutButtonProps): react_jsx_runtime.JSX.Element;
51
+ declare function CheckoutButton({ productSlug, licenseType, customerEmail, customerName, serverUrl, className, children, onCheckoutStart, onError, }: CheckoutButtonProps): react_jsx_runtime.JSX.Element;
48
52
 
49
53
  interface UseCheckoutReturn {
50
54
  /** Start the checkout process */
package/dist/index.js CHANGED
@@ -46,7 +46,9 @@ 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,
51
+ skipTrial: params.skipTrial
50
52
  })
51
53
  });
52
54
  const data = await response.json();
@@ -83,6 +85,7 @@ function CheckoutButton({
83
85
  productSlug,
84
86
  licenseType,
85
87
  customerEmail,
88
+ customerName,
86
89
  serverUrl,
87
90
  className,
88
91
  children = "Buy Now",
@@ -96,7 +99,8 @@ function CheckoutButton({
96
99
  await startCheckout({
97
100
  productSlug,
98
101
  licenseType,
99
- customerEmail
102
+ customerEmail,
103
+ customerName
100
104
  });
101
105
  } catch (err) {
102
106
  const message = err instanceof Error ? err.message : "Checkout failed";
package/dist/index.mjs CHANGED
@@ -18,7 +18,9 @@ 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,
23
+ skipTrial: params.skipTrial
22
24
  })
23
25
  });
24
26
  const data = await response.json();
@@ -55,6 +57,7 @@ function CheckoutButton({
55
57
  productSlug,
56
58
  licenseType,
57
59
  customerEmail,
60
+ customerName,
58
61
  serverUrl,
59
62
  className,
60
63
  children = "Buy Now",
@@ -68,7 +71,8 @@ function CheckoutButton({
68
71
  await startCheckout({
69
72
  productSlug,
70
73
  licenseType,
71
- customerEmail
74
+ customerEmail,
75
+ customerName
72
76
  });
73
77
  } catch (err) {
74
78
  const message = err instanceof Error ? err.message : "Checkout failed";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sintecinformatik/checkout",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Checkout components for Sintec License Server",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",