@betterstore/react 0.2.6 → 0.2.10

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,29 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.2.10
4
+
5
+ ### Patch Changes
6
+
7
+ - prep commit
8
+
9
+ ## 0.2.9
10
+
11
+ ### Patch Changes
12
+
13
+ - cicd test
14
+
15
+ ## 0.2.8
16
+
17
+ ### Patch Changes
18
+
19
+ - bug fix, tailwind bug
20
+
21
+ ## 0.2.7
22
+
23
+ ### Patch Changes
24
+
25
+ - bug fixes
26
+
3
27
  ## 0.2.6
4
28
 
5
29
  ### Patch Changes
@@ -43,22 +43,6 @@ export declare const shippingMethodSchema: z.ZodObject<{
43
43
  }, {
44
44
  method: "economy" | "standard";
45
45
  }>;
46
- export declare const paymentMethodSchema: z.ZodObject<{
47
- cardNumber: z.ZodString;
48
- expiryDate: z.ZodString;
49
- cvv: z.ZodString;
50
- nameOnCard: z.ZodString;
51
- }, "strip", z.ZodTypeAny, {
52
- cardNumber: string;
53
- expiryDate: string;
54
- cvv: string;
55
- nameOnCard: string;
56
- }, {
57
- cardNumber: string;
58
- expiryDate: string;
59
- cvv: string;
60
- nameOnCard: string;
61
- }>;
62
46
  export declare const checkoutSchema: z.ZodObject<{
63
47
  customer: z.ZodObject<{
64
48
  email: z.ZodString;
@@ -104,22 +88,6 @@ export declare const checkoutSchema: z.ZodObject<{
104
88
  }, {
105
89
  method: "economy" | "standard";
106
90
  }>;
107
- payment: z.ZodObject<{
108
- cardNumber: z.ZodString;
109
- expiryDate: z.ZodString;
110
- cvv: z.ZodString;
111
- nameOnCard: z.ZodString;
112
- }, "strip", z.ZodTypeAny, {
113
- cardNumber: string;
114
- expiryDate: string;
115
- cvv: string;
116
- nameOnCard: string;
117
- }, {
118
- cardNumber: string;
119
- expiryDate: string;
120
- cvv: string;
121
- nameOnCard: string;
122
- }>;
123
91
  }, "strip", z.ZodTypeAny, {
124
92
  customer: {
125
93
  email: string;
@@ -137,12 +105,6 @@ export declare const checkoutSchema: z.ZodObject<{
137
105
  shipping: {
138
106
  method: "economy" | "standard";
139
107
  };
140
- payment: {
141
- cardNumber: string;
142
- expiryDate: string;
143
- cvv: string;
144
- nameOnCard: string;
145
- };
146
108
  }, {
147
109
  customer: {
148
110
  email: string;
@@ -160,14 +122,7 @@ export declare const checkoutSchema: z.ZodObject<{
160
122
  shipping: {
161
123
  method: "economy" | "standard";
162
124
  };
163
- payment: {
164
- cardNumber: string;
165
- expiryDate: string;
166
- cvv: string;
167
- nameOnCard: string;
168
- };
169
125
  }>;
170
126
  export type CheckoutFormData = z.infer<typeof checkoutSchema>;
171
127
  export type CustomerFormData = z.infer<typeof customerSchema>;
172
128
  export type ShippingMethodFormData = z.infer<typeof shippingMethodSchema>;
173
- export type PaymentMethodFormData = z.infer<typeof paymentMethodSchema>;
@@ -1,8 +1,16 @@
1
+ import BetterStore from "@betterstore/sdk";
1
2
  import React from "react";
2
- declare function CheckoutEmbed({ checkoutId, cancelUrl, successUrl, }: {
3
+ type BetterStoreClient = () => {
4
+ retrieveCheckout: InstanceType<typeof BetterStore>["checkout"]["retrieve"];
5
+ updateCheckout: InstanceType<typeof BetterStore>["checkout"]["update"];
6
+ getShippingRates: InstanceType<typeof BetterStore>["checkout"]["getShippingRates"];
7
+ };
8
+ interface CheckoutEmbedProps {
3
9
  checkoutId: string;
4
10
  cancelUrl: string;
5
11
  successUrl: string;
6
- }): React.JSX.Element;
12
+ client: BetterStoreClient;
13
+ }
14
+ declare function CheckoutEmbed({ checkoutId, cancelUrl, successUrl, client, }: CheckoutEmbedProps): React.JSX.Element;
7
15
  declare const _default: React.MemoExoticComponent<typeof CheckoutEmbed>;
8
16
  export default _default;
@@ -1,13 +1,12 @@
1
1
  import React from "react";
2
- import { type PaymentMethodFormData } from "../checkout-schema";
3
2
  interface PaymentFormProps {
4
- initialData?: PaymentMethodFormData;
5
- onSubmit: (data: PaymentMethodFormData) => void;
3
+ paymentSecret: string | null;
4
+ onSubmit: (data: any) => void;
6
5
  onBack: () => void;
7
6
  contactEmail: string;
8
7
  shippingAddress: string;
9
8
  shippingMethod: string;
10
9
  shippingPrice: string;
11
10
  }
12
- export default function PaymentForm({ initialData, onSubmit, onBack, contactEmail, shippingAddress, shippingMethod, shippingPrice, }: PaymentFormProps): React.JSX.Element;
11
+ export default function PaymentForm({ paymentSecret, onSubmit, onBack, contactEmail, shippingAddress, shippingMethod, shippingPrice, }: PaymentFormProps): React.JSX.Element;
13
12
  export {};