@yuno-payments/sdk-web-types 1.0.0 → 1.0.2
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/README.md +11 -0
- package/dist/index.d.ts +321 -0
- package/dist/types.ts +321 -0
- package/package.json +4 -1
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## Include Type in tsconfig.js
|
|
2
|
+
```bash
|
|
3
|
+
"types": ["@yuno-payments/sdk-web-types"]
|
|
4
|
+
```
|
|
5
|
+
|
|
6
|
+
## how to use types in your code
|
|
7
|
+
```typescript
|
|
8
|
+
import { YunoInstance } from '@yuno-payments/sdk-web-types/dist/types'
|
|
9
|
+
|
|
10
|
+
const yunoInstance: YunoInstance = Yuno.initialize('publickAPikey')
|
|
11
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
interface Customer {
|
|
2
|
+
first_name: string;
|
|
3
|
+
last_name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
gender?: string;
|
|
6
|
+
device_fingerprint?: string | null;
|
|
7
|
+
third_party_session_id?: string | null;
|
|
8
|
+
document: {
|
|
9
|
+
document_number: string;
|
|
10
|
+
document_type: string;
|
|
11
|
+
};
|
|
12
|
+
phone: {
|
|
13
|
+
country_code: string;
|
|
14
|
+
number: string;
|
|
15
|
+
};
|
|
16
|
+
billing_address: {
|
|
17
|
+
address_line_1: string;
|
|
18
|
+
address_line_2: string;
|
|
19
|
+
city: string;
|
|
20
|
+
country: string;
|
|
21
|
+
state: string;
|
|
22
|
+
zip_code: string;
|
|
23
|
+
};
|
|
24
|
+
shipping_address: {
|
|
25
|
+
address_line_1: string;
|
|
26
|
+
address_line_2: string;
|
|
27
|
+
country: string;
|
|
28
|
+
state: string;
|
|
29
|
+
city: string;
|
|
30
|
+
zip_code: string;
|
|
31
|
+
};
|
|
32
|
+
browser_info?: Partial<{
|
|
33
|
+
accept_browser: string | null;
|
|
34
|
+
accept_content: string | null;
|
|
35
|
+
accept_header: string | null;
|
|
36
|
+
color_depth: string | null;
|
|
37
|
+
javascript_enabled: boolean | null;
|
|
38
|
+
language: string | null;
|
|
39
|
+
screen_height: string | null;
|
|
40
|
+
screen_width: string | null;
|
|
41
|
+
user_agent: string | null;
|
|
42
|
+
java_enabled: boolean | null;
|
|
43
|
+
browser_time_difference: string | null;
|
|
44
|
+
}>;
|
|
45
|
+
merchant_customer_id?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type Status = 'FAIL' | 'REJECT' | 'SUCCEEDED' | 'PROCESSING' | 'READY';
|
|
49
|
+
type EnrollmentStatus = 'CREATED' | 'EXPIRED' | 'REJECTED' | 'READY_TO_ENROLL' | 'ENROLL_IN_PROCESS' | 'UNENROLL_IN_PROCESS' | 'ENROLLED' | 'DECLINED' | 'CANCELED' | 'ERROR' | 'UNENROLLED';
|
|
50
|
+
|
|
51
|
+
type Name = 'cvv' | 'pan' | 'expiration';
|
|
52
|
+
type Installment = {
|
|
53
|
+
installmentId: string;
|
|
54
|
+
installment: number;
|
|
55
|
+
amount: {
|
|
56
|
+
currency: string;
|
|
57
|
+
value: string;
|
|
58
|
+
total_value: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
interface CardIINResponse {
|
|
62
|
+
id: string;
|
|
63
|
+
iin: string;
|
|
64
|
+
scheme: string;
|
|
65
|
+
issuer_name: string;
|
|
66
|
+
issuer_code: string;
|
|
67
|
+
brand: string;
|
|
68
|
+
type: string;
|
|
69
|
+
category: string;
|
|
70
|
+
country_code: string;
|
|
71
|
+
country_name: string;
|
|
72
|
+
website: string;
|
|
73
|
+
phone: {
|
|
74
|
+
country_code: string;
|
|
75
|
+
number: string;
|
|
76
|
+
};
|
|
77
|
+
address: {
|
|
78
|
+
address_line_1: string;
|
|
79
|
+
address_line_2: string | null;
|
|
80
|
+
city: string;
|
|
81
|
+
country: string;
|
|
82
|
+
state: string;
|
|
83
|
+
zip_code: string;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
type OnChangeArgs = {
|
|
87
|
+
error: boolean;
|
|
88
|
+
data?: {
|
|
89
|
+
installments?: Installment[];
|
|
90
|
+
cardIIN?: CardIINResponse;
|
|
91
|
+
isCardIINLoading: boolean;
|
|
92
|
+
isInstallmentLoading: boolean;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
type Create = {
|
|
96
|
+
name: Name;
|
|
97
|
+
options: {
|
|
98
|
+
label?: string;
|
|
99
|
+
showError?: boolean;
|
|
100
|
+
onChange?(onChangeArgs: OnChangeArgs): void;
|
|
101
|
+
onBlur?(): void;
|
|
102
|
+
onFocus?(): void;
|
|
103
|
+
styles?: string;
|
|
104
|
+
placeholder: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
type GetElement = {
|
|
108
|
+
name: Name;
|
|
109
|
+
};
|
|
110
|
+
interface GenerateTokenArgs {
|
|
111
|
+
checkoutSession?: string;
|
|
112
|
+
cardHolderName: string;
|
|
113
|
+
saveCard?: boolean;
|
|
114
|
+
customer?: Partial<Customer>;
|
|
115
|
+
installment?: {
|
|
116
|
+
id: string;
|
|
117
|
+
value: number;
|
|
118
|
+
amount?: {
|
|
119
|
+
currency: string;
|
|
120
|
+
value: string;
|
|
121
|
+
total_value: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
cardType?: string;
|
|
125
|
+
}
|
|
126
|
+
interface GenerateVaultedToken {
|
|
127
|
+
cardHolderName: string;
|
|
128
|
+
customer?: Partial<Customer>;
|
|
129
|
+
}
|
|
130
|
+
interface OneTimeToken {
|
|
131
|
+
token: string;
|
|
132
|
+
vaulted_token: string | null;
|
|
133
|
+
vault_on_success: boolean;
|
|
134
|
+
type: string;
|
|
135
|
+
card_data?: {
|
|
136
|
+
holder_name: string;
|
|
137
|
+
iin: string;
|
|
138
|
+
lfd: string;
|
|
139
|
+
number_length: number;
|
|
140
|
+
security_code_length: number;
|
|
141
|
+
brand: string;
|
|
142
|
+
issuer_name: string;
|
|
143
|
+
issuer_code: string | null;
|
|
144
|
+
category: string | null;
|
|
145
|
+
type: string;
|
|
146
|
+
};
|
|
147
|
+
customer: Customer;
|
|
148
|
+
}
|
|
149
|
+
interface VaultedToken {
|
|
150
|
+
code: string;
|
|
151
|
+
idempotency_key: string;
|
|
152
|
+
organization_code: string;
|
|
153
|
+
account_code: string;
|
|
154
|
+
customer_session: string;
|
|
155
|
+
name: string;
|
|
156
|
+
description: string;
|
|
157
|
+
status: Status;
|
|
158
|
+
type: string;
|
|
159
|
+
category: string;
|
|
160
|
+
provider: {
|
|
161
|
+
type: string;
|
|
162
|
+
action: string;
|
|
163
|
+
token: string;
|
|
164
|
+
enrollment_id: string | null;
|
|
165
|
+
provider_status: string | null;
|
|
166
|
+
redirect: string | null;
|
|
167
|
+
raw_response: unknown;
|
|
168
|
+
};
|
|
169
|
+
created_at: Date;
|
|
170
|
+
updated_at: Date;
|
|
171
|
+
}
|
|
172
|
+
type CardType = 'CREDIT' | 'DEBIT';
|
|
173
|
+
interface SecureField {
|
|
174
|
+
render(elementSelector: string): Promise<void>;
|
|
175
|
+
focus(): void;
|
|
176
|
+
validate(): void;
|
|
177
|
+
unmountSync(): void;
|
|
178
|
+
clearValue(): void;
|
|
179
|
+
setError(errorMessage: string): void;
|
|
180
|
+
setCardType(cardType: CardType): void;
|
|
181
|
+
}
|
|
182
|
+
interface SecureFields {
|
|
183
|
+
create({ name, options }: Create): SecureField;
|
|
184
|
+
getElement({ name }: GetElement): SecureField;
|
|
185
|
+
generateToken(params: GenerateTokenArgs): Promise<string>;
|
|
186
|
+
generateTokenWithInformation(params: GenerateTokenArgs): Promise<OneTimeToken>;
|
|
187
|
+
generateVaultedToken(params: GenerateVaultedToken): Promise<string>;
|
|
188
|
+
generateVaultedTokenWithInformation(params: GenerateVaultedToken): Promise<VaultedToken>;
|
|
189
|
+
unmountSync(): void;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
interface ButtonTextCard {
|
|
193
|
+
cardForm?: {
|
|
194
|
+
enrollmentSubmitButton?: string;
|
|
195
|
+
paymentSubmitButton?: string;
|
|
196
|
+
};
|
|
197
|
+
cardStepper?: {
|
|
198
|
+
numberCardStep?: {
|
|
199
|
+
nextButton?: string;
|
|
200
|
+
};
|
|
201
|
+
cardHolderNameStep?: {
|
|
202
|
+
prevButton?: string;
|
|
203
|
+
nextButton?: string;
|
|
204
|
+
};
|
|
205
|
+
expirationDateStep?: {
|
|
206
|
+
prevButton?: string;
|
|
207
|
+
nextButton?: string;
|
|
208
|
+
};
|
|
209
|
+
cvvStep?: {
|
|
210
|
+
prevButton?: string;
|
|
211
|
+
nextButton?: string;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
interface TextsCustom {
|
|
216
|
+
customerForm?: {
|
|
217
|
+
submitButton?: string;
|
|
218
|
+
};
|
|
219
|
+
paymentOtp?: {
|
|
220
|
+
sendOtpButton?: string;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
interface CardConfig {
|
|
224
|
+
styles?: string;
|
|
225
|
+
type?: 'extends' | 'step';
|
|
226
|
+
cardSaveEnable?: boolean;
|
|
227
|
+
texts?: ButtonTextCard;
|
|
228
|
+
documentEnable?: boolean;
|
|
229
|
+
}
|
|
230
|
+
interface RenderMode {
|
|
231
|
+
type: 'modal' | 'element';
|
|
232
|
+
elementSelector?: string;
|
|
233
|
+
}
|
|
234
|
+
declare enum ExternalPaymentButtonsTypes {
|
|
235
|
+
PAYPAL = "paypal"
|
|
236
|
+
}
|
|
237
|
+
type ExternalPaymentButtons = {
|
|
238
|
+
[key in ExternalPaymentButtonsTypes]: {
|
|
239
|
+
elementSelector: string;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
type LoadingType = 'DOCUMENT' | 'ONE_TIME_TOKEN';
|
|
243
|
+
type Language = 'es' | 'en' | 'pt';
|
|
244
|
+
interface YunoConfig {
|
|
245
|
+
publicApiKey: string;
|
|
246
|
+
checkoutSession: string;
|
|
247
|
+
customerSession: string;
|
|
248
|
+
language: Language;
|
|
249
|
+
countryCode: string;
|
|
250
|
+
elementSelector?: string;
|
|
251
|
+
vaultedToken?: string;
|
|
252
|
+
type?: string;
|
|
253
|
+
renderMode?: RenderMode;
|
|
254
|
+
externalPaymentButtons?: ExternalPaymentButtons;
|
|
255
|
+
card?: CardConfig;
|
|
256
|
+
showLoading?: boolean;
|
|
257
|
+
texts?: TextsCustom;
|
|
258
|
+
issuersFormEnable?: boolean;
|
|
259
|
+
automaticallyUnmount?: boolean;
|
|
260
|
+
cardFormUnfoldedEnable?: boolean;
|
|
261
|
+
isDynamicViewEnabled?: boolean;
|
|
262
|
+
showOnlyThesePaymentMethods?: string[];
|
|
263
|
+
yunoCreatePayment?: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
|
|
264
|
+
yunoPaymentMethodSelected?: (arg: {
|
|
265
|
+
type: string;
|
|
266
|
+
name: string;
|
|
267
|
+
}) => void;
|
|
268
|
+
yunoPaymentResult?: (status: Status) => void;
|
|
269
|
+
yunoError?: (message: string) => void;
|
|
270
|
+
onRendered?(): void;
|
|
271
|
+
onOneTimeTokenCreationStart?(): void;
|
|
272
|
+
yunoEnrollmentStatus?(params: {
|
|
273
|
+
status: EnrollmentStatus;
|
|
274
|
+
vaultedToken?: string;
|
|
275
|
+
}): void;
|
|
276
|
+
/**
|
|
277
|
+
* @deprecated
|
|
278
|
+
*/
|
|
279
|
+
onLoading?(args: {
|
|
280
|
+
isLoading: boolean;
|
|
281
|
+
type: LoadingType;
|
|
282
|
+
}): void;
|
|
283
|
+
}
|
|
284
|
+
type StartCheckoutArgs = Omit<YunoConfig, 'yunoEnrollmentStatus' | 'customerSession' | 'publicApiKey'>;
|
|
285
|
+
type MountEnrollmentLiteArgs = Pick<YunoConfig, 'language' | 'countryCode' | 'renderMode' | 'yunoEnrollmentStatus' | 'yunoError' | 'showLoading' | 'onRendered' | 'onOneTimeTokenCreationStart' | 'onLoading'>;
|
|
286
|
+
type mountFraudArgs = Pick<YunoConfig, 'yunoCreatePayment' | 'yunoError' | 'language' | 'checkoutSession'>;
|
|
287
|
+
interface MountCheckoutArgs {
|
|
288
|
+
paymentMethodType?: string;
|
|
289
|
+
vaultedToken?: string;
|
|
290
|
+
category?: string;
|
|
291
|
+
}
|
|
292
|
+
interface MountCheckoutLiteArgs {
|
|
293
|
+
paymentMethodType?: string;
|
|
294
|
+
vaultedToken?: string;
|
|
295
|
+
}
|
|
296
|
+
interface SecureFieldsArgs {
|
|
297
|
+
countryCode: string;
|
|
298
|
+
checkoutSession?: string;
|
|
299
|
+
installmentEnable?: boolean;
|
|
300
|
+
customerSession?: string;
|
|
301
|
+
}
|
|
302
|
+
interface YunoInstance {
|
|
303
|
+
startCheckout(args: StartCheckoutArgs): void;
|
|
304
|
+
mountCheckout(args: MountCheckoutArgs): void;
|
|
305
|
+
mountCheckoutLite(args: MountCheckoutLiteArgs): void;
|
|
306
|
+
updateCheckoutSession(checkout: string): void;
|
|
307
|
+
startPayment(): void;
|
|
308
|
+
continuePayment(): Promise<void>;
|
|
309
|
+
notifyError(): void;
|
|
310
|
+
mountEnrollmentLite(args: MountEnrollmentLiteArgs): void;
|
|
311
|
+
showLoader(): void;
|
|
312
|
+
hideLoader(): void;
|
|
313
|
+
updateCheckoutSession(checkoutSession: string): void;
|
|
314
|
+
mountFraud(args: mountFraudArgs): void;
|
|
315
|
+
secureFields({ countryCode, checkoutSession, installmentEnable, customerSession }: SecureFieldsArgs): SecureFields;
|
|
316
|
+
}
|
|
317
|
+
interface Yuno {
|
|
318
|
+
initialize(publicApiKey: string): YunoInstance;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
declare const Yuno: Yuno;
|
package/dist/types.ts
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
interface Customer {
|
|
2
|
+
first_name: string;
|
|
3
|
+
last_name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
gender?: string;
|
|
6
|
+
device_fingerprint?: string | null;
|
|
7
|
+
third_party_session_id?: string | null;
|
|
8
|
+
document: {
|
|
9
|
+
document_number: string;
|
|
10
|
+
document_type: string;
|
|
11
|
+
};
|
|
12
|
+
phone: {
|
|
13
|
+
country_code: string;
|
|
14
|
+
number: string;
|
|
15
|
+
};
|
|
16
|
+
billing_address: {
|
|
17
|
+
address_line_1: string;
|
|
18
|
+
address_line_2: string;
|
|
19
|
+
city: string;
|
|
20
|
+
country: string;
|
|
21
|
+
state: string;
|
|
22
|
+
zip_code: string;
|
|
23
|
+
};
|
|
24
|
+
shipping_address: {
|
|
25
|
+
address_line_1: string;
|
|
26
|
+
address_line_2: string;
|
|
27
|
+
country: string;
|
|
28
|
+
state: string;
|
|
29
|
+
city: string;
|
|
30
|
+
zip_code: string;
|
|
31
|
+
};
|
|
32
|
+
browser_info?: Partial<{
|
|
33
|
+
accept_browser: string | null;
|
|
34
|
+
accept_content: string | null;
|
|
35
|
+
accept_header: string | null;
|
|
36
|
+
color_depth: string | null;
|
|
37
|
+
javascript_enabled: boolean | null;
|
|
38
|
+
language: string | null;
|
|
39
|
+
screen_height: string | null;
|
|
40
|
+
screen_width: string | null;
|
|
41
|
+
user_agent: string | null;
|
|
42
|
+
java_enabled: boolean | null;
|
|
43
|
+
browser_time_difference: string | null;
|
|
44
|
+
}>;
|
|
45
|
+
merchant_customer_id?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type Status = 'FAIL' | 'REJECT' | 'SUCCEEDED' | 'PROCESSING' | 'READY';
|
|
49
|
+
type EnrollmentStatus = 'CREATED' | 'EXPIRED' | 'REJECTED' | 'READY_TO_ENROLL' | 'ENROLL_IN_PROCESS' | 'UNENROLL_IN_PROCESS' | 'ENROLLED' | 'DECLINED' | 'CANCELED' | 'ERROR' | 'UNENROLLED';
|
|
50
|
+
|
|
51
|
+
type Name = 'cvv' | 'pan' | 'expiration';
|
|
52
|
+
type Installment = {
|
|
53
|
+
installmentId: string;
|
|
54
|
+
installment: number;
|
|
55
|
+
amount: {
|
|
56
|
+
currency: string;
|
|
57
|
+
value: string;
|
|
58
|
+
total_value: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
interface CardIINResponse {
|
|
62
|
+
id: string;
|
|
63
|
+
iin: string;
|
|
64
|
+
scheme: string;
|
|
65
|
+
issuer_name: string;
|
|
66
|
+
issuer_code: string;
|
|
67
|
+
brand: string;
|
|
68
|
+
type: string;
|
|
69
|
+
category: string;
|
|
70
|
+
country_code: string;
|
|
71
|
+
country_name: string;
|
|
72
|
+
website: string;
|
|
73
|
+
phone: {
|
|
74
|
+
country_code: string;
|
|
75
|
+
number: string;
|
|
76
|
+
};
|
|
77
|
+
address: {
|
|
78
|
+
address_line_1: string;
|
|
79
|
+
address_line_2: string | null;
|
|
80
|
+
city: string;
|
|
81
|
+
country: string;
|
|
82
|
+
state: string;
|
|
83
|
+
zip_code: string;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
type OnChangeArgs = {
|
|
87
|
+
error: boolean;
|
|
88
|
+
data?: {
|
|
89
|
+
installments?: Installment[];
|
|
90
|
+
cardIIN?: CardIINResponse;
|
|
91
|
+
isCardIINLoading: boolean;
|
|
92
|
+
isInstallmentLoading: boolean;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
type Create = {
|
|
96
|
+
name: Name;
|
|
97
|
+
options: {
|
|
98
|
+
label?: string;
|
|
99
|
+
showError?: boolean;
|
|
100
|
+
onChange?(onChangeArgs: OnChangeArgs): void;
|
|
101
|
+
onBlur?(): void;
|
|
102
|
+
onFocus?(): void;
|
|
103
|
+
styles?: string;
|
|
104
|
+
placeholder: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
type GetElement = {
|
|
108
|
+
name: Name;
|
|
109
|
+
};
|
|
110
|
+
interface GenerateTokenArgs {
|
|
111
|
+
checkoutSession?: string;
|
|
112
|
+
cardHolderName: string;
|
|
113
|
+
saveCard?: boolean;
|
|
114
|
+
customer?: Partial<Customer>;
|
|
115
|
+
installment?: {
|
|
116
|
+
id: string;
|
|
117
|
+
value: number;
|
|
118
|
+
amount?: {
|
|
119
|
+
currency: string;
|
|
120
|
+
value: string;
|
|
121
|
+
total_value: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
cardType?: string;
|
|
125
|
+
}
|
|
126
|
+
interface GenerateVaultedToken {
|
|
127
|
+
cardHolderName: string;
|
|
128
|
+
customer?: Partial<Customer>;
|
|
129
|
+
}
|
|
130
|
+
interface OneTimeToken {
|
|
131
|
+
token: string;
|
|
132
|
+
vaulted_token: string | null;
|
|
133
|
+
vault_on_success: boolean;
|
|
134
|
+
type: string;
|
|
135
|
+
card_data?: {
|
|
136
|
+
holder_name: string;
|
|
137
|
+
iin: string;
|
|
138
|
+
lfd: string;
|
|
139
|
+
number_length: number;
|
|
140
|
+
security_code_length: number;
|
|
141
|
+
brand: string;
|
|
142
|
+
issuer_name: string;
|
|
143
|
+
issuer_code: string | null;
|
|
144
|
+
category: string | null;
|
|
145
|
+
type: string;
|
|
146
|
+
};
|
|
147
|
+
customer: Customer;
|
|
148
|
+
}
|
|
149
|
+
interface VaultedToken {
|
|
150
|
+
code: string;
|
|
151
|
+
idempotency_key: string;
|
|
152
|
+
organization_code: string;
|
|
153
|
+
account_code: string;
|
|
154
|
+
customer_session: string;
|
|
155
|
+
name: string;
|
|
156
|
+
description: string;
|
|
157
|
+
status: Status;
|
|
158
|
+
type: string;
|
|
159
|
+
category: string;
|
|
160
|
+
provider: {
|
|
161
|
+
type: string;
|
|
162
|
+
action: string;
|
|
163
|
+
token: string;
|
|
164
|
+
enrollment_id: string | null;
|
|
165
|
+
provider_status: string | null;
|
|
166
|
+
redirect: string | null;
|
|
167
|
+
raw_response: unknown;
|
|
168
|
+
};
|
|
169
|
+
created_at: Date;
|
|
170
|
+
updated_at: Date;
|
|
171
|
+
}
|
|
172
|
+
type CardType = 'CREDIT' | 'DEBIT';
|
|
173
|
+
interface SecureField {
|
|
174
|
+
render(elementSelector: string): Promise<void>;
|
|
175
|
+
focus(): void;
|
|
176
|
+
validate(): void;
|
|
177
|
+
unmountSync(): void;
|
|
178
|
+
clearValue(): void;
|
|
179
|
+
setError(errorMessage: string): void;
|
|
180
|
+
setCardType(cardType: CardType): void;
|
|
181
|
+
}
|
|
182
|
+
interface SecureFields {
|
|
183
|
+
create({ name, options }: Create): SecureField;
|
|
184
|
+
getElement({ name }: GetElement): SecureField;
|
|
185
|
+
generateToken(params: GenerateTokenArgs): Promise<string>;
|
|
186
|
+
generateTokenWithInformation(params: GenerateTokenArgs): Promise<OneTimeToken>;
|
|
187
|
+
generateVaultedToken(params: GenerateVaultedToken): Promise<string>;
|
|
188
|
+
generateVaultedTokenWithInformation(params: GenerateVaultedToken): Promise<VaultedToken>;
|
|
189
|
+
unmountSync(): void;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
interface ButtonTextCard {
|
|
193
|
+
cardForm?: {
|
|
194
|
+
enrollmentSubmitButton?: string;
|
|
195
|
+
paymentSubmitButton?: string;
|
|
196
|
+
};
|
|
197
|
+
cardStepper?: {
|
|
198
|
+
numberCardStep?: {
|
|
199
|
+
nextButton?: string;
|
|
200
|
+
};
|
|
201
|
+
cardHolderNameStep?: {
|
|
202
|
+
prevButton?: string;
|
|
203
|
+
nextButton?: string;
|
|
204
|
+
};
|
|
205
|
+
expirationDateStep?: {
|
|
206
|
+
prevButton?: string;
|
|
207
|
+
nextButton?: string;
|
|
208
|
+
};
|
|
209
|
+
cvvStep?: {
|
|
210
|
+
prevButton?: string;
|
|
211
|
+
nextButton?: string;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
interface TextsCustom {
|
|
216
|
+
customerForm?: {
|
|
217
|
+
submitButton?: string;
|
|
218
|
+
};
|
|
219
|
+
paymentOtp?: {
|
|
220
|
+
sendOtpButton?: string;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
interface CardConfig {
|
|
224
|
+
styles?: string;
|
|
225
|
+
type?: 'extends' | 'step';
|
|
226
|
+
cardSaveEnable?: boolean;
|
|
227
|
+
texts?: ButtonTextCard;
|
|
228
|
+
documentEnable?: boolean;
|
|
229
|
+
}
|
|
230
|
+
interface RenderMode {
|
|
231
|
+
type: 'modal' | 'element';
|
|
232
|
+
elementSelector?: string;
|
|
233
|
+
}
|
|
234
|
+
declare enum ExternalPaymentButtonsTypes {
|
|
235
|
+
PAYPAL = "paypal"
|
|
236
|
+
}
|
|
237
|
+
type ExternalPaymentButtons = {
|
|
238
|
+
[key in ExternalPaymentButtonsTypes]: {
|
|
239
|
+
elementSelector: string;
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
type LoadingType = 'DOCUMENT' | 'ONE_TIME_TOKEN';
|
|
243
|
+
type Language = 'es' | 'en' | 'pt';
|
|
244
|
+
interface YunoConfig {
|
|
245
|
+
publicApiKey: string;
|
|
246
|
+
checkoutSession: string;
|
|
247
|
+
customerSession: string;
|
|
248
|
+
language: Language;
|
|
249
|
+
countryCode: string;
|
|
250
|
+
elementSelector?: string;
|
|
251
|
+
vaultedToken?: string;
|
|
252
|
+
type?: string;
|
|
253
|
+
renderMode?: RenderMode;
|
|
254
|
+
externalPaymentButtons?: ExternalPaymentButtons;
|
|
255
|
+
card?: CardConfig;
|
|
256
|
+
showLoading?: boolean;
|
|
257
|
+
texts?: TextsCustom;
|
|
258
|
+
issuersFormEnable?: boolean;
|
|
259
|
+
automaticallyUnmount?: boolean;
|
|
260
|
+
cardFormUnfoldedEnable?: boolean;
|
|
261
|
+
isDynamicViewEnabled?: boolean;
|
|
262
|
+
showOnlyThesePaymentMethods?: string[];
|
|
263
|
+
yunoCreatePayment?: (oneTimeToken: string, tokenWithInformation: OneTimeToken) => void;
|
|
264
|
+
yunoPaymentMethodSelected?: (arg: {
|
|
265
|
+
type: string;
|
|
266
|
+
name: string;
|
|
267
|
+
}) => void;
|
|
268
|
+
yunoPaymentResult?: (status: Status) => void;
|
|
269
|
+
yunoError?: (message: string) => void;
|
|
270
|
+
onRendered?(): void;
|
|
271
|
+
onOneTimeTokenCreationStart?(): void;
|
|
272
|
+
yunoEnrollmentStatus?(params: {
|
|
273
|
+
status: EnrollmentStatus;
|
|
274
|
+
vaultedToken?: string;
|
|
275
|
+
}): void;
|
|
276
|
+
/**
|
|
277
|
+
* @deprecated
|
|
278
|
+
*/
|
|
279
|
+
onLoading?(args: {
|
|
280
|
+
isLoading: boolean;
|
|
281
|
+
type: LoadingType;
|
|
282
|
+
}): void;
|
|
283
|
+
}
|
|
284
|
+
type StartCheckoutArgs = Omit<YunoConfig, 'yunoEnrollmentStatus' | 'customerSession' | 'publicApiKey'>;
|
|
285
|
+
type MountEnrollmentLiteArgs = Pick<YunoConfig, 'language' | 'countryCode' | 'renderMode' | 'yunoEnrollmentStatus' | 'yunoError' | 'showLoading' | 'onRendered' | 'onOneTimeTokenCreationStart' | 'onLoading'>;
|
|
286
|
+
type mountFraudArgs = Pick<YunoConfig, 'yunoCreatePayment' | 'yunoError' | 'language' | 'checkoutSession'>;
|
|
287
|
+
interface MountCheckoutArgs {
|
|
288
|
+
paymentMethodType?: string;
|
|
289
|
+
vaultedToken?: string;
|
|
290
|
+
category?: string;
|
|
291
|
+
}
|
|
292
|
+
interface MountCheckoutLiteArgs {
|
|
293
|
+
paymentMethodType?: string;
|
|
294
|
+
vaultedToken?: string;
|
|
295
|
+
}
|
|
296
|
+
interface SecureFieldsArgs {
|
|
297
|
+
countryCode: string;
|
|
298
|
+
checkoutSession?: string;
|
|
299
|
+
installmentEnable?: boolean;
|
|
300
|
+
customerSession?: string;
|
|
301
|
+
}
|
|
302
|
+
interface YunoInstance {
|
|
303
|
+
startCheckout(args: StartCheckoutArgs): void;
|
|
304
|
+
mountCheckout(args: MountCheckoutArgs): void;
|
|
305
|
+
mountCheckoutLite(args: MountCheckoutLiteArgs): void;
|
|
306
|
+
updateCheckoutSession(checkout: string): void;
|
|
307
|
+
startPayment(): void;
|
|
308
|
+
continuePayment(): Promise<void>;
|
|
309
|
+
notifyError(): void;
|
|
310
|
+
mountEnrollmentLite(args: MountEnrollmentLiteArgs): void;
|
|
311
|
+
showLoader(): void;
|
|
312
|
+
hideLoader(): void;
|
|
313
|
+
updateCheckoutSession(checkoutSession: string): void;
|
|
314
|
+
mountFraud(args: mountFraudArgs): void;
|
|
315
|
+
secureFields({ countryCode, checkoutSession, installmentEnable, customerSession }: SecureFieldsArgs): SecureFields;
|
|
316
|
+
}
|
|
317
|
+
interface Yuno {
|
|
318
|
+
initialize(publicApiKey: string): YunoInstance;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export { type ButtonTextCard, type CardConfig, type ExternalPaymentButtons, ExternalPaymentButtonsTypes, type Language, type LoadingType, type MountCheckoutArgs, type MountCheckoutLiteArgs, type MountEnrollmentLiteArgs, type RenderMode, type SecureFieldsArgs, type StartCheckoutArgs, type TextsCustom, type Yuno, type YunoConfig, type YunoInstance, type mountFraudArgs };
|
package/package.json
CHANGED