@getopenpay/openpay-js 0.1.1-alpha.2 → 0.1.1-alpha.3

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 CHANGED
@@ -1,17 +1,23 @@
1
1
  import { PaymentRequestPaymentMethodEvent } from '@stripe/stripe-js';
2
2
  import { z } from 'zod';
3
3
 
4
- declare const AllFieldNames = z.union([FieldNameEnum, PrivateFieldNameEnum]);
4
+ declare const AllFieldNames: z.ZodUnion<[z.ZodNativeEnum<typeof FieldName>, z.ZodNativeEnum<typeof PrivateFieldName>]>;
5
5
 
6
6
  declare type AllFieldNames = z.infer<typeof AllFieldNames>;
7
7
 
8
8
  /**
9
9
  * Payment requests
10
10
  */
11
- declare const Amount = z.object({
12
- amountAtom: z.number(),
13
- currency: RequiredString,
14
- });
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
+ }>;
15
21
 
16
22
  declare type Amount = z.infer<typeof Amount>;
17
23
 
@@ -26,11 +32,19 @@ declare type CdeMessage = {
26
32
  /**
27
33
  * Core models
28
34
  */
29
- declare const CheckoutPaymentMethod = z.object({
30
- provider: z.string(),
31
- processor_name: nullOrUndefOr(z.string()),
32
- metadata: nullOrUndefOr(z.record(z.string(), z.any())),
33
- });
35
+ declare const CheckoutPaymentMethod: z.ZodObject<{
36
+ provider: z.ZodString;
37
+ processor_name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
38
+ metadata: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ provider: string;
41
+ processor_name?: string | null | undefined;
42
+ metadata?: Record<string, any> | null | undefined;
43
+ }, {
44
+ provider: string;
45
+ processor_name?: string | null | undefined;
46
+ metadata?: Record<string, any> | null | undefined;
47
+ }>;
34
48
 
35
49
  declare type CheckoutPaymentMethod = z.infer<typeof CheckoutPaymentMethod>;
36
50
 
@@ -74,10 +88,57 @@ declare type ElementsFormProps = {
74
88
  baseUrl?: string;
75
89
  };
76
90
 
77
- declare const ElementsStyle = <T extends z.ZodTypeAny>(placeholderType: T) =>
78
- BaseElementsStyle.extend({
79
- placeholder: placeholderType,
80
- });
91
+ declare const ElementsStyle: <T extends z.ZodTypeAny>(placeholderType: T) => z.ZodObject<z.objectUtil.extendShape<{
92
+ backgroundColor: z.ZodOptional<z.ZodString>;
93
+ color: z.ZodOptional<z.ZodString>;
94
+ fontFamily: z.ZodOptional<z.ZodString>;
95
+ fontSize: z.ZodOptional<z.ZodString>;
96
+ fontWeight: z.ZodOptional<z.ZodString>;
97
+ margin: z.ZodOptional<z.ZodString>;
98
+ padding: z.ZodOptional<z.ZodString>;
99
+ }, {
100
+ placeholder: T;
101
+ }>, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
102
+ backgroundColor: z.ZodOptional<z.ZodString>;
103
+ color: z.ZodOptional<z.ZodString>;
104
+ fontFamily: z.ZodOptional<z.ZodString>;
105
+ fontSize: z.ZodOptional<z.ZodString>;
106
+ fontWeight: z.ZodOptional<z.ZodString>;
107
+ margin: z.ZodOptional<z.ZodString>;
108
+ padding: z.ZodOptional<z.ZodString>;
109
+ }, {
110
+ placeholder: T;
111
+ }>>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<z.objectUtil.extendShape<{
112
+ backgroundColor: z.ZodOptional<z.ZodString>;
113
+ color: z.ZodOptional<z.ZodString>;
114
+ fontFamily: z.ZodOptional<z.ZodString>;
115
+ fontSize: z.ZodOptional<z.ZodString>;
116
+ fontWeight: z.ZodOptional<z.ZodString>;
117
+ margin: z.ZodOptional<z.ZodString>;
118
+ padding: z.ZodOptional<z.ZodString>;
119
+ }, {
120
+ placeholder: T;
121
+ }>>, any>[k]; } : never, z.baseObjectInputType<z.objectUtil.extendShape<{
122
+ backgroundColor: z.ZodOptional<z.ZodString>;
123
+ color: z.ZodOptional<z.ZodString>;
124
+ fontFamily: z.ZodOptional<z.ZodString>;
125
+ fontSize: z.ZodOptional<z.ZodString>;
126
+ fontWeight: z.ZodOptional<z.ZodString>;
127
+ margin: z.ZodOptional<z.ZodString>;
128
+ padding: z.ZodOptional<z.ZodString>;
129
+ }, {
130
+ placeholder: T;
131
+ }>> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<z.objectUtil.extendShape<{
132
+ backgroundColor: z.ZodOptional<z.ZodString>;
133
+ color: z.ZodOptional<z.ZodString>;
134
+ fontFamily: z.ZodOptional<z.ZodString>;
135
+ fontSize: z.ZodOptional<z.ZodString>;
136
+ fontWeight: z.ZodOptional<z.ZodString>;
137
+ margin: z.ZodOptional<z.ZodString>;
138
+ padding: z.ZodOptional<z.ZodString>;
139
+ }, {
140
+ placeholder: T;
141
+ }>>[k_1]; } : never>;
81
142
 
82
143
  declare type ElementsStyle<T extends z.ZodTypeAny> = z.infer<ReturnType<typeof ElementsStyle<T>>>;
83
144
 
@@ -86,19 +147,17 @@ export declare type ElementType = 'card' | 'card-number' | 'card-expiry' | 'card
86
147
  /**
87
148
  * Expected input fields
88
149
  */
89
-
90
- // Supplied by the user
91
150
  export declare enum FieldName {
92
- FIRST_NAME = 'firstName',
93
- LAST_NAME = 'lastName',
94
- EMAIL = 'email',
95
- ZIP_CODE = 'zipCode',
96
- CITY = 'city',
97
- STATE = 'state',
98
- COUNTRY = 'country',
99
- ADDRESS = 'address',
100
- PHONE = 'phone',
101
- PROMOTION_CODE = 'promotionCode',
151
+ FIRST_NAME = "firstName",
152
+ LAST_NAME = "lastName",
153
+ EMAIL = "email",
154
+ ZIP_CODE = "zipCode",
155
+ CITY = "city",
156
+ STATE = "state",
157
+ COUNTRY = "country",
158
+ ADDRESS = "address",
159
+ PHONE = "phone",
160
+ PROMOTION_CODE = "promotionCode"
102
161
  }
103
162
 
104
163
  export declare class OpenPayForm {
@@ -144,4 +203,10 @@ declare type PaymentRequestStatus = {
144
203
  startFlow: (params?: PaymentRequestStartParams) => Promise<void>;
145
204
  };
146
205
 
206
+ declare enum PrivateFieldName {
207
+ CARD_NUMBER = "cardNumber",
208
+ CARD_EXPIRY = "cardExpiry",
209
+ CARD_CVC = "cardCvc"
210
+ }
211
+
147
212
  export { }