@getopenpay/openpay-js-react 0.0.14 → 0.0.16-alpha.a071c74
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.ts +31 -16
- package/dist/index.js +1197 -1082
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,22 @@ declare const AllFieldNames: z.ZodUnion<[z.ZodNativeEnum<typeof FieldName>, z.Zo
|
|
|
5
5
|
|
|
6
6
|
declare type AllFieldNames = z.infer<typeof AllFieldNames>;
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Payment requests
|
|
10
|
+
*/
|
|
11
|
+
declare const Amount: z.ZodObject<{
|
|
12
|
+
amountAtom: z.ZodNumber;
|
|
13
|
+
currency: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
currency: string;
|
|
16
|
+
amountAtom: number;
|
|
17
|
+
}, {
|
|
18
|
+
currency: string;
|
|
19
|
+
amountAtom: number;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
declare type Amount = z.infer<typeof Amount>;
|
|
23
|
+
|
|
8
24
|
export declare const CardCvcElement: FC<ElementProps>;
|
|
9
25
|
|
|
10
26
|
export declare const CardElement: FC<ElementProps<typeof CardPlaceholder>>;
|
|
@@ -29,6 +45,12 @@ declare const CardPlaceholder: z.ZodObject<{
|
|
|
29
45
|
|
|
30
46
|
declare type CardPlaceholder = z.infer<typeof CardPlaceholder>;
|
|
31
47
|
|
|
48
|
+
declare type DynamicPreview = {
|
|
49
|
+
amount: Amount | null;
|
|
50
|
+
isLoading: boolean;
|
|
51
|
+
error: string | null;
|
|
52
|
+
};
|
|
53
|
+
|
|
32
54
|
export declare type ElementProps<PlaceholderType extends z.ZodTypeAny = z.ZodString> = {
|
|
33
55
|
styles?: ElementsStyle<z.ZodOptional<PlaceholderType>>;
|
|
34
56
|
};
|
|
@@ -49,6 +71,7 @@ declare type ElementsFormChildrenProps = {
|
|
|
49
71
|
applePay: PaymentRequestStatus;
|
|
50
72
|
googlePay: PaymentRequestStatus;
|
|
51
73
|
loaded: boolean;
|
|
74
|
+
preview: DynamicPreview;
|
|
52
75
|
};
|
|
53
76
|
|
|
54
77
|
export declare type ElementsFormProps = {
|
|
@@ -66,6 +89,7 @@ export declare type ElementsFormProps = {
|
|
|
66
89
|
onSetupPaymentMethodSuccess?: (paymentMethodId: string) => void;
|
|
67
90
|
onCheckoutError?: (message: string) => void;
|
|
68
91
|
baseUrl?: string;
|
|
92
|
+
enableDynamicPreviews?: boolean;
|
|
69
93
|
};
|
|
70
94
|
|
|
71
95
|
declare const ElementsStyle: <T extends z.ZodTypeAny>(placeholderType: T) => z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -138,24 +162,15 @@ export declare enum FieldName {
|
|
|
138
162
|
PROMOTION_CODE = "promotionCode"
|
|
139
163
|
}
|
|
140
164
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
isAvailable: z.ZodBoolean;
|
|
147
|
-
startFlow: z.ZodFunction<z.ZodTuple<[], null>, z.ZodVoid>;
|
|
148
|
-
}, "strip", z.ZodTypeAny, {
|
|
149
|
-
isLoading: boolean;
|
|
150
|
-
isAvailable: boolean;
|
|
151
|
-
startFlow: () => void;
|
|
152
|
-
}, {
|
|
165
|
+
declare type PaymentRequestStartParams = {
|
|
166
|
+
overridePaymentRequestAmount?: Amount;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
declare type PaymentRequestStatus = {
|
|
153
170
|
isLoading: boolean;
|
|
154
171
|
isAvailable: boolean;
|
|
155
|
-
startFlow: () => void
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
declare type PaymentRequestStatus = z.infer<typeof PaymentRequestStatus>;
|
|
172
|
+
startFlow: (params?: PaymentRequestStartParams) => Promise<void>;
|
|
173
|
+
};
|
|
159
174
|
|
|
160
175
|
declare enum PrivateFieldName {
|
|
161
176
|
CARD_NUMBER = "cardNumber",
|