@betterstore/react 0.3.4 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.6
4
+
5
+ ### Patch Changes
6
+
7
+ - bug fix
8
+
9
+ ## 0.3.5
10
+
11
+ ### Patch Changes
12
+
13
+ - discounts added
14
+
3
15
  ## 0.3.4
4
16
 
5
17
  ### Patch Changes
@@ -16,6 +16,7 @@ interface CheckoutFormProps {
16
16
  locale?: StripeElementLocale;
17
17
  setShippingCost: (cost: number) => void;
18
18
  exchangeRate: number;
19
+ setCheckout: (checkout: any) => void;
19
20
  }
20
- export default function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, }: CheckoutFormProps): React.JSX.Element;
21
+ export default function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, setCheckout, }: CheckoutFormProps): React.JSX.Element;
21
22
  export {};
@@ -31,9 +31,6 @@ export declare const customerSchema: z.ZodObject<{
31
31
  saveInfo: z.ZodOptional<z.ZodBoolean>;
32
32
  phone: z.ZodString;
33
33
  }, "strip", z.ZodTypeAny, {
34
- email: string;
35
- firstName: string;
36
- lastName: string;
37
34
  address: {
38
35
  line1: string;
39
36
  city: string;
@@ -43,12 +40,12 @@ export declare const customerSchema: z.ZodObject<{
43
40
  line2?: string | undefined;
44
41
  state?: string | undefined;
45
42
  };
46
- phone: string;
47
- saveInfo?: boolean | undefined;
48
- }, {
49
43
  email: string;
50
44
  firstName: string;
51
45
  lastName: string;
46
+ phone: string;
47
+ saveInfo?: boolean | undefined;
48
+ }, {
52
49
  address: {
53
50
  line1: string;
54
51
  city: string;
@@ -58,6 +55,9 @@ export declare const customerSchema: z.ZodObject<{
58
55
  line2?: string | undefined;
59
56
  state?: string | undefined;
60
57
  };
58
+ email: string;
59
+ firstName: string;
60
+ lastName: string;
61
61
  phone: string;
62
62
  saveInfo?: boolean | undefined;
63
63
  }>;
@@ -116,9 +116,6 @@ export declare const checkoutSchema: z.ZodObject<{
116
116
  saveInfo: z.ZodOptional<z.ZodBoolean>;
117
117
  phone: z.ZodString;
118
118
  }, "strip", z.ZodTypeAny, {
119
- email: string;
120
- firstName: string;
121
- lastName: string;
122
119
  address: {
123
120
  line1: string;
124
121
  city: string;
@@ -128,12 +125,12 @@ export declare const checkoutSchema: z.ZodObject<{
128
125
  line2?: string | undefined;
129
126
  state?: string | undefined;
130
127
  };
131
- phone: string;
132
- saveInfo?: boolean | undefined;
133
- }, {
134
128
  email: string;
135
129
  firstName: string;
136
130
  lastName: string;
131
+ phone: string;
132
+ saveInfo?: boolean | undefined;
133
+ }, {
137
134
  address: {
138
135
  line1: string;
139
136
  city: string;
@@ -143,6 +140,9 @@ export declare const checkoutSchema: z.ZodObject<{
143
140
  line2?: string | undefined;
144
141
  state?: string | undefined;
145
142
  };
143
+ email: string;
144
+ firstName: string;
145
+ lastName: string;
146
146
  phone: string;
147
147
  saveInfo?: boolean | undefined;
148
148
  }>;
@@ -171,9 +171,6 @@ export declare const checkoutSchema: z.ZodObject<{
171
171
  customerId: z.ZodOptional<z.ZodString>;
172
172
  }, "strip", z.ZodTypeAny, {
173
173
  customer: {
174
- email: string;
175
- firstName: string;
176
- lastName: string;
177
174
  address: {
178
175
  line1: string;
179
176
  city: string;
@@ -183,6 +180,9 @@ export declare const checkoutSchema: z.ZodObject<{
183
180
  line2?: string | undefined;
184
181
  state?: string | undefined;
185
182
  };
183
+ email: string;
184
+ firstName: string;
185
+ lastName: string;
186
186
  phone: string;
187
187
  saveInfo?: boolean | undefined;
188
188
  };
@@ -197,9 +197,6 @@ export declare const checkoutSchema: z.ZodObject<{
197
197
  customerId?: string | undefined;
198
198
  }, {
199
199
  customer: {
200
- email: string;
201
- firstName: string;
202
- lastName: string;
203
200
  address: {
204
201
  line1: string;
205
202
  city: string;
@@ -209,6 +206,9 @@ export declare const checkoutSchema: z.ZodObject<{
209
206
  line2?: string | undefined;
210
207
  state?: string | undefined;
211
208
  };
209
+ email: string;
210
+ firstName: string;
211
+ lastName: string;
212
212
  phone: string;
213
213
  saveInfo?: boolean | undefined;
214
214
  };
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export default function DiscountCode({ applyDiscountCode, revalidateDiscounts, }: {
3
+ applyDiscountCode: (code: string) => Promise<void>;
4
+ revalidateDiscounts: () => Promise<void>;
5
+ }): React.JSX.Element;
@@ -1,10 +1,14 @@
1
- import { LineItem } from "@betterstore/sdk";
1
+ import { CheckoutSession, LineItem } from "@betterstore/sdk";
2
2
  import React from "react";
3
- export default function CheckoutSummary({ lineItems, shipping, tax, currency, onCancel, exchangeRate, }: {
3
+ export default function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency, onCancel, exchangeRate, applyDiscountCode, revalidateDiscounts, removeDiscount, }: {
4
+ appliedDiscounts: CheckoutSession["appliedDiscounts"];
4
5
  lineItems: LineItem[];
5
- shipping?: number;
6
- tax?: number;
6
+ shipping?: number | null;
7
+ tax?: number | null;
7
8
  currency: string;
8
9
  exchangeRate: number;
9
10
  onCancel: () => void;
11
+ applyDiscountCode: (code: string) => Promise<void>;
12
+ revalidateDiscounts: () => Promise<void>;
13
+ removeDiscount: (id: string) => Promise<void>;
10
14
  }): React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ToasterProps } from "sonner";
3
+ declare const Toaster: ({ ...props }: ToasterProps) => React.JSX.Element;
4
+ export { Toaster };