@payrails/web-sdk 5.46.1 → 5.47.1
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 +9 -0
- package/index.js +4 -4
- package/index.mjs +4 -4
- package/package.json +2 -3
- package/payrails-styles.css +211 -122
- package/payrails.d.ts +1246 -1138
- package/payrails.js +4 -4
package/payrails.d.ts
CHANGED
|
@@ -1,1243 +1,1279 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}>;
|
|
12
|
-
required: string[];
|
|
13
|
-
}>;
|
|
1
|
+
interface BinLookupResponse {
|
|
2
|
+
bin: string;
|
|
3
|
+
network: string;
|
|
4
|
+
issuer?: string;
|
|
5
|
+
issuerCountry?: {
|
|
6
|
+
code?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
iso3?: string;
|
|
9
|
+
};
|
|
10
|
+
type?: string;
|
|
14
11
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
maxLength?: number;
|
|
22
|
-
errorMessage?: Record<string, string>;
|
|
23
|
-
$ref?: string;
|
|
24
|
-
[UI_POSITION_FIELD]?: number;
|
|
25
|
-
properties?: Record<string, JSONSchemaType>;
|
|
12
|
+
|
|
13
|
+
declare enum RedactionType {
|
|
14
|
+
DEFAULT = "DEFAULT",
|
|
15
|
+
PLAIN_TEXT = "PLAIN_TEXT",
|
|
16
|
+
MASKED = "MASKED",
|
|
17
|
+
REDACTED = "REDACTED"
|
|
26
18
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
declare enum RequestMethod$1 {
|
|
20
|
+
GET = "GET",
|
|
21
|
+
POST = "POST",
|
|
22
|
+
PUT = "PUT",
|
|
23
|
+
PATCH = "PATCH",
|
|
24
|
+
DELETE = "DELETE"
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
declare enum EventName {
|
|
27
|
+
CHANGE = "CHANGE",
|
|
28
|
+
READY = "READY",
|
|
29
|
+
FOCUS = "FOCUS",
|
|
30
|
+
BLUR = "BLUR",
|
|
31
|
+
SUBMIT = "SUBMIT"
|
|
34
32
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
declare enum LogLevel {
|
|
34
|
+
WARN = "WARN",
|
|
35
|
+
INFO = "INFO",
|
|
36
|
+
DEBUG = "DEBUG",
|
|
37
|
+
ERROR = "ERROR"
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
errors?: Partial<DynamicElementErrorTranslation>;
|
|
39
|
+
declare enum Env {
|
|
40
|
+
DEV = "DEV",
|
|
41
|
+
PROD = "PROD"
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
pattern: string;
|
|
49
|
-
oneOf: string;
|
|
43
|
+
declare enum ValidationRuleType {
|
|
44
|
+
REGEX_MATCH_RULE = "REGEX_MATCH_RULE",
|
|
45
|
+
LENGTH_MATCH_RULE = "LENGTH_MATCH_RULE",
|
|
46
|
+
ELEMENT_VALUE_MATCH_RULE = "ELEMENT_VALUE_MATCH_RULE"
|
|
50
47
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
errors?: Partial<DynamicElementErrorTranslation>;
|
|
54
|
-
};
|
|
55
|
-
interface DynamicElementElementStyles {
|
|
56
|
-
base?: Partial<CSSStyleDeclaration>;
|
|
57
|
-
complete?: Partial<CSSStyleDeclaration>;
|
|
58
|
-
empty?: Partial<CSSStyleDeclaration>;
|
|
59
|
-
focus?: Partial<CSSStyleDeclaration>;
|
|
60
|
-
invalid?: Partial<CSSStyleDeclaration>;
|
|
48
|
+
interface IInsertRecordInput {
|
|
49
|
+
records: IInsertRecord[];
|
|
61
50
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
base?: Partial<CSSStyleDeclaration>;
|
|
67
|
-
active?: Partial<CSSStyleDeclaration>;
|
|
68
|
-
};
|
|
69
|
-
container?: DynamicElementElementStyles;
|
|
51
|
+
interface IInsertRecord {
|
|
52
|
+
table: string;
|
|
53
|
+
fields: Record<string, any>;
|
|
54
|
+
skyflowID?: string;
|
|
70
55
|
}
|
|
71
|
-
interface
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
errors?: Partial<CSSStyleDeclaration>;
|
|
75
|
-
input?: DynamicElementInputFieldStyles;
|
|
76
|
-
select?: DynamicElementSelectFieldStyles;
|
|
77
|
-
tabs?: DynamicElementTabsFieldStyles;
|
|
56
|
+
interface Context {
|
|
57
|
+
logLevel: LogLevel;
|
|
58
|
+
env: Env;
|
|
78
59
|
}
|
|
79
|
-
interface
|
|
80
|
-
|
|
81
|
-
|
|
60
|
+
interface IValidationRule {
|
|
61
|
+
type: ValidationRuleType;
|
|
62
|
+
params: any;
|
|
82
63
|
}
|
|
83
64
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
'PAYPAL' = "payPal",
|
|
88
|
-
'APPLE_PAY' = "applePay",
|
|
89
|
-
'GENERIC_REDIRECT' = "genericRedirect",
|
|
90
|
-
'LEAN' = "lean",
|
|
91
|
-
'MERCADO_PAGO' = "mercadoPago",
|
|
92
|
-
'PIX' = "pix",
|
|
93
|
-
'BANK_ACCOUNT' = "bankAccount",
|
|
94
|
-
'IDEAL' = "iDeal",
|
|
95
|
-
'YAPE' = "yape",
|
|
96
|
-
'UPI' = "upi",
|
|
97
|
-
'KLARNA' = "klarna",
|
|
98
|
-
'ONE_VOUCHER' = "1voucher",
|
|
99
|
-
'ALFA' = "alfa",
|
|
100
|
-
'APLAZO' = "aplazo",
|
|
101
|
-
'BANK_TRANSFER' = "bankTransfer",
|
|
102
|
-
'CAPITEC_PAY' = "capitecPay",
|
|
103
|
-
'EASYPAISA' = "easypaisa",
|
|
104
|
-
'EFT_PRO' = "eftPro",
|
|
105
|
-
'FAWRY_PAY' = "fawryPay",
|
|
106
|
-
'JAZZ_CASH' = "jazzCash",
|
|
107
|
-
'KONNECT' = "konnect",
|
|
108
|
-
'KUESKI' = "kueski",
|
|
109
|
-
'MONO_DIRECT_DEBIT' = "monoDirectDebit",
|
|
110
|
-
'O_PAY_WALLET' = "oPayWallet",
|
|
111
|
-
'PAGA_WALLET' = "pagaWallet",
|
|
112
|
-
'PAYFLEX' = "payflex",
|
|
113
|
-
'PAY_JUST_NOW' = "payjustnow",
|
|
114
|
-
'WAFA_CASH_WALLET' = "wafaCashWallet",
|
|
115
|
-
'MERCADO_PAGO_WALLET' = "mercadoPagoWallet",
|
|
116
|
-
'MERCADO_PAGO_CONSUMER_CREDIT' = "mercadoPagoConsumerCredit",
|
|
117
|
-
'NET_BANKING' = "netBanking",
|
|
118
|
-
'CASH_FREE_WALLET' = "cashFreeWallet",
|
|
119
|
-
'PAYTM_WALLET' = "paytmWallet",
|
|
120
|
-
'NIBSS_PAY' = "nibssPay",
|
|
121
|
-
'NIBSS_INSTANT_PAY' = "nibssInstantPay",
|
|
122
|
-
'MEEZA_WALLET' = "meezaWallet",
|
|
123
|
-
'VODAFONE_CASH' = "vodafoneCash",
|
|
124
|
-
'SEPA_DIRECT_DEBIT' = "sepaDirectDebit",
|
|
125
|
-
'MODO' = "modo",
|
|
126
|
-
'PAYZONE_CASH' = "payzoneCash",
|
|
127
|
-
'REVOLUT_PAY' = "revolutPay"
|
|
65
|
+
interface IUpsertOptions {
|
|
66
|
+
table: string;
|
|
67
|
+
column: string;
|
|
128
68
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
69
|
+
|
|
70
|
+
declare enum ElementType$1 {
|
|
71
|
+
CVV = "CVV",
|
|
72
|
+
EXPIRATION_DATE = "EXPIRATION_DATE",
|
|
73
|
+
CARD_NUMBER = "CARD_NUMBER",
|
|
74
|
+
CARDHOLDER_NAME = "CARDHOLDER_NAME",
|
|
75
|
+
INPUT_FIELD = "INPUT_FIELD",
|
|
76
|
+
PIN = "PIN",
|
|
77
|
+
EXPIRATION_MONTH = "EXPIRATION_MONTH",
|
|
78
|
+
EXPIRATION_YEAR = "EXPIRATION_YEAR"
|
|
138
79
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
phone?: {
|
|
142
|
-
countryCode?: string;
|
|
143
|
-
number?: string;
|
|
144
|
-
};
|
|
145
|
-
country?: {
|
|
146
|
-
name?: string;
|
|
147
|
-
code?: string;
|
|
148
|
-
iso3?: string;
|
|
149
|
-
};
|
|
150
|
-
reference?: string;
|
|
151
|
-
name?: string;
|
|
152
|
-
lastName?: string;
|
|
153
|
-
email?: string;
|
|
154
|
-
type?: string;
|
|
155
|
-
birthDate?: string;
|
|
156
|
-
language?: string;
|
|
157
|
-
identityCardNumber?: string;
|
|
80
|
+
|
|
81
|
+
declare abstract class Container {
|
|
158
82
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
83
|
+
|
|
84
|
+
declare class EventEmitter {
|
|
85
|
+
events: Record<string, {
|
|
86
|
+
priority: boolean;
|
|
87
|
+
callback: Function;
|
|
88
|
+
}[]>;
|
|
89
|
+
constructor();
|
|
90
|
+
on(event: string, callback: Function, priority?: boolean): void;
|
|
91
|
+
off(event: string, callback: Function): void;
|
|
92
|
+
_emit(event: string, ...args: any[]): void;
|
|
93
|
+
hasListener(event: string): boolean;
|
|
94
|
+
resetEvents(): void;
|
|
95
|
+
static createChild(ChildObject: any): void;
|
|
167
96
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}[ExecutionMetaKey];
|
|
177
|
-
interface ExecutionMeta {
|
|
178
|
-
customer?: ExecutionMetaCustomer;
|
|
179
|
-
order?: ExecutionMetaOrder;
|
|
97
|
+
|
|
98
|
+
declare abstract class SkyflowElement {
|
|
99
|
+
abstract mount(domElementSelector: any): any;
|
|
100
|
+
abstract unmount(): any;
|
|
101
|
+
abstract setError(clientErrorText: string): any;
|
|
102
|
+
abstract resetError(): any;
|
|
103
|
+
abstract iframeName(): any;
|
|
104
|
+
abstract getID(): any;
|
|
180
105
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
private
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
payout?: {
|
|
201
|
-
href: string;
|
|
202
|
-
method: "POST";
|
|
203
|
-
};
|
|
204
|
-
startPaymentSession?: {
|
|
205
|
-
href: string;
|
|
206
|
-
method: "POST";
|
|
207
|
-
};
|
|
208
|
-
createInstrument?: {
|
|
209
|
-
href: string;
|
|
210
|
-
method: "POST";
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
name: "lookup";
|
|
214
|
-
};
|
|
215
|
-
} | undefined;
|
|
216
|
-
static get holderReference(): string;
|
|
217
|
-
static get savedCreditCards(): StoredPaymentInstrument<CardMetadata>[];
|
|
218
|
-
static get savedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
|
|
219
|
-
static get savedGooglePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
|
|
220
|
-
static get savedApplePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
|
|
221
|
-
static get paypalConfig(): PayPalConfig;
|
|
222
|
-
static get googlePayConfig(): any;
|
|
223
|
-
static isPaymentMethodAvailable(paymentMethod: PaymentMethodCode): boolean;
|
|
224
|
-
static get applePayConfig(): {
|
|
225
|
-
merchantIdentifier: string;
|
|
226
|
-
supportedNetworks: string[];
|
|
227
|
-
countryCode: string;
|
|
228
|
-
merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
|
|
229
|
-
requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
230
|
-
requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
231
|
-
};
|
|
232
|
-
static get url(): string;
|
|
233
|
-
static get meta(): ExecutionMeta;
|
|
234
|
-
static get availablePaymentMethods(): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined>[];
|
|
235
|
-
static get authorizeLink(): string | undefined;
|
|
236
|
-
static get payoutLink(): string | undefined;
|
|
237
|
-
static get createSessionLink(): string | undefined;
|
|
238
|
-
static get createInstrumentLink(): string | undefined;
|
|
239
|
-
static get storedPaymentInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
240
|
-
static get storedDropinInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
241
|
-
static getFullPaymentMethodConfig(paymentMethod: PaymentMethodCode): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined> | undefined;
|
|
242
|
-
static isAddressSelectorEnabled(paymentMethod: PaymentMethodCode): boolean | undefined;
|
|
243
|
-
static isPaymentInstallmentsEnabled(paymentMethod: PaymentMethodCode): boolean | undefined;
|
|
244
|
-
static getPaymentInstallmentOptions(paymentMethod: PaymentMethodCode): PaymentInstallmentsConfig;
|
|
245
|
-
static getStoredInstrumentForPaymentMethod<T = CardMetadata | PayPalMetadata>(paymentMethod: PaymentMethodCode): Array<StoredPaymentInstrument<T>>;
|
|
246
|
-
static getPaymentMethodForStoredInstrument<T extends CardMetadata | PayPalMetadata>(instrument: StoredPaymentInstrument<T>): {
|
|
247
|
-
id: string;
|
|
248
|
-
description?: string;
|
|
249
|
-
status: PAYMENT_INSTRUMENT_STATUS;
|
|
250
|
-
integrationType: INTEGRATION_TYPE;
|
|
251
|
-
config: ApplePayConfig | PayPalConfig | GooglePayConfig | undefined;
|
|
252
|
-
clientConfig?: {
|
|
253
|
-
flow?: PAYMENT_CLIENT_FLOW;
|
|
254
|
-
displayName?: string;
|
|
255
|
-
supportsInstallments?: boolean;
|
|
256
|
-
installments?: PaymentInstallmentsConfig;
|
|
257
|
-
supportsBillingInfo?: boolean;
|
|
258
|
-
schema?: JSONSchemaType;
|
|
259
|
-
additionalConfig?: any;
|
|
260
|
-
instrumentDataSchema?: JSONSchemaType;
|
|
261
|
-
};
|
|
262
|
-
payoutInstruments?: StoredPaymentInstrument<CardMetadata | PayPalMetadata>[] | undefined;
|
|
263
|
-
paymentMethodCode: PaymentMethodCode;
|
|
264
|
-
payoutMethodCode?: PaymentMethodCode;
|
|
265
|
-
} | undefined;
|
|
266
|
-
static getPaymentMethodConfig(paymentMethod: StorablePaymentCompositionOption): {
|
|
267
|
-
id: string;
|
|
268
|
-
description?: string;
|
|
269
|
-
status: PAYMENT_INSTRUMENT_STATUS;
|
|
270
|
-
integrationType: INTEGRATION_TYPE;
|
|
271
|
-
config: ApplePayConfig | PayPalConfig | GooglePayConfig | undefined;
|
|
272
|
-
clientConfig?: {
|
|
273
|
-
flow?: PAYMENT_CLIENT_FLOW;
|
|
274
|
-
displayName?: string;
|
|
275
|
-
supportsInstallments?: boolean;
|
|
276
|
-
installments?: PaymentInstallmentsConfig;
|
|
277
|
-
supportsBillingInfo?: boolean;
|
|
278
|
-
schema?: JSONSchemaType;
|
|
279
|
-
additionalConfig?: any;
|
|
280
|
-
instrumentDataSchema?: JSONSchemaType;
|
|
281
|
-
};
|
|
282
|
-
payoutInstruments?: StoredPaymentInstrument<CardMetadata | PayPalMetadata>[] | undefined;
|
|
283
|
-
paymentMethodCode: PaymentMethodCode;
|
|
284
|
-
payoutMethodCode?: PaymentMethodCode;
|
|
285
|
-
};
|
|
286
|
-
static updateInstallmentOptions(installmentOptions?: PaymentInstallmentsConfig): void;
|
|
287
|
-
static updateMeta<K extends ExecutionMetaKey>(key: K, value: ExecutionMetaByKey[K]): void;
|
|
288
|
-
static getAllowedMeta(): ExecutionMeta;
|
|
289
|
-
static getUpdatedMeta(): ExecutionMeta;
|
|
290
|
-
private static pickMetaByKeys;
|
|
291
|
-
}
|
|
292
|
-
interface WorkflowExecutionResponse {
|
|
293
|
-
id: string;
|
|
294
|
-
merchantReference: string;
|
|
295
|
-
holderReference: string;
|
|
296
|
-
holderId?: string;
|
|
297
|
-
actionRequired?: string;
|
|
298
|
-
meta: ExecutionMeta;
|
|
299
|
-
status: Array<{
|
|
300
|
-
code: string;
|
|
301
|
-
time: string;
|
|
302
|
-
}>;
|
|
303
|
-
initialResults: Array<{
|
|
304
|
-
httpCode: number;
|
|
305
|
-
body: {
|
|
306
|
-
data: {
|
|
307
|
-
paymentCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
308
|
-
payoutCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
309
|
-
};
|
|
310
|
-
links: {
|
|
311
|
-
execution: string;
|
|
312
|
-
authorize?: {
|
|
313
|
-
href: string;
|
|
314
|
-
method: 'POST';
|
|
315
|
-
};
|
|
316
|
-
payout?: {
|
|
317
|
-
href: string;
|
|
318
|
-
method: 'POST';
|
|
319
|
-
};
|
|
320
|
-
startPaymentSession?: {
|
|
321
|
-
href: string;
|
|
322
|
-
method: 'POST';
|
|
323
|
-
};
|
|
324
|
-
createInstrument?: {
|
|
325
|
-
href: string;
|
|
326
|
-
method: 'POST';
|
|
327
|
-
};
|
|
328
|
-
};
|
|
329
|
-
name: 'lookup';
|
|
330
|
-
};
|
|
331
|
-
}>;
|
|
332
|
-
links: {
|
|
333
|
-
startPaymentSession?: {
|
|
334
|
-
href: string;
|
|
335
|
-
method: 'POST';
|
|
336
|
-
};
|
|
337
|
-
createInstrument?: {
|
|
338
|
-
href: string;
|
|
339
|
-
method: 'POST';
|
|
340
|
-
};
|
|
341
|
-
confirm?: {
|
|
342
|
-
href: string;
|
|
343
|
-
action?: {
|
|
344
|
-
parameters?: {
|
|
345
|
-
orderId?: string;
|
|
346
|
-
tokenId?: string;
|
|
347
|
-
};
|
|
348
|
-
paymentId?: string;
|
|
349
|
-
sdkToken?: string;
|
|
350
|
-
appToken?: string;
|
|
351
|
-
successUrl?: string;
|
|
352
|
-
failureUrl?: string;
|
|
353
|
-
sandbox?: boolean;
|
|
354
|
-
};
|
|
355
|
-
};
|
|
356
|
-
redirect?: string;
|
|
357
|
-
'3ds'?: string;
|
|
358
|
-
self: string;
|
|
359
|
-
};
|
|
360
|
-
workflow: {
|
|
361
|
-
code: string;
|
|
362
|
-
version: number;
|
|
106
|
+
|
|
107
|
+
declare class CollectElement extends SkyflowElement {
|
|
108
|
+
#private;
|
|
109
|
+
elementType: string;
|
|
110
|
+
type: string;
|
|
111
|
+
containerId: string;
|
|
112
|
+
constructor(elementId: string, elementGroup: any, metaData: any, container: any, isSingleElementAPI: boolean | undefined, destroyCallback: Function, updateCallback: Function, context: Context, groupEventEmitter?: EventEmitter);
|
|
113
|
+
getID: () => string;
|
|
114
|
+
mount: (domElement: any) => void;
|
|
115
|
+
unmount: () => void;
|
|
116
|
+
update: (group: any) => void;
|
|
117
|
+
updateElement: (elementOptions: any) => void;
|
|
118
|
+
getState: () => {
|
|
119
|
+
isEmpty: boolean;
|
|
120
|
+
isComplete: boolean;
|
|
121
|
+
isValid: boolean;
|
|
122
|
+
isFocused: boolean;
|
|
123
|
+
value: string | Object | Blob | undefined;
|
|
124
|
+
required: boolean;
|
|
363
125
|
};
|
|
126
|
+
getOptions: () => any;
|
|
127
|
+
on(eventName: string, handler: any): void;
|
|
128
|
+
iframeName(): string;
|
|
129
|
+
isMounted(): boolean;
|
|
130
|
+
isValidElement(): boolean;
|
|
131
|
+
setError(clientErrorText: string): void;
|
|
132
|
+
resetError(): void;
|
|
133
|
+
setValue(elementValue: string): void;
|
|
134
|
+
clearValue(): void;
|
|
135
|
+
setAttribute(attribute: string, value: string | number): void;
|
|
136
|
+
focus(): void;
|
|
364
137
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
installmentCountry?: string | null;
|
|
379
|
-
installmentOptions?: BaseInstallmentOption[] | null;
|
|
138
|
+
|
|
139
|
+
interface CollectElementInput$1 {
|
|
140
|
+
table?: string;
|
|
141
|
+
column?: string;
|
|
142
|
+
inputStyles?: object;
|
|
143
|
+
label?: string;
|
|
144
|
+
labelStyles?: object;
|
|
145
|
+
errorTextStyles?: object;
|
|
146
|
+
placeholder?: string;
|
|
147
|
+
type: ElementType$1;
|
|
148
|
+
altText?: string;
|
|
149
|
+
validations?: IValidationRule[];
|
|
150
|
+
skyflowID?: string;
|
|
380
151
|
}
|
|
381
|
-
interface
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
integrationType: INTEGRATION_TYPE;
|
|
386
|
-
config: C;
|
|
387
|
-
clientConfig?: {
|
|
388
|
-
flow?: PAYMENT_CLIENT_FLOW;
|
|
389
|
-
displayName?: string;
|
|
390
|
-
supportsInstallments?: boolean;
|
|
391
|
-
installments?: PaymentInstallmentsConfig;
|
|
392
|
-
supportsBillingInfo?: boolean;
|
|
393
|
-
schema?: JSONSchemaType;
|
|
394
|
-
additionalConfig?: any;
|
|
395
|
-
instrumentDataSchema?: JSONSchemaType;
|
|
396
|
-
};
|
|
397
|
-
paymentInstruments?: Array<StoredPaymentInstrument<I>>;
|
|
398
|
-
payoutInstruments?: Array<StoredPaymentInstrument<I>>;
|
|
152
|
+
interface ICollectOptions$1 {
|
|
153
|
+
tokens?: boolean;
|
|
154
|
+
additionalFields?: IInsertRecordInput;
|
|
155
|
+
upsert?: Array<IUpsertOptions>;
|
|
399
156
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
apiVersion?: number;
|
|
412
|
-
apiVersionMinor?: number;
|
|
413
|
-
allowedPaymentMethods?: google.payments.api.PaymentMethodSpecification[];
|
|
414
|
-
emailRequired?: boolean;
|
|
415
|
-
shippingAddressRequired?: boolean;
|
|
416
|
-
shippingAddressParameters?: google.payments.api.ShippingAddressParameters;
|
|
417
|
-
merchantInfo?: google.payments.api.MerchantInfo;
|
|
418
|
-
existingPaymentMethodRequired?: boolean;
|
|
157
|
+
declare class CollectContainer extends Container {
|
|
158
|
+
#private;
|
|
159
|
+
type: string;
|
|
160
|
+
private bus;
|
|
161
|
+
private iframe;
|
|
162
|
+
constructor(options: any, metaData: any, skyflowElements: any, context: any);
|
|
163
|
+
create: (input: CollectElementInput$1, options?: any) => CollectElement;
|
|
164
|
+
validate: () => Promise<unknown>;
|
|
165
|
+
collect: (options?: ICollectOptions$1) => Promise<unknown>;
|
|
166
|
+
reset(): void;
|
|
167
|
+
unmount: () => void;
|
|
419
168
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Descriptor for a custom font to be injected or referenced by the card/secure-fields iframes.
|
|
172
|
+
*
|
|
173
|
+
* This mirrors Stripe-like font configuration where you can provide either a CSS URL that
|
|
174
|
+
* includes @font-face declarations (cssSrc) or provide full @font-face fields to be injected.
|
|
175
|
+
*
|
|
176
|
+
* Examples:
|
|
177
|
+
* - { cssSrc: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap' }
|
|
178
|
+
* - { family: 'Inter', src: 'https://cdn.example.com/fonts/Inter.woff2', weight: 400, style: 'normal', display: 'swap' }
|
|
179
|
+
*/
|
|
180
|
+
interface FontDescriptor {
|
|
181
|
+
cssSrc?: string;
|
|
182
|
+
family?: string;
|
|
183
|
+
src?: string;
|
|
184
|
+
style?: string;
|
|
185
|
+
weight?: string | number;
|
|
186
|
+
unicodeRange?: string;
|
|
187
|
+
display?: string;
|
|
425
188
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
supportedNetworks: string[];
|
|
430
|
-
countryCode: string;
|
|
431
|
-
merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
|
|
432
|
-
requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
433
|
-
requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
434
|
-
};
|
|
189
|
+
|
|
190
|
+
declare class ComposableElement {
|
|
191
|
+
#private;
|
|
435
192
|
type: string;
|
|
193
|
+
constructor(name: any, eventEmitter: any);
|
|
194
|
+
on(eventName: string, handler: any): void;
|
|
195
|
+
focus(): void;
|
|
196
|
+
update: (options: any) => void;
|
|
197
|
+
setAttribute(attribute: string, value: string | number): void;
|
|
436
198
|
}
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Configuration interface for creating collect elements
|
|
202
|
+
* Defines the structure and styling options for form input elements
|
|
203
|
+
*/
|
|
204
|
+
interface CollectElementInput {
|
|
205
|
+
table?: string;
|
|
206
|
+
column?: string;
|
|
207
|
+
inputStyles?: object;
|
|
208
|
+
label?: string;
|
|
209
|
+
labelStyles?: object;
|
|
210
|
+
errorTextStyles?: object;
|
|
211
|
+
placeholder?: string;
|
|
212
|
+
type: ElementType$1;
|
|
213
|
+
altText?: string;
|
|
214
|
+
validations?: IValidationRule[];
|
|
215
|
+
skyflowID?: string;
|
|
449
216
|
}
|
|
450
|
-
|
|
451
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Options interface for the collect operation
|
|
219
|
+
* Controls how data is collected and processed
|
|
220
|
+
*/
|
|
221
|
+
interface ICollectOptions {
|
|
222
|
+
tokens?: boolean;
|
|
223
|
+
additionalFields?: IInsertRecordInput;
|
|
224
|
+
upsert?: Array<IUpsertOptions>;
|
|
452
225
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
226
|
+
/**
|
|
227
|
+
* ComposableContainer class - Main container for managing secure form elements
|
|
228
|
+
*
|
|
229
|
+
* This class extends the base Container and provides functionality to:
|
|
230
|
+
* - Create and manage secure iframe-based form elements
|
|
231
|
+
* - Handle secure communication between parent and iframe contexts
|
|
232
|
+
* - Collect and tokenize sensitive data while maintaining PCI compliance
|
|
233
|
+
* - Manage element lifecycle (create, mount, validate, collect, destroy)
|
|
234
|
+
*/
|
|
235
|
+
declare class ComposableContainer extends Container {
|
|
236
|
+
#private;
|
|
237
|
+
type: string;
|
|
238
|
+
private bus;
|
|
239
|
+
private iframe;
|
|
240
|
+
/**
|
|
241
|
+
* Constructor - Initializes the composable container
|
|
242
|
+
*
|
|
243
|
+
* Sets up the secure iframe, establishes communication channels,
|
|
244
|
+
* and prepares the container for element creation and management.
|
|
245
|
+
*
|
|
246
|
+
* @param options - Container configuration (layout, styles, etc.)
|
|
247
|
+
* @param metaData - Client metadata and configuration
|
|
248
|
+
* @param skyflowElements - Global elements registry
|
|
249
|
+
* @param context - Application context with logging and config
|
|
250
|
+
*/
|
|
251
|
+
constructor(options: any, metaData: any, skyflowElements: any, context: any);
|
|
252
|
+
/**
|
|
253
|
+
* Creates a new composable form element
|
|
254
|
+
*
|
|
255
|
+
* This method creates a secure form element (like card number, CVV, etc.)
|
|
256
|
+
* that will be rendered inside the secure iframe. The element is added to
|
|
257
|
+
* the container's element list but not yet mounted to the DOM.
|
|
258
|
+
*
|
|
259
|
+
* @param input - Element configuration (type, styles, validations, etc.)
|
|
260
|
+
* @param options - Additional options like required field validation
|
|
261
|
+
* @returns ComposableElement instance for further configuration
|
|
262
|
+
*/
|
|
263
|
+
create: (input: CollectElementInput, options?: any) => ComposableElement;
|
|
264
|
+
/**
|
|
265
|
+
* Registers an event listener for container events
|
|
266
|
+
*
|
|
267
|
+
* Allows the application to listen for events like form submission,
|
|
268
|
+
* validation errors, or other container-level events.
|
|
269
|
+
*
|
|
270
|
+
* @param eventName - The name of the event to listen for
|
|
271
|
+
* @param handler - The callback function to execute when the event occurs
|
|
272
|
+
*/
|
|
273
|
+
on: (eventName: string, handler: any) => void;
|
|
274
|
+
/**
|
|
275
|
+
* Mounts the container and its elements to a DOM element
|
|
276
|
+
*
|
|
277
|
+
* This method organizes the created elements according to the specified layout,
|
|
278
|
+
* applies styling, and renders them within the provided DOM element.
|
|
279
|
+
* The elements are rendered inside secure iframes for PCI compliance.
|
|
280
|
+
*
|
|
281
|
+
* @param domElement - The DOM element where the form should be mounted
|
|
282
|
+
*/
|
|
283
|
+
mount: (domElement: any) => void;
|
|
284
|
+
/**
|
|
285
|
+
* Mounts the container element to the DOM and triggers a mounted event
|
|
286
|
+
*
|
|
287
|
+
* This method mounts the container element to the specified DOM element
|
|
288
|
+
* and then emits an event to notify the SDK that the container has been mounted.
|
|
289
|
+
*
|
|
290
|
+
* @param domElement - The DOM element where the container should be mounted
|
|
291
|
+
*/
|
|
292
|
+
mountContainerElement: (domElement: string) => void;
|
|
293
|
+
/**
|
|
294
|
+
* Unmounts the container and cleans up all resources
|
|
295
|
+
*
|
|
296
|
+
* This method removes all elements from the DOM, clears internal state,
|
|
297
|
+
* and removes the iframe to prevent memory leaks.
|
|
298
|
+
*/
|
|
299
|
+
unmount: () => void;
|
|
300
|
+
/**
|
|
301
|
+
* Validates all elements in the container
|
|
302
|
+
*
|
|
303
|
+
* Checks that all elements are mounted and triggers validation
|
|
304
|
+
* in the secure iframe. Returns a promise that resolves with
|
|
305
|
+
* validation results.
|
|
306
|
+
*
|
|
307
|
+
* @returns Promise that resolves with validation results
|
|
308
|
+
*/
|
|
309
|
+
validate: () => Promise<unknown>;
|
|
310
|
+
/**
|
|
311
|
+
* Collects data from all elements in the container
|
|
312
|
+
*
|
|
313
|
+
* This method securely collects sensitive data from all mounted elements,
|
|
314
|
+
* validates the data, and optionally tokenizes it. The actual data collection
|
|
315
|
+
* happens within the secure iframe to maintain PCI compliance.
|
|
316
|
+
*
|
|
317
|
+
* @param options - Collection options (tokenization, additional fields, etc.)
|
|
318
|
+
* @returns Promise that resolves with collected/tokenized data
|
|
319
|
+
*/
|
|
320
|
+
collect: (options?: ICollectOptions) => Promise<unknown>;
|
|
321
|
+
/**
|
|
322
|
+
* Resets all form elements to their initial state
|
|
323
|
+
*
|
|
324
|
+
* Clears all input values and resets validation states
|
|
325
|
+
* by sending a reset command to the secure iframe.
|
|
326
|
+
*/
|
|
327
|
+
reset(): void;
|
|
457
328
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
binLookup?: {
|
|
463
|
-
issuerCountry: Country;
|
|
464
|
-
};
|
|
329
|
+
|
|
330
|
+
declare enum ContainerType {
|
|
331
|
+
COLLECT = "COLLECT",
|
|
332
|
+
COMPOSABLE = "COMPOSABLE"
|
|
465
333
|
}
|
|
466
|
-
interface
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
};
|
|
334
|
+
interface ISkyflow {
|
|
335
|
+
vaultID?: string;
|
|
336
|
+
vaultURL?: string;
|
|
337
|
+
getBearerToken: () => Promise<string>;
|
|
338
|
+
options?: Record<string, any>;
|
|
472
339
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
340
|
+
declare class Skyflow {
|
|
341
|
+
#private;
|
|
342
|
+
private bus;
|
|
343
|
+
constructor(config: ISkyflow);
|
|
344
|
+
static init(config: ISkyflow): Skyflow;
|
|
345
|
+
container(type: ContainerType, options?: Record<string, any>): CollectContainer | ComposableContainer;
|
|
346
|
+
static get ContainerType(): typeof ContainerType;
|
|
347
|
+
static get ElementType(): typeof ElementType$1;
|
|
348
|
+
static get RedactionType(): typeof RedactionType;
|
|
349
|
+
static get RequestMethod(): typeof RequestMethod$1;
|
|
350
|
+
static get LogLevel(): typeof LogLevel;
|
|
351
|
+
static get EventName(): typeof EventName;
|
|
352
|
+
static get Env(): typeof Env;
|
|
353
|
+
static get ValidationRuleType(): typeof ValidationRuleType;
|
|
483
354
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
355
|
+
|
|
356
|
+
type IframeEventBusLike = {
|
|
357
|
+
emit: (...args: any[]) => unknown;
|
|
358
|
+
on: (...args: any[]) => unknown;
|
|
359
|
+
off?: (...args: any[]) => unknown;
|
|
360
|
+
};
|
|
361
|
+
interface Mountable {
|
|
362
|
+
mount(selector: string | PayrailsElement): void;
|
|
363
|
+
unmount(): void;
|
|
491
364
|
}
|
|
492
|
-
interface
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
country?: Country;
|
|
365
|
+
interface ElementOptions {
|
|
366
|
+
id?: string;
|
|
367
|
+
dataTestId?: string;
|
|
368
|
+
className?: string | string[];
|
|
369
|
+
styles?: Partial<CSSStyleDeclaration>;
|
|
498
370
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
};
|
|
506
|
-
|
|
371
|
+
declare class PayrailsElement implements Mountable {
|
|
372
|
+
protected element: HTMLElement;
|
|
373
|
+
protected subElements: Array<Mountable>;
|
|
374
|
+
readonly id: string | undefined;
|
|
375
|
+
readonly dataTestId: string | undefined;
|
|
376
|
+
protected eventBus: IframeEventBusLike;
|
|
377
|
+
constructor(elementType: string, { id, className, dataTestId }?: ElementOptions);
|
|
378
|
+
get parentElement(): HTMLElement | null;
|
|
379
|
+
get selector(): string;
|
|
380
|
+
mount(location: string): void;
|
|
381
|
+
protected clean(): void;
|
|
382
|
+
unmount(): void;
|
|
507
383
|
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
384
|
+
|
|
385
|
+
interface TokenizeOptions {
|
|
386
|
+
futureUsage?: FutureUsages;
|
|
387
|
+
storeInstrument?: boolean;
|
|
512
388
|
}
|
|
513
|
-
declare
|
|
514
|
-
|
|
515
|
-
|
|
389
|
+
declare abstract class Tokenizable extends PayrailsElement {
|
|
390
|
+
protected abstract collect(): Promise<any>;
|
|
391
|
+
protected abstract constructSaveInstrumentBody(tokens: any, opts?: TokenizeOptions): Promise<any>;
|
|
392
|
+
tokenize(_opts?: TokenizeOptions): Promise<any>;
|
|
516
393
|
}
|
|
517
394
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
bin: string;
|
|
527
|
-
binLookup?: {
|
|
528
|
-
bin: string;
|
|
529
|
-
network: string;
|
|
530
|
-
issuer?: string;
|
|
531
|
-
issuerCountry?: {
|
|
532
|
-
code?: string;
|
|
533
|
-
name?: string;
|
|
534
|
-
iso3?: string;
|
|
535
|
-
};
|
|
536
|
-
type?: string;
|
|
537
|
-
};
|
|
538
|
-
holderName?: string;
|
|
539
|
-
network: string;
|
|
540
|
-
suffix: string;
|
|
541
|
-
expiryMonth?: string;
|
|
542
|
-
expiryYear?: string;
|
|
543
|
-
};
|
|
544
|
-
fingerprint?: string;
|
|
545
|
-
futureUsage?: string;
|
|
395
|
+
declare enum ElementType {
|
|
396
|
+
CARD_NUMBER = "CARD_NUMBER",
|
|
397
|
+
CARDHOLDER_NAME = "CARDHOLDER_NAME",
|
|
398
|
+
CVV = "CVV",
|
|
399
|
+
EXPIRATION_MONTH = "EXPIRATION_MONTH",
|
|
400
|
+
EXPIRATION_YEAR = "EXPIRATION_YEAR",
|
|
401
|
+
EXPIRATION_DATE = "EXPIRATION_DATE",
|
|
402
|
+
CARD_FORM = "CARD_FORM"
|
|
546
403
|
}
|
|
547
404
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
405
|
+
type FieldErrors = Partial<Record<'cardNumber' | 'expiry' | 'cvv' | 'holderName', string>>;
|
|
406
|
+
type ValidateCardFormResult = {
|
|
407
|
+
isValid: boolean;
|
|
408
|
+
error?: string;
|
|
409
|
+
fieldErrors?: FieldErrors;
|
|
410
|
+
};
|
|
411
|
+
interface EncryptedCollectResult {
|
|
412
|
+
vaultProviderConfigId: string;
|
|
413
|
+
encryptedData: string;
|
|
414
|
+
}
|
|
415
|
+
interface CollectElementOptions {
|
|
416
|
+
type: ElementType;
|
|
417
|
+
label?: string;
|
|
418
|
+
placeholder?: string;
|
|
419
|
+
altText?: string;
|
|
420
|
+
format?: string;
|
|
421
|
+
inputStyles?: object;
|
|
422
|
+
labelStyles?: object;
|
|
423
|
+
errorTextStyles?: object;
|
|
424
|
+
required?: boolean;
|
|
425
|
+
enableCardIcon?: boolean;
|
|
426
|
+
translations?: {
|
|
427
|
+
error?: {
|
|
428
|
+
default?: string;
|
|
571
429
|
};
|
|
572
430
|
};
|
|
573
|
-
execution?: WorkflowExecutionResponse;
|
|
574
|
-
featureConfig?: SdkFeatureConfig;
|
|
575
431
|
}
|
|
576
|
-
|
|
577
|
-
|
|
432
|
+
type PayrailsContainerType = 'COLLECT' | 'COMPOSABLE';
|
|
433
|
+
interface CollectContainerOptions {
|
|
434
|
+
layout?: number[];
|
|
435
|
+
cardTableName?: string;
|
|
436
|
+
containerType?: PayrailsContainerType;
|
|
437
|
+
containerId?: string;
|
|
438
|
+
styles?: {
|
|
439
|
+
base?: Partial<CSSStyleDeclaration>;
|
|
440
|
+
};
|
|
441
|
+
errorTextStyles?: {
|
|
442
|
+
base?: Partial<CSSStyleDeclaration>;
|
|
443
|
+
};
|
|
444
|
+
fonts?: FontDescriptor[];
|
|
578
445
|
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
446
|
+
type PayrailsSecureFieldEvent = 'CHANGE' | 'FOCUS' | 'BLUR' | 'READY' | 'SUBMIT';
|
|
447
|
+
interface PayrailsSecureField {
|
|
448
|
+
on(eventName: PayrailsSecureFieldEvent, handler: any): void;
|
|
449
|
+
mount?: (domElement: any) => void;
|
|
450
|
+
unmount?: () => void;
|
|
451
|
+
focus: () => void;
|
|
452
|
+
getState?: () => {
|
|
453
|
+
isEmpty: boolean;
|
|
454
|
+
isComplete: boolean;
|
|
455
|
+
isValid: boolean;
|
|
456
|
+
isFocused: boolean;
|
|
457
|
+
value: unknown;
|
|
458
|
+
required: boolean;
|
|
459
|
+
};
|
|
460
|
+
setError?: (clientErrorText: string) => void;
|
|
461
|
+
resetError?: () => void;
|
|
462
|
+
update?: (data: Partial<CollectElementOptions>) => void;
|
|
463
|
+
setAttribute: (attribute: string, value: string | number) => void;
|
|
582
464
|
}
|
|
583
|
-
interface
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
465
|
+
interface FramesContainer extends Mountable {
|
|
466
|
+
createCollectElement: (options: CollectElementOptions) => PayrailsSecureField;
|
|
467
|
+
fetchBinLookup: (bin: string) => Promise<{
|
|
468
|
+
bin: string;
|
|
469
|
+
}>;
|
|
470
|
+
validate: () => Promise<ValidateCardFormResult>;
|
|
471
|
+
collect: () => Promise<EncryptedCollectResult>;
|
|
472
|
+
tokenize: (opts: TokenizeOptions) => Promise<any>;
|
|
473
|
+
reset: () => void;
|
|
474
|
+
bin: string;
|
|
475
|
+
isBinLookupEnabled: boolean;
|
|
476
|
+
readonly id: string;
|
|
477
|
+
readonly dataTestId: string;
|
|
478
|
+
readonly className: string;
|
|
588
479
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
480
|
+
declare class PayrailsCollectContainer implements FramesContainer {
|
|
481
|
+
bin: string;
|
|
482
|
+
isBinLookupEnabled: boolean;
|
|
483
|
+
readonly id = "payrails-container-wrapper";
|
|
484
|
+
readonly dataTestId = "payrails-container-wrapper";
|
|
485
|
+
readonly className = "payrails-container-wrapper";
|
|
486
|
+
private static instance;
|
|
487
|
+
private readonly __container;
|
|
488
|
+
private element;
|
|
489
|
+
private readonly cardTableName;
|
|
490
|
+
private readonly containerType;
|
|
491
|
+
private manualErrorElements;
|
|
492
|
+
constructor(__client: Skyflow, options: CollectContainerOptions);
|
|
493
|
+
static init(vaultClient: Skyflow, options: CollectContainerOptions): PayrailsCollectContainer;
|
|
494
|
+
createCollectElement(options: CollectElementOptions): PayrailsSecureField;
|
|
495
|
+
mount(selector: string): void;
|
|
496
|
+
unmount(): void;
|
|
497
|
+
validate(): Promise<ValidateCardFormResult>;
|
|
498
|
+
collect(): Promise<EncryptedCollectResult>;
|
|
499
|
+
reset(): void;
|
|
500
|
+
private collectPayrailsData;
|
|
501
|
+
tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
|
|
502
|
+
private attachCustomEventHandler;
|
|
503
|
+
private formatBin;
|
|
504
|
+
private get elementToFieldMap();
|
|
505
|
+
fetchBinLookup: (bin: string) => Promise<BinLookupResponse | {
|
|
506
|
+
bin: string;
|
|
507
|
+
}>;
|
|
592
508
|
}
|
|
593
509
|
|
|
594
|
-
|
|
595
|
-
success?: string;
|
|
596
|
-
cancel?: string;
|
|
597
|
-
error?: string;
|
|
598
|
-
pending?: string;
|
|
599
|
-
}
|
|
600
|
-
interface PayoutResponse {
|
|
601
|
-
name: 'payout';
|
|
602
|
-
executedAt: string;
|
|
603
|
-
workspaceId: string;
|
|
604
|
-
actionId: string;
|
|
605
|
-
links: {
|
|
606
|
-
execution: string;
|
|
607
|
-
};
|
|
608
|
-
}
|
|
609
|
-
type PayoutComposition = Array<{
|
|
610
|
-
integrationType: string;
|
|
611
|
-
amount: PayrailsAmount;
|
|
612
|
-
paymentMethodCode: PaymentMethodCode;
|
|
613
|
-
paymentInstrumentId?: string;
|
|
614
|
-
}>;
|
|
615
|
-
interface PayoutReqBody {
|
|
616
|
-
amount: PayrailsAmount;
|
|
617
|
-
payoutComposition: PayoutComposition;
|
|
618
|
-
}
|
|
619
|
-
type ERROR_RESULT = 'Unknown' | 'UnexpectedProviderResponse' | 'ProviderUnknownError' | 'ProviderConnectionError' | 'Timeout' | 'ProviderTimeout' | 'GenericRejection' | 'DuplicateOperation' | 'OperationNotAllowed' | 'NetworkTransactionReferenceRejected' | 'PayerCanceled' | 'LimitExceeded' | 'InstrumentNotAllowed' | 'InvalidInstrument' | 'InsufficientBalance' | 'BlockedInstrument' | 'ExpiredInstrument' | 'ValidationError' | 'ParamsError' | 'ProviderConfigError' | 'InvalidSignature' | 'InternalServerError' | 'AuthenticationError' | 'PaymentMethodNotSupported' | 'PayerAuthenticationRequired' | 'PayerAuthenticationFailed' | 'FraudRisk';
|
|
510
|
+
declare const UI_POSITION_FIELD = "ui:position";
|
|
620
511
|
|
|
621
|
-
type
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
off?: (...args: any[]) => unknown;
|
|
512
|
+
type JSONSchemaType = JSONSchemaProperty & {
|
|
513
|
+
required?: string[];
|
|
514
|
+
dependentSchemas?: Record<string, JSONSchemaDependentSchema>;
|
|
625
515
|
};
|
|
626
|
-
interface
|
|
627
|
-
|
|
628
|
-
|
|
516
|
+
interface JSONSchemaOneOfOption {
|
|
517
|
+
const: string | number;
|
|
518
|
+
title: string;
|
|
629
519
|
}
|
|
630
|
-
interface
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
520
|
+
interface JSONSchemaDependentSchema {
|
|
521
|
+
oneOf: Array<{
|
|
522
|
+
properties: Record<string, {
|
|
523
|
+
const: string | number;
|
|
524
|
+
}>;
|
|
525
|
+
required: string[];
|
|
526
|
+
}>;
|
|
635
527
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
unmount(): void;
|
|
528
|
+
interface JSONSchemaProperty {
|
|
529
|
+
type?: 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
530
|
+
title?: string;
|
|
531
|
+
oneOf?: JSONSchemaOneOfOption[];
|
|
532
|
+
pattern?: string;
|
|
533
|
+
minLength?: number;
|
|
534
|
+
maxLength?: number;
|
|
535
|
+
errorMessage?: Record<string, string>;
|
|
536
|
+
$ref?: string;
|
|
537
|
+
[UI_POSITION_FIELD]?: number;
|
|
538
|
+
properties?: Record<string, JSONSchemaType>;
|
|
648
539
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
code?: string;
|
|
653
|
-
fullName?: string;
|
|
654
|
-
iso3?: string;
|
|
655
|
-
};
|
|
656
|
-
postalCode?: string;
|
|
540
|
+
interface DynamicElementEvents {
|
|
541
|
+
onReady?: () => void;
|
|
542
|
+
onValidationChange?: (isValid: boolean) => void;
|
|
657
543
|
}
|
|
658
|
-
interface
|
|
659
|
-
|
|
660
|
-
|
|
544
|
+
interface DynamicElementFieldEvents {
|
|
545
|
+
onChange: (value: any) => void;
|
|
546
|
+
onReady: (initialValue: any) => void;
|
|
547
|
+
onBlur: () => void;
|
|
661
548
|
}
|
|
662
|
-
interface
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
postalCodeInput?: string;
|
|
667
|
-
};
|
|
668
|
-
placeholders?: {
|
|
669
|
-
postalCodeInput?: string;
|
|
670
|
-
countrySelector?: string;
|
|
671
|
-
};
|
|
672
|
-
};
|
|
673
|
-
styles?: {
|
|
674
|
-
wrapper?: Partial<CSSStyleDeclaration>;
|
|
675
|
-
countrySelector?: {
|
|
676
|
-
wrapper?: Partial<CSSStyleDeclaration>;
|
|
677
|
-
element?: Partial<CSSStyleDeclaration>;
|
|
678
|
-
label?: Partial<CSSStyleDeclaration>;
|
|
679
|
-
};
|
|
680
|
-
postalCodeInput?: {
|
|
681
|
-
wrapper?: Partial<CSSStyleDeclaration>;
|
|
682
|
-
element?: Partial<CSSStyleDeclaration>;
|
|
683
|
-
label?: Partial<CSSStyleDeclaration>;
|
|
684
|
-
};
|
|
685
|
-
};
|
|
686
|
-
events?: {
|
|
687
|
-
onBillingAddressChanged?: (e: IOnChange) => void;
|
|
688
|
-
};
|
|
549
|
+
interface DynamicElementFieldTranslation {
|
|
550
|
+
label?: string;
|
|
551
|
+
placeholder?: string;
|
|
552
|
+
errors?: Partial<DynamicElementErrorTranslation>;
|
|
689
553
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
554
|
+
interface DynamicElementErrorTranslation {
|
|
555
|
+
required: string;
|
|
556
|
+
minLength: string;
|
|
557
|
+
maxLength: string;
|
|
558
|
+
pattern: string;
|
|
559
|
+
oneOf: string;
|
|
560
|
+
}
|
|
561
|
+
type DynamicElementTranslations = {
|
|
562
|
+
fields?: Record<string, DynamicElementFieldTranslation>;
|
|
563
|
+
errors?: Partial<DynamicElementErrorTranslation>;
|
|
564
|
+
};
|
|
565
|
+
interface DynamicElementElementStyles {
|
|
566
|
+
base?: Partial<CSSStyleDeclaration>;
|
|
567
|
+
complete?: Partial<CSSStyleDeclaration>;
|
|
568
|
+
empty?: Partial<CSSStyleDeclaration>;
|
|
569
|
+
focus?: Partial<CSSStyleDeclaration>;
|
|
570
|
+
invalid?: Partial<CSSStyleDeclaration>;
|
|
571
|
+
}
|
|
572
|
+
type DynamicElementInputFieldStyles = DynamicElementElementStyles;
|
|
573
|
+
type DynamicElementSelectFieldStyles = DynamicElementElementStyles;
|
|
574
|
+
interface DynamicElementTabsFieldStyles {
|
|
575
|
+
tab: {
|
|
576
|
+
base?: Partial<CSSStyleDeclaration>;
|
|
577
|
+
active?: Partial<CSSStyleDeclaration>;
|
|
703
578
|
};
|
|
704
|
-
|
|
579
|
+
container?: DynamicElementElementStyles;
|
|
705
580
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
581
|
+
interface DynamicElementFieldStyles {
|
|
582
|
+
base?: Partial<CSSStyleDeclaration>;
|
|
583
|
+
label?: Partial<CSSStyleDeclaration>;
|
|
584
|
+
errors?: Partial<CSSStyleDeclaration>;
|
|
585
|
+
input?: DynamicElementInputFieldStyles;
|
|
586
|
+
select?: DynamicElementSelectFieldStyles;
|
|
587
|
+
tabs?: DynamicElementTabsFieldStyles;
|
|
713
588
|
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
protected constructor(elementType: string, options?: StoreInstrumentElementOptions | undefined);
|
|
718
|
-
protected get shouldStoreInstrument(): boolean;
|
|
589
|
+
interface DynamicElementStyles {
|
|
590
|
+
all: Omit<DynamicElementFieldStyles, 'label'>;
|
|
591
|
+
fields?: Record<string, DynamicElementFieldStyles>;
|
|
719
592
|
}
|
|
720
593
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
*
|
|
766
|
-
* `amount` is passed in (rather than read from `getSDKConfig()`) so the
|
|
767
|
-
* response carries the same total the session was created with, even if
|
|
768
|
-
* the SDK config is mutated mid-flow.
|
|
769
|
-
*/
|
|
770
|
-
private onApplePayShippingContactSelected;
|
|
771
|
-
private onApplePayAuthorized;
|
|
772
|
-
private doAuthorizedPayment;
|
|
773
|
-
private doTokenize;
|
|
594
|
+
declare enum PAYMENT_METHOD_CODES {
|
|
595
|
+
'CARD' = "card",
|
|
596
|
+
'GOOGLE_PAY' = "googlePay",
|
|
597
|
+
'PAYPAL' = "payPal",
|
|
598
|
+
'APPLE_PAY' = "applePay",
|
|
599
|
+
'GENERIC_REDIRECT' = "genericRedirect",
|
|
600
|
+
'LEAN' = "lean",
|
|
601
|
+
'MERCADO_PAGO' = "mercadoPago",
|
|
602
|
+
'PIX' = "pix",
|
|
603
|
+
'BANK_ACCOUNT' = "bankAccount",
|
|
604
|
+
'IDEAL' = "iDeal",
|
|
605
|
+
'YAPE' = "yape",
|
|
606
|
+
'UPI' = "upi",
|
|
607
|
+
'KLARNA' = "klarna",
|
|
608
|
+
'ONE_VOUCHER' = "1voucher",
|
|
609
|
+
'ALFA' = "alfa",
|
|
610
|
+
'APLAZO' = "aplazo",
|
|
611
|
+
'BANK_TRANSFER' = "bankTransfer",
|
|
612
|
+
'CAPITEC_PAY' = "capitecPay",
|
|
613
|
+
'EASYPAISA' = "easypaisa",
|
|
614
|
+
'EFT_PRO' = "eftPro",
|
|
615
|
+
'FAWRY_PAY' = "fawryPay",
|
|
616
|
+
'JAZZ_CASH' = "jazzCash",
|
|
617
|
+
'KONNECT' = "konnect",
|
|
618
|
+
'KUESKI' = "kueski",
|
|
619
|
+
'MONO_DIRECT_DEBIT' = "monoDirectDebit",
|
|
620
|
+
'O_PAY_WALLET' = "oPayWallet",
|
|
621
|
+
'PAGA_WALLET' = "pagaWallet",
|
|
622
|
+
'PAYFLEX' = "payflex",
|
|
623
|
+
'PAY_JUST_NOW' = "payjustnow",
|
|
624
|
+
'WAFA_CASH_WALLET' = "wafaCashWallet",
|
|
625
|
+
'MERCADO_PAGO_WALLET' = "mercadoPagoWallet",
|
|
626
|
+
'MERCADO_PAGO_CONSUMER_CREDIT' = "mercadoPagoConsumerCredit",
|
|
627
|
+
'NET_BANKING' = "netBanking",
|
|
628
|
+
'CASH_FREE_WALLET' = "cashFreeWallet",
|
|
629
|
+
'PAYTM_WALLET' = "paytmWallet",
|
|
630
|
+
'NIBSS_PAY' = "nibssPay",
|
|
631
|
+
'NIBSS_INSTANT_PAY' = "nibssInstantPay",
|
|
632
|
+
'MEEZA_WALLET' = "meezaWallet",
|
|
633
|
+
'VODAFONE_CASH' = "vodafoneCash",
|
|
634
|
+
'SEPA_DIRECT_DEBIT' = "sepaDirectDebit",
|
|
635
|
+
'MODO' = "modo",
|
|
636
|
+
'PAYZONE_CASH' = "payzoneCash",
|
|
637
|
+
'REVOLUT_PAY' = "revolutPay"
|
|
774
638
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
639
|
+
declare const PAYMENT_METHOD_CODE_BY_METHOD: { readonly [K in keyof typeof PAYMENT_METHOD_CODES]: (typeof PAYMENT_METHOD_CODES)[K]; };
|
|
640
|
+
type PaymentMethodCode = PAYMENT_METHOD_CODES | (typeof PAYMENT_METHOD_CODE_BY_METHOD)[keyof typeof PAYMENT_METHOD_CODE_BY_METHOD] | (string & {});
|
|
641
|
+
declare enum PAYMENT_INSTRUMENT_STATUS {
|
|
642
|
+
'ENABLED' = "enabled",
|
|
643
|
+
'CREATED' = "created",
|
|
644
|
+
'DELETED' = "deleted",
|
|
645
|
+
'DISABLED' = "disabled",
|
|
646
|
+
'INVALID' = "invalid",
|
|
647
|
+
'TRANSIENT' = "transient"
|
|
648
|
+
}
|
|
649
|
+
type ExecutionMetaKey = keyof ExecutionMetaByKey;
|
|
650
|
+
interface ExecutionMetaCustomer {
|
|
651
|
+
phone?: {
|
|
652
|
+
countryCode?: string;
|
|
653
|
+
number?: string;
|
|
654
|
+
};
|
|
655
|
+
country?: {
|
|
782
656
|
name?: string;
|
|
657
|
+
code?: string;
|
|
783
658
|
iso3?: string;
|
|
784
659
|
};
|
|
660
|
+
reference?: string;
|
|
661
|
+
name?: string;
|
|
662
|
+
lastName?: string;
|
|
663
|
+
email?: string;
|
|
785
664
|
type?: string;
|
|
665
|
+
birthDate?: string;
|
|
666
|
+
language?: string;
|
|
667
|
+
identityCardNumber?: string;
|
|
786
668
|
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
669
|
+
interface ExecutionMetaOrder {
|
|
670
|
+
billingAddress?: {
|
|
671
|
+
country?: {
|
|
672
|
+
name?: string;
|
|
673
|
+
code?: string;
|
|
674
|
+
iso3?: string;
|
|
675
|
+
};
|
|
676
|
+
};
|
|
793
677
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
678
|
+
type ExecutionMetaByKey = {
|
|
679
|
+
customer: ExecutionMetaCustomer;
|
|
680
|
+
};
|
|
681
|
+
type ExecutionMetaUpdate = {
|
|
682
|
+
[Key in ExecutionMetaKey]: {
|
|
683
|
+
key: Key;
|
|
684
|
+
value: ExecutionMetaByKey[Key];
|
|
685
|
+
};
|
|
686
|
+
}[ExecutionMetaKey];
|
|
687
|
+
interface ExecutionMeta {
|
|
688
|
+
customer?: ExecutionMetaCustomer;
|
|
689
|
+
order?: ExecutionMetaOrder;
|
|
800
690
|
}
|
|
801
|
-
declare
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
691
|
+
declare class WorkflowExecution {
|
|
692
|
+
private static _updatedMetaKeys;
|
|
693
|
+
private static _response;
|
|
694
|
+
static get response(): WorkflowExecutionResponse;
|
|
695
|
+
static setResponse(response: WorkflowExecutionResponse): typeof WorkflowExecution;
|
|
696
|
+
/**
|
|
697
|
+
* Non-throwing read of the current execution id. Returns `undefined` when
|
|
698
|
+
* the workflow execution hasn't been initialized yet. Prefer this over
|
|
699
|
+
* `WorkflowExecution.response.id` in observational code paths (event
|
|
700
|
+
* emission, logging, analytics) where the workflow not being loaded should
|
|
701
|
+
* degrade gracefully instead of throwing.
|
|
702
|
+
*/
|
|
703
|
+
static get executionId(): string | undefined;
|
|
704
|
+
static get workflowCode(): string;
|
|
705
|
+
static get lookup(): {
|
|
706
|
+
httpCode: number;
|
|
707
|
+
body: {
|
|
708
|
+
data: {
|
|
709
|
+
paymentCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
710
|
+
payoutCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
711
|
+
};
|
|
712
|
+
links: {
|
|
713
|
+
execution: string;
|
|
714
|
+
authorize?: {
|
|
715
|
+
href: string;
|
|
716
|
+
method: "POST";
|
|
717
|
+
};
|
|
718
|
+
payout?: {
|
|
719
|
+
href: string;
|
|
720
|
+
method: "POST";
|
|
721
|
+
};
|
|
722
|
+
startPaymentSession?: {
|
|
723
|
+
href: string;
|
|
724
|
+
method: "POST";
|
|
725
|
+
};
|
|
726
|
+
createInstrument?: {
|
|
727
|
+
href: string;
|
|
728
|
+
method: "POST";
|
|
729
|
+
};
|
|
730
|
+
};
|
|
731
|
+
name: "lookup";
|
|
732
|
+
};
|
|
733
|
+
} | undefined;
|
|
734
|
+
static get holderReference(): string;
|
|
735
|
+
static get savedCreditCards(): StoredPaymentInstrument<CardMetadata>[];
|
|
736
|
+
static get savedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
|
|
737
|
+
static get savedGooglePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
|
|
738
|
+
static get savedApplePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
|
|
739
|
+
static get paypalConfig(): PayPalConfig;
|
|
740
|
+
static get googlePayConfig(): any;
|
|
741
|
+
static isPaymentMethodAvailable(paymentMethod: PaymentMethodCode): boolean;
|
|
742
|
+
static get applePayConfig(): {
|
|
743
|
+
merchantIdentifier: string;
|
|
744
|
+
supportedNetworks: string[];
|
|
745
|
+
countryCode: string;
|
|
746
|
+
merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
|
|
747
|
+
requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
748
|
+
requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
749
|
+
};
|
|
750
|
+
static get url(): string;
|
|
751
|
+
static get meta(): ExecutionMeta;
|
|
752
|
+
static get availablePaymentMethods(): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig | undefined>[];
|
|
753
|
+
static get authorizeLink(): string | undefined;
|
|
754
|
+
static get payoutLink(): string | undefined;
|
|
755
|
+
static get createSessionLink(): string | undefined;
|
|
756
|
+
static get createInstrumentLink(): string | undefined;
|
|
757
|
+
static get storedPaymentInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
758
|
+
static get storedDropinInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
759
|
+
static getFullPaymentMethodConfig(paymentMethod: PaymentMethodCode): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig | undefined> | undefined;
|
|
760
|
+
static isAddressSelectorEnabled(paymentMethod: PaymentMethodCode): boolean | undefined;
|
|
761
|
+
static isPaymentInstallmentsEnabled(paymentMethod: PaymentMethodCode): boolean | undefined;
|
|
762
|
+
static getPaymentInstallmentOptions(paymentMethod: PaymentMethodCode): PaymentInstallmentsConfig;
|
|
763
|
+
static getStoredInstrumentForPaymentMethod<T = CardMetadata | PayPalMetadata>(paymentMethod: PaymentMethodCode): Array<StoredPaymentInstrument<T>>;
|
|
764
|
+
static getPaymentMethodForStoredInstrument<T extends CardMetadata | PayPalMetadata>(instrument: StoredPaymentInstrument<T>): {
|
|
765
|
+
id: string;
|
|
766
|
+
description?: string;
|
|
767
|
+
status: PAYMENT_INSTRUMENT_STATUS;
|
|
768
|
+
integrationType: INTEGRATION_TYPE;
|
|
769
|
+
config: ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig | undefined;
|
|
770
|
+
clientConfig?: {
|
|
771
|
+
flow?: PAYMENT_CLIENT_FLOW;
|
|
772
|
+
displayName?: string;
|
|
773
|
+
supportsInstallments?: boolean;
|
|
774
|
+
installments?: PaymentInstallmentsConfig;
|
|
775
|
+
supportsBillingInfo?: boolean;
|
|
776
|
+
schema?: JSONSchemaType;
|
|
777
|
+
additionalConfig?: any;
|
|
778
|
+
instrumentDataSchema?: JSONSchemaType;
|
|
779
|
+
};
|
|
780
|
+
payoutInstruments?: StoredPaymentInstrument<CardMetadata | PayPalMetadata>[] | undefined;
|
|
781
|
+
paymentMethodCode: PaymentMethodCode;
|
|
782
|
+
payoutMethodCode?: PaymentMethodCode;
|
|
783
|
+
} | undefined;
|
|
784
|
+
static getPaymentMethodConfig(paymentMethod: StorablePaymentCompositionOption): {
|
|
785
|
+
id: string;
|
|
786
|
+
description?: string;
|
|
787
|
+
status: PAYMENT_INSTRUMENT_STATUS;
|
|
788
|
+
integrationType: INTEGRATION_TYPE;
|
|
789
|
+
config: ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig | undefined;
|
|
790
|
+
clientConfig?: {
|
|
791
|
+
flow?: PAYMENT_CLIENT_FLOW;
|
|
792
|
+
displayName?: string;
|
|
793
|
+
supportsInstallments?: boolean;
|
|
794
|
+
installments?: PaymentInstallmentsConfig;
|
|
795
|
+
supportsBillingInfo?: boolean;
|
|
796
|
+
schema?: JSONSchemaType;
|
|
797
|
+
additionalConfig?: any;
|
|
798
|
+
instrumentDataSchema?: JSONSchemaType;
|
|
799
|
+
};
|
|
800
|
+
payoutInstruments?: StoredPaymentInstrument<CardMetadata | PayPalMetadata>[] | undefined;
|
|
801
|
+
paymentMethodCode: PaymentMethodCode;
|
|
802
|
+
payoutMethodCode?: PaymentMethodCode;
|
|
803
|
+
};
|
|
804
|
+
static updateInstallmentOptions(installmentOptions?: PaymentInstallmentsConfig): void;
|
|
805
|
+
static updateMeta<K extends ExecutionMetaKey>(key: K, value: ExecutionMetaByKey[K]): void;
|
|
806
|
+
static getAllowedMeta(): ExecutionMeta;
|
|
807
|
+
static getUpdatedMeta(): ExecutionMeta;
|
|
808
|
+
private static pickMetaByKeys;
|
|
809
|
+
}
|
|
810
|
+
interface WorkflowExecutionResponse {
|
|
811
|
+
id: string;
|
|
812
|
+
merchantReference: string;
|
|
813
|
+
holderReference: string;
|
|
814
|
+
holderId?: string;
|
|
815
|
+
actionRequired?: string;
|
|
816
|
+
meta: ExecutionMeta;
|
|
817
|
+
status: Array<{
|
|
818
|
+
code: string;
|
|
819
|
+
time: string;
|
|
820
|
+
}>;
|
|
821
|
+
initialResults: Array<{
|
|
822
|
+
httpCode: number;
|
|
823
|
+
body: {
|
|
824
|
+
data: {
|
|
825
|
+
paymentCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
826
|
+
payoutCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
827
|
+
};
|
|
828
|
+
links: {
|
|
829
|
+
execution: string;
|
|
830
|
+
authorize?: {
|
|
831
|
+
href: string;
|
|
832
|
+
method: 'POST';
|
|
833
|
+
};
|
|
834
|
+
payout?: {
|
|
835
|
+
href: string;
|
|
836
|
+
method: 'POST';
|
|
837
|
+
};
|
|
838
|
+
startPaymentSession?: {
|
|
839
|
+
href: string;
|
|
840
|
+
method: 'POST';
|
|
841
|
+
};
|
|
842
|
+
createInstrument?: {
|
|
843
|
+
href: string;
|
|
844
|
+
method: 'POST';
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
name: 'lookup';
|
|
848
|
+
};
|
|
849
|
+
}>;
|
|
850
|
+
links: {
|
|
851
|
+
startPaymentSession?: {
|
|
852
|
+
href: string;
|
|
853
|
+
method: 'POST';
|
|
854
|
+
};
|
|
855
|
+
createInstrument?: {
|
|
856
|
+
href: string;
|
|
857
|
+
method: 'POST';
|
|
858
|
+
};
|
|
859
|
+
confirm?: {
|
|
860
|
+
href: string;
|
|
861
|
+
action?: {
|
|
862
|
+
parameters?: {
|
|
863
|
+
orderId?: string;
|
|
864
|
+
tokenId?: string;
|
|
865
|
+
};
|
|
866
|
+
paymentId?: string;
|
|
867
|
+
sdkToken?: string;
|
|
868
|
+
appToken?: string;
|
|
869
|
+
successUrl?: string;
|
|
870
|
+
failureUrl?: string;
|
|
871
|
+
sandbox?: boolean;
|
|
872
|
+
};
|
|
873
|
+
};
|
|
874
|
+
redirect?: string;
|
|
875
|
+
'3ds'?: string;
|
|
876
|
+
self: string;
|
|
877
|
+
};
|
|
878
|
+
workflow: {
|
|
879
|
+
code: string;
|
|
880
|
+
version: number;
|
|
881
|
+
};
|
|
807
882
|
}
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
DEBUG = "DEBUG",
|
|
812
|
-
ERROR = "ERROR"
|
|
883
|
+
interface BasePaymentMethodConfig {
|
|
884
|
+
paymentMethodCode: PaymentMethodCode;
|
|
885
|
+
payoutMethodCode?: PaymentMethodCode;
|
|
813
886
|
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
887
|
+
interface BaseInstallmentOption {
|
|
888
|
+
count: number;
|
|
889
|
+
amount: number;
|
|
817
890
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
LENGTH_MATCH_RULE = "LENGTH_MATCH_RULE",
|
|
821
|
-
ELEMENT_VALUE_MATCH_RULE = "ELEMENT_VALUE_MATCH_RULE"
|
|
891
|
+
interface PaymentInstallmentsConfig {
|
|
892
|
+
[key: string]: BaseInstallmentOption[];
|
|
822
893
|
}
|
|
823
|
-
interface
|
|
824
|
-
|
|
894
|
+
interface InstallmentUpdateConfig {
|
|
895
|
+
defaultInstallment?: number | null;
|
|
896
|
+
installmentCountry?: string | null;
|
|
897
|
+
installmentOptions?: BaseInstallmentOption[] | null;
|
|
825
898
|
}
|
|
826
|
-
interface
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
899
|
+
interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C = undefined | ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig> extends BasePaymentMethodConfig {
|
|
900
|
+
id: string;
|
|
901
|
+
description?: string;
|
|
902
|
+
status: PAYMENT_INSTRUMENT_STATUS;
|
|
903
|
+
integrationType: INTEGRATION_TYPE;
|
|
904
|
+
config: C;
|
|
905
|
+
clientConfig?: {
|
|
906
|
+
flow?: PAYMENT_CLIENT_FLOW;
|
|
907
|
+
displayName?: string;
|
|
908
|
+
supportsInstallments?: boolean;
|
|
909
|
+
installments?: PaymentInstallmentsConfig;
|
|
910
|
+
supportsBillingInfo?: boolean;
|
|
911
|
+
schema?: JSONSchemaType;
|
|
912
|
+
additionalConfig?: any;
|
|
913
|
+
instrumentDataSchema?: JSONSchemaType;
|
|
914
|
+
};
|
|
915
|
+
paymentInstruments?: Array<StoredPaymentInstrument<I>>;
|
|
916
|
+
payoutInstruments?: Array<StoredPaymentInstrument<I>>;
|
|
830
917
|
}
|
|
831
|
-
interface
|
|
832
|
-
|
|
833
|
-
|
|
918
|
+
interface GooglePayWorkflowConfig {
|
|
919
|
+
parameters: {
|
|
920
|
+
allowedAuthMethods: google.payments.api.CardAuthMethod[];
|
|
921
|
+
allowedCardNetworks: google.payments.api.CardNetwork[];
|
|
922
|
+
billingAddressParameters?: {
|
|
923
|
+
format?: string;
|
|
924
|
+
};
|
|
925
|
+
billingAddressRequired?: boolean;
|
|
926
|
+
};
|
|
927
|
+
tokenizationSpecification: google.payments.api.PaymentMethodTokenizationSpecification;
|
|
928
|
+
type: google.payments.api.PaymentMethodType;
|
|
929
|
+
apiVersion?: number;
|
|
930
|
+
apiVersionMinor?: number;
|
|
931
|
+
allowedPaymentMethods?: google.payments.api.PaymentMethodSpecification[];
|
|
932
|
+
emailRequired?: boolean;
|
|
933
|
+
shippingAddressRequired?: boolean;
|
|
934
|
+
shippingAddressParameters?: google.payments.api.ShippingAddressParameters;
|
|
935
|
+
merchantInfo?: google.payments.api.MerchantInfo;
|
|
936
|
+
existingPaymentMethodRequired?: boolean;
|
|
834
937
|
}
|
|
835
|
-
interface
|
|
836
|
-
|
|
837
|
-
|
|
938
|
+
interface PayPalConfig {
|
|
939
|
+
clientId: string;
|
|
940
|
+
merchantId: string;
|
|
941
|
+
captureMode: 'Delayed' | 'Instant' | 'Manual';
|
|
942
|
+
integrationMode: 'express' | 'normal';
|
|
838
943
|
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
944
|
+
interface ApplePayConfig {
|
|
945
|
+
parameters: {
|
|
946
|
+
merchantIdentifier: string;
|
|
947
|
+
supportedNetworks: string[];
|
|
948
|
+
countryCode: string;
|
|
949
|
+
merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
|
|
950
|
+
requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
951
|
+
requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
952
|
+
};
|
|
953
|
+
type: string;
|
|
843
954
|
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
955
|
+
interface StoredPaymentInstrument<T = CardMetadata | PayPalMetadata | BankAccountMetadata> {
|
|
956
|
+
id: string;
|
|
957
|
+
status: PAYMENT_INSTRUMENT_STATUS;
|
|
958
|
+
paymentMethod: PaymentMethodCode;
|
|
959
|
+
displayName?: string;
|
|
960
|
+
data?: T;
|
|
961
|
+
default?: boolean;
|
|
962
|
+
createdAt?: string;
|
|
963
|
+
updatedAt?: string;
|
|
964
|
+
holderId?: string;
|
|
965
|
+
fingerprint?: string;
|
|
966
|
+
futureUsage?: FutureUsages;
|
|
854
967
|
}
|
|
855
|
-
|
|
856
|
-
|
|
968
|
+
interface PayPalMetadata {
|
|
969
|
+
email?: string;
|
|
857
970
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
callback: Function;
|
|
863
|
-
}[]>;
|
|
864
|
-
constructor();
|
|
865
|
-
on(event: string, callback: Function, priority?: boolean): void;
|
|
866
|
-
off(event: string, callback: Function): void;
|
|
867
|
-
_emit(event: string, ...args: any[]): void;
|
|
868
|
-
hasListener(event: string): boolean;
|
|
869
|
-
resetEvents(): void;
|
|
870
|
-
static createChild(ChildObject: any): void;
|
|
971
|
+
interface Country {
|
|
972
|
+
code: string;
|
|
973
|
+
name: string;
|
|
974
|
+
iso3: string;
|
|
871
975
|
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
abstract getID(): any;
|
|
976
|
+
interface CardMetadata {
|
|
977
|
+
bin?: string;
|
|
978
|
+
suffix?: string;
|
|
979
|
+
network?: string;
|
|
980
|
+
binLookup?: {
|
|
981
|
+
issuerCountry: Country;
|
|
982
|
+
};
|
|
880
983
|
}
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
containerId: string;
|
|
887
|
-
constructor(elementId: string, elementGroup: any, metaData: any, container: any, isSingleElementAPI: boolean | undefined, destroyCallback: Function, updateCallback: Function, context: Context, groupEventEmitter?: EventEmitter);
|
|
888
|
-
getID: () => string;
|
|
889
|
-
mount: (domElement: any) => void;
|
|
890
|
-
unmount: () => void;
|
|
891
|
-
update: (group: any) => void;
|
|
892
|
-
updateElement: (elementOptions: any) => void;
|
|
893
|
-
getState: () => {
|
|
894
|
-
isEmpty: boolean;
|
|
895
|
-
isComplete: boolean;
|
|
896
|
-
isValid: boolean;
|
|
897
|
-
isFocused: boolean;
|
|
898
|
-
value: string | Object | Blob | undefined;
|
|
899
|
-
required: boolean;
|
|
984
|
+
interface BankAccountMetadata {
|
|
985
|
+
bankAccount: {
|
|
986
|
+
holder: HolderData;
|
|
987
|
+
bank: BankData;
|
|
988
|
+
account: AccountData;
|
|
900
989
|
};
|
|
901
|
-
getOptions: () => any;
|
|
902
|
-
on(eventName: string, handler: any): void;
|
|
903
|
-
iframeName(): string;
|
|
904
|
-
isMounted(): boolean;
|
|
905
|
-
isValidElement(): boolean;
|
|
906
|
-
setError(clientErrorText: string): void;
|
|
907
|
-
resetError(): void;
|
|
908
|
-
setValue(elementValue: string): void;
|
|
909
|
-
clearValue(): void;
|
|
910
|
-
setAttribute(attribute: string, value: string | number): void;
|
|
911
|
-
focus(): void;
|
|
912
990
|
}
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
type:
|
|
923
|
-
altText?: string;
|
|
924
|
-
validations?: IValidationRule[];
|
|
925
|
-
skyflowID?: string;
|
|
991
|
+
interface HolderData {
|
|
992
|
+
firstName?: string;
|
|
993
|
+
lastName?: string;
|
|
994
|
+
companyName?: string;
|
|
995
|
+
address?: Address;
|
|
996
|
+
email?: string;
|
|
997
|
+
dob?: string;
|
|
998
|
+
country?: Country;
|
|
999
|
+
city?: string;
|
|
1000
|
+
type: HolderType;
|
|
926
1001
|
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
1002
|
+
type HolderType = 'individual' | 'corporate';
|
|
1003
|
+
interface BankData {
|
|
1004
|
+
name?: string;
|
|
1005
|
+
branchCode?: string;
|
|
1006
|
+
code?: string;
|
|
1007
|
+
address?: Address;
|
|
1008
|
+
swiftCode?: string;
|
|
931
1009
|
}
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1010
|
+
interface AccountData {
|
|
1011
|
+
number?: string;
|
|
1012
|
+
iban?: string;
|
|
1013
|
+
currency?: string;
|
|
1014
|
+
type?: AccountType;
|
|
1015
|
+
country?: Country;
|
|
1016
|
+
}
|
|
1017
|
+
type AccountType = 'savings' | 'current';
|
|
1018
|
+
interface Address {
|
|
1019
|
+
country?: {
|
|
1020
|
+
code?: string;
|
|
1021
|
+
fullName?: string;
|
|
1022
|
+
iso3?: string;
|
|
1023
|
+
};
|
|
1024
|
+
postalCode?: string;
|
|
943
1025
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
* This mirrors Stripe-like font configuration where you can provide either a CSS URL that
|
|
949
|
-
* includes @font-face declarations (cssSrc) or provide full @font-face fields to be injected.
|
|
950
|
-
*
|
|
951
|
-
* Examples:
|
|
952
|
-
* - { cssSrc: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap' }
|
|
953
|
-
* - { family: 'Inter', src: 'https://cdn.example.com/fonts/Inter.woff2', weight: 400, style: 'normal', display: 'swap' }
|
|
954
|
-
*/
|
|
955
|
-
interface FontDescriptor {
|
|
956
|
-
cssSrc?: string;
|
|
957
|
-
family?: string;
|
|
958
|
-
src?: string;
|
|
959
|
-
style?: string;
|
|
960
|
-
weight?: string | number;
|
|
961
|
-
unicodeRange?: string;
|
|
962
|
-
display?: string;
|
|
1026
|
+
declare enum PAYMENT_CLIENT_FLOW {
|
|
1027
|
+
'REDIRECT' = "redirect",
|
|
1028
|
+
'DIRECT' = "direct",
|
|
1029
|
+
'EMBEDDED' = "embedded"
|
|
963
1030
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
type: string;
|
|
968
|
-
constructor(name: any, eventEmitter: any);
|
|
969
|
-
on(eventName: string, handler: any): void;
|
|
970
|
-
focus(): void;
|
|
971
|
-
update: (options: any) => void;
|
|
972
|
-
setAttribute(attribute: string, value: string | number): void;
|
|
1031
|
+
declare enum INTEGRATION_TYPE {
|
|
1032
|
+
API = "api",
|
|
1033
|
+
HPP = "hpp"
|
|
973
1034
|
}
|
|
974
1035
|
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1036
|
+
type FutureUsages = 'CardOnFile' | 'Subscription' | 'UnscheduledCardOnFile';
|
|
1037
|
+
interface SaveInstrumentResponse {
|
|
1038
|
+
id: string;
|
|
1039
|
+
createdAt: string;
|
|
1040
|
+
holderId: string;
|
|
1041
|
+
paymentMethod: PAYMENT_METHOD_CODES.CARD;
|
|
1042
|
+
status: PAYMENT_INSTRUMENT_STATUS;
|
|
1043
|
+
data: {
|
|
1044
|
+
bin: string;
|
|
1045
|
+
binLookup?: {
|
|
1046
|
+
bin: string;
|
|
1047
|
+
network: string;
|
|
1048
|
+
issuer?: string;
|
|
1049
|
+
issuerCountry?: {
|
|
1050
|
+
code?: string;
|
|
1051
|
+
name?: string;
|
|
1052
|
+
iso3?: string;
|
|
1053
|
+
};
|
|
1054
|
+
type?: string;
|
|
1055
|
+
};
|
|
1056
|
+
holderName?: string;
|
|
1057
|
+
network: string;
|
|
1058
|
+
suffix: string;
|
|
1059
|
+
expiryMonth?: string;
|
|
1060
|
+
expiryYear?: string;
|
|
1061
|
+
};
|
|
1062
|
+
fingerprint?: string;
|
|
1063
|
+
futureUsage?: string;
|
|
991
1064
|
}
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1065
|
+
|
|
1066
|
+
interface SdkConfiguration {
|
|
1067
|
+
token: string;
|
|
1068
|
+
amount: PayrailsAmount;
|
|
1069
|
+
holderReference: string;
|
|
1070
|
+
links?: {
|
|
1071
|
+
binLookup?: Links;
|
|
1072
|
+
instrumentDelete?: Links;
|
|
1073
|
+
instrumentUpdate?: Links;
|
|
1074
|
+
};
|
|
1075
|
+
type?: 'tokenization' | 'dropIn' | 'secureFields';
|
|
1076
|
+
vaultConfiguration: {
|
|
1077
|
+
cardTableName: string;
|
|
1078
|
+
token: string;
|
|
1079
|
+
vaultId: string;
|
|
1080
|
+
vaultUrl: string;
|
|
1081
|
+
providerId: string;
|
|
1082
|
+
providerConfigId: string;
|
|
1083
|
+
vaultType: 'Payrails' | 'Test';
|
|
1084
|
+
encryptionPublicKey?: string;
|
|
1085
|
+
links: {
|
|
1086
|
+
saveInstrument: {
|
|
1087
|
+
href: string;
|
|
1088
|
+
};
|
|
1089
|
+
};
|
|
1090
|
+
};
|
|
1091
|
+
execution?: WorkflowExecutionResponse;
|
|
1092
|
+
featureConfig?: SdkFeatureConfig;
|
|
1093
|
+
morData?: MorData;
|
|
1000
1094
|
}
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
type: string;
|
|
1013
|
-
private bus;
|
|
1014
|
-
private iframe;
|
|
1015
|
-
/**
|
|
1016
|
-
* Constructor - Initializes the composable container
|
|
1017
|
-
*
|
|
1018
|
-
* Sets up the secure iframe, establishes communication channels,
|
|
1019
|
-
* and prepares the container for element creation and management.
|
|
1020
|
-
*
|
|
1021
|
-
* @param options - Container configuration (layout, styles, etc.)
|
|
1022
|
-
* @param metaData - Client metadata and configuration
|
|
1023
|
-
* @param skyflowElements - Global elements registry
|
|
1024
|
-
* @param context - Application context with logging and config
|
|
1025
|
-
*/
|
|
1026
|
-
constructor(options: any, metaData: any, skyflowElements: any, context: any);
|
|
1027
|
-
/**
|
|
1028
|
-
* Creates a new composable form element
|
|
1029
|
-
*
|
|
1030
|
-
* This method creates a secure form element (like card number, CVV, etc.)
|
|
1031
|
-
* that will be rendered inside the secure iframe. The element is added to
|
|
1032
|
-
* the container's element list but not yet mounted to the DOM.
|
|
1033
|
-
*
|
|
1034
|
-
* @param input - Element configuration (type, styles, validations, etc.)
|
|
1035
|
-
* @param options - Additional options like required field validation
|
|
1036
|
-
* @returns ComposableElement instance for further configuration
|
|
1037
|
-
*/
|
|
1038
|
-
create: (input: CollectElementInput, options?: any) => ComposableElement;
|
|
1039
|
-
/**
|
|
1040
|
-
* Registers an event listener for container events
|
|
1041
|
-
*
|
|
1042
|
-
* Allows the application to listen for events like form submission,
|
|
1043
|
-
* validation errors, or other container-level events.
|
|
1044
|
-
*
|
|
1045
|
-
* @param eventName - The name of the event to listen for
|
|
1046
|
-
* @param handler - The callback function to execute when the event occurs
|
|
1047
|
-
*/
|
|
1048
|
-
on: (eventName: string, handler: any) => void;
|
|
1049
|
-
/**
|
|
1050
|
-
* Mounts the container and its elements to a DOM element
|
|
1051
|
-
*
|
|
1052
|
-
* This method organizes the created elements according to the specified layout,
|
|
1053
|
-
* applies styling, and renders them within the provided DOM element.
|
|
1054
|
-
* The elements are rendered inside secure iframes for PCI compliance.
|
|
1055
|
-
*
|
|
1056
|
-
* @param domElement - The DOM element where the form should be mounted
|
|
1057
|
-
*/
|
|
1058
|
-
mount: (domElement: any) => void;
|
|
1059
|
-
/**
|
|
1060
|
-
* Mounts the container element to the DOM and triggers a mounted event
|
|
1061
|
-
*
|
|
1062
|
-
* This method mounts the container element to the specified DOM element
|
|
1063
|
-
* and then emits an event to notify the SDK that the container has been mounted.
|
|
1064
|
-
*
|
|
1065
|
-
* @param domElement - The DOM element where the container should be mounted
|
|
1066
|
-
*/
|
|
1067
|
-
mountContainerElement: (domElement: string) => void;
|
|
1068
|
-
/**
|
|
1069
|
-
* Unmounts the container and cleans up all resources
|
|
1070
|
-
*
|
|
1071
|
-
* This method removes all elements from the DOM, clears internal state,
|
|
1072
|
-
* and removes the iframe to prevent memory leaks.
|
|
1073
|
-
*/
|
|
1074
|
-
unmount: () => void;
|
|
1075
|
-
/**
|
|
1076
|
-
* Validates all elements in the container
|
|
1077
|
-
*
|
|
1078
|
-
* Checks that all elements are mounted and triggers validation
|
|
1079
|
-
* in the secure iframe. Returns a promise that resolves with
|
|
1080
|
-
* validation results.
|
|
1081
|
-
*
|
|
1082
|
-
* @returns Promise that resolves with validation results
|
|
1083
|
-
*/
|
|
1084
|
-
validate: () => Promise<unknown>;
|
|
1085
|
-
/**
|
|
1086
|
-
* Collects data from all elements in the container
|
|
1087
|
-
*
|
|
1088
|
-
* This method securely collects sensitive data from all mounted elements,
|
|
1089
|
-
* validates the data, and optionally tokenizes it. The actual data collection
|
|
1090
|
-
* happens within the secure iframe to maintain PCI compliance.
|
|
1091
|
-
*
|
|
1092
|
-
* @param options - Collection options (tokenization, additional fields, etc.)
|
|
1093
|
-
* @returns Promise that resolves with collected/tokenized data
|
|
1094
|
-
*/
|
|
1095
|
-
collect: (options?: ICollectOptions) => Promise<unknown>;
|
|
1096
|
-
/**
|
|
1097
|
-
* Resets all form elements to their initial state
|
|
1098
|
-
*
|
|
1099
|
-
* Clears all input values and resets validation states
|
|
1100
|
-
* by sending a reset command to the secure iframe.
|
|
1101
|
-
*/
|
|
1102
|
-
reset(): void;
|
|
1095
|
+
interface MorData {
|
|
1096
|
+
billingLines?: {
|
|
1097
|
+
street?: string;
|
|
1098
|
+
line2?: string;
|
|
1099
|
+
city?: string;
|
|
1100
|
+
state?: string;
|
|
1101
|
+
postalCode?: string;
|
|
1102
|
+
email?: string;
|
|
1103
|
+
country?: string;
|
|
1104
|
+
form?: JSONSchemaType;
|
|
1105
|
+
};
|
|
1103
1106
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
COMPOSABLE = "COMPOSABLE"
|
|
1107
|
+
interface SdkFeatureConfig {
|
|
1108
|
+
gpayIframeRollout?: number;
|
|
1109
|
+
secureFieldsRollout?: number;
|
|
1108
1110
|
}
|
|
1109
|
-
interface
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
getBearerToken: () => Promise<string>;
|
|
1113
|
-
options?: Record<string, any>;
|
|
1111
|
+
interface PayrailsAmount {
|
|
1112
|
+
value: string;
|
|
1113
|
+
currency: string;
|
|
1114
1114
|
}
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
static get RequestMethod(): typeof RequestMethod$1;
|
|
1125
|
-
static get LogLevel(): typeof LogLevel;
|
|
1126
|
-
static get EventName(): typeof EventName;
|
|
1127
|
-
static get Env(): typeof Env;
|
|
1128
|
-
static get ValidationRuleType(): typeof ValidationRuleType;
|
|
1115
|
+
interface LookupUpdateOptions {
|
|
1116
|
+
value?: string;
|
|
1117
|
+
currency?: string;
|
|
1118
|
+
installmentConfig?: InstallmentUpdateConfig | null;
|
|
1119
|
+
meta?: ExecutionMetaUpdate;
|
|
1120
|
+
}
|
|
1121
|
+
interface Links {
|
|
1122
|
+
method: 'GET' | 'POST';
|
|
1123
|
+
href: string;
|
|
1129
1124
|
}
|
|
1130
1125
|
|
|
1131
|
-
interface
|
|
1132
|
-
|
|
1133
|
-
|
|
1126
|
+
interface ReturnInfo {
|
|
1127
|
+
success?: string;
|
|
1128
|
+
cancel?: string;
|
|
1129
|
+
error?: string;
|
|
1130
|
+
pending?: string;
|
|
1134
1131
|
}
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1132
|
+
interface PayoutResponse {
|
|
1133
|
+
name: 'payout';
|
|
1134
|
+
executedAt: string;
|
|
1135
|
+
workspaceId: string;
|
|
1136
|
+
actionId: string;
|
|
1137
|
+
links: {
|
|
1138
|
+
execution: string;
|
|
1139
|
+
};
|
|
1139
1140
|
}
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1141
|
+
type PayoutComposition = Array<{
|
|
1142
|
+
integrationType: string;
|
|
1143
|
+
amount: PayrailsAmount;
|
|
1144
|
+
paymentMethodCode: PaymentMethodCode;
|
|
1145
|
+
paymentInstrumentId?: string;
|
|
1146
|
+
}>;
|
|
1147
|
+
interface PayoutReqBody {
|
|
1148
|
+
amount: PayrailsAmount;
|
|
1149
|
+
payoutComposition: PayoutComposition;
|
|
1148
1150
|
}
|
|
1151
|
+
type ERROR_RESULT = 'Unknown' | 'UnexpectedProviderResponse' | 'ProviderUnknownError' | 'ProviderConnectionError' | 'Timeout' | 'ProviderTimeout' | 'GenericRejection' | 'DuplicateOperation' | 'OperationNotAllowed' | 'NetworkTransactionReferenceRejected' | 'PayerCanceled' | 'LimitExceeded' | 'InstrumentNotAllowed' | 'InvalidInstrument' | 'InsufficientBalance' | 'BlockedInstrument' | 'ExpiredInstrument' | 'ValidationError' | 'ParamsError' | 'ProviderConfigError' | 'InvalidSignature' | 'InternalServerError' | 'AuthenticationError' | 'PaymentMethodNotSupported' | 'PayerAuthenticationRequired' | 'PayerAuthenticationFailed' | 'FraudRisk';
|
|
1149
1152
|
|
|
1150
|
-
|
|
1151
|
-
|
|
1153
|
+
interface IAddress {
|
|
1154
|
+
country?: {
|
|
1155
|
+
code?: string;
|
|
1156
|
+
fullName?: string;
|
|
1157
|
+
iso3?: string;
|
|
1158
|
+
};
|
|
1159
|
+
postalCode?: string;
|
|
1160
|
+
}
|
|
1161
|
+
interface IOnChange {
|
|
1152
1162
|
isValid: boolean;
|
|
1153
|
-
|
|
1154
|
-
fieldErrors?: FieldErrors;
|
|
1155
|
-
};
|
|
1156
|
-
interface EncryptedCollectResult {
|
|
1157
|
-
vaultProviderConfigId: string;
|
|
1158
|
-
encryptedData: string;
|
|
1163
|
+
billingAddress?: IAddress;
|
|
1159
1164
|
}
|
|
1160
|
-
interface
|
|
1161
|
-
type: ElementType;
|
|
1162
|
-
label?: string;
|
|
1163
|
-
placeholder?: string;
|
|
1164
|
-
altText?: string;
|
|
1165
|
-
format?: string;
|
|
1166
|
-
inputStyles?: object;
|
|
1167
|
-
labelStyles?: object;
|
|
1168
|
-
errorTextStyles?: object;
|
|
1169
|
-
required?: boolean;
|
|
1170
|
-
enableCardIcon?: boolean;
|
|
1165
|
+
interface AddressSelectorElementOptions extends ElementOptions {
|
|
1171
1166
|
translations?: {
|
|
1172
|
-
|
|
1173
|
-
|
|
1167
|
+
labels?: {
|
|
1168
|
+
countrySelector?: string;
|
|
1169
|
+
postalCodeInput?: string;
|
|
1170
|
+
};
|
|
1171
|
+
placeholders?: {
|
|
1172
|
+
postalCodeInput?: string;
|
|
1173
|
+
countrySelector?: string;
|
|
1174
1174
|
};
|
|
1175
1175
|
};
|
|
1176
|
-
}
|
|
1177
|
-
type PayrailsContainerType = 'COLLECT' | 'COMPOSABLE';
|
|
1178
|
-
interface CollectContainerOptions {
|
|
1179
|
-
layout?: number[];
|
|
1180
|
-
cardTableName?: string;
|
|
1181
|
-
containerType?: PayrailsContainerType;
|
|
1182
1176
|
styles?: {
|
|
1183
|
-
|
|
1177
|
+
wrapper?: Partial<CSSStyleDeclaration>;
|
|
1178
|
+
countrySelector?: {
|
|
1179
|
+
wrapper?: Partial<CSSStyleDeclaration>;
|
|
1180
|
+
element?: Partial<CSSStyleDeclaration>;
|
|
1181
|
+
label?: Partial<CSSStyleDeclaration>;
|
|
1182
|
+
};
|
|
1183
|
+
postalCodeInput?: {
|
|
1184
|
+
wrapper?: Partial<CSSStyleDeclaration>;
|
|
1185
|
+
element?: Partial<CSSStyleDeclaration>;
|
|
1186
|
+
label?: Partial<CSSStyleDeclaration>;
|
|
1187
|
+
};
|
|
1184
1188
|
};
|
|
1185
|
-
|
|
1186
|
-
|
|
1189
|
+
events?: {
|
|
1190
|
+
onBillingAddressChanged?: (e: IOnChange) => void;
|
|
1187
1191
|
};
|
|
1188
|
-
fonts?: FontDescriptor[];
|
|
1189
1192
|
}
|
|
1190
|
-
|
|
1191
|
-
interface
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
isFocused: boolean;
|
|
1201
|
-
value: unknown;
|
|
1202
|
-
required: boolean;
|
|
1193
|
+
|
|
1194
|
+
interface StoreInstrumentElementOptions extends ElementOptions {
|
|
1195
|
+
showStoreInstrumentCheckbox?: boolean;
|
|
1196
|
+
alwaysStoreInstrument?: boolean;
|
|
1197
|
+
defaultStoreInstrumentState?: 'checked' | 'unchecked';
|
|
1198
|
+
translations?: {
|
|
1199
|
+
labels?: {
|
|
1200
|
+
storeInstrument?: string;
|
|
1201
|
+
saveInstrument?: string;
|
|
1202
|
+
};
|
|
1203
1203
|
};
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
clearValue?: () => void;
|
|
1209
|
-
update?: (data: Partial<CollectElementOptions>) => void;
|
|
1210
|
-
setAttribute: (attribute: string, value: string | number) => void;
|
|
1204
|
+
styles?: {
|
|
1205
|
+
storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
|
|
1206
|
+
};
|
|
1207
|
+
events?: PayrailsSDKEvents;
|
|
1211
1208
|
}
|
|
1212
|
-
declare class
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
private
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1209
|
+
declare class StoreInstrumentCheckbox extends PayrailsElement {
|
|
1210
|
+
private options;
|
|
1211
|
+
constructor(options: StoreInstrumentElementOptions);
|
|
1212
|
+
get isChecked(): boolean;
|
|
1213
|
+
private createHTML;
|
|
1214
|
+
private applyStyles;
|
|
1215
|
+
private addListeners;
|
|
1216
|
+
}
|
|
1217
|
+
declare abstract class PayrailsElementWithStoreInstrumentCheckbox extends PayrailsElement {
|
|
1218
|
+
protected options?: StoreInstrumentElementOptions | undefined;
|
|
1219
|
+
protected storeInstrumentCheckbox: StoreInstrumentCheckbox | null;
|
|
1220
|
+
protected constructor(elementType: string, options?: StoreInstrumentElementOptions | undefined);
|
|
1221
|
+
protected get shouldStoreInstrument(): boolean;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
interface ApplePayButtonOptions extends StoreInstrumentElementOptions {
|
|
1225
|
+
clientDomain?: string;
|
|
1226
|
+
showPaymentMethodLogo?: boolean;
|
|
1227
|
+
abortAfterAuthorizeFailed?: boolean;
|
|
1228
|
+
translations?: {
|
|
1229
|
+
labels?: {
|
|
1230
|
+
storeInstrument?: string;
|
|
1231
|
+
saveInstrument?: string;
|
|
1232
|
+
paymentScreenLabel?: string;
|
|
1233
|
+
};
|
|
1234
|
+
};
|
|
1235
|
+
events?: PaymentEvents & Pick<UIEvents, 'onDeliveryAddressChanged'> & {
|
|
1236
|
+
onApplePayAvailable?: () => void;
|
|
1237
|
+
};
|
|
1238
|
+
styles?: {
|
|
1239
|
+
type?: 'plain' | 'buy' | 'addMoney' | 'book' | 'checkout' | 'continue' | 'contribute' | 'donate' | 'inStore' | 'order' | 'reload' | 'rent' | 'setUp' | 'subscribe' | 'support' | 'tip' | 'topUp';
|
|
1240
|
+
style?: 'white' | 'whiteOutline' | 'black' | 'automatic';
|
|
1241
|
+
locale?: string;
|
|
1242
|
+
} & StoreInstrumentElementOptions['styles'];
|
|
1243
|
+
}
|
|
1244
|
+
declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
1245
|
+
protected options: ApplePayButtonOptions;
|
|
1246
|
+
private appleButton;
|
|
1247
|
+
private paymentExecutor;
|
|
1248
|
+
private action;
|
|
1249
|
+
private isProcessing;
|
|
1250
|
+
private completedSessions;
|
|
1251
|
+
private abortedSessionReasons;
|
|
1252
|
+
static isApplePayAvailable(): Promise<boolean>;
|
|
1253
|
+
constructor(options: ApplePayButtonOptions);
|
|
1254
|
+
mount(location: string): void;
|
|
1228
1255
|
unmount(): void;
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
private
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1256
|
+
private mountApplePayButton;
|
|
1257
|
+
private onAuthorizeFailedHandler;
|
|
1258
|
+
private completeApplePaySession;
|
|
1259
|
+
private createApplePaySession;
|
|
1260
|
+
/**
|
|
1261
|
+
* Apple Pay only exposes redacted contact fields here for privacy
|
|
1262
|
+
* (`countryCode`, `administrativeArea`, `locality`, `postalCode`); full
|
|
1263
|
+
* address is revealed in `onpaymentauthorized` after the user authorizes.
|
|
1264
|
+
*
|
|
1265
|
+
* The session must be answered with `completeShippingContactSelection`
|
|
1266
|
+
* within ~30s or Apple aborts the sheet — so the merchant's
|
|
1267
|
+
* `onDeliveryAddressChanged` callback must be fast.
|
|
1268
|
+
*
|
|
1269
|
+
* `amount` is passed in (rather than read from `getSDKConfig()`) so the
|
|
1270
|
+
* response carries the same total the session was created with, even if
|
|
1271
|
+
* the SDK config is mutated mid-flow.
|
|
1272
|
+
*/
|
|
1273
|
+
private onApplePayShippingContactSelected;
|
|
1274
|
+
private onApplePayAuthorized;
|
|
1275
|
+
private doAuthorizedPayment;
|
|
1276
|
+
private doTokenize;
|
|
1241
1277
|
}
|
|
1242
1278
|
|
|
1243
1279
|
declare const regexes: {
|
|
@@ -1369,13 +1405,25 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
|
1369
1405
|
private defaultStyles;
|
|
1370
1406
|
private defaultTranslations;
|
|
1371
1407
|
private eventsRef?;
|
|
1372
|
-
constructor(collectContainer:
|
|
1408
|
+
constructor(collectContainer: FramesContainer, options?: CardFormOptions | undefined);
|
|
1373
1409
|
private initializeFormFields;
|
|
1374
1410
|
getErrorTextStyles(errorTextStyles: any): any;
|
|
1375
1411
|
private updateStyles;
|
|
1376
1412
|
private updateTranslations;
|
|
1377
1413
|
private updateEvents;
|
|
1378
1414
|
update(options: Partial<Pick<CardFormOptions, 'styles' | 'translations' | 'events'>>): void;
|
|
1415
|
+
/**
|
|
1416
|
+
* Legacy (Skyflow) path: prepare per-field flat payloads and dispatch to
|
|
1417
|
+
* each field's vault element. Skyflow merges shallowly on its side.
|
|
1418
|
+
*/
|
|
1419
|
+
private updateSkyflow;
|
|
1420
|
+
/**
|
|
1421
|
+
* Secure-fields path: forward styles/translations to the single CARD_FORM
|
|
1422
|
+
* frame 1:1; the frame fans them out per child via resolveFieldData. Host
|
|
1423
|
+
* defaults are deep-merged so successive updates accumulate symmetrically
|
|
1424
|
+
* with the frame's own accumulation.
|
|
1425
|
+
*/
|
|
1426
|
+
private updateSecureFields;
|
|
1379
1427
|
updateInstallmentConfig(installmentConfig?: InstallmentUpdateConfig): void;
|
|
1380
1428
|
private createFormField;
|
|
1381
1429
|
private isFieldRequired;
|
|
@@ -1383,7 +1431,7 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
|
1383
1431
|
private hasFieldBeenUsed;
|
|
1384
1432
|
private initializeDefaultLayout;
|
|
1385
1433
|
private throttledFetchBinLookupIfChanged;
|
|
1386
|
-
tokenize(opts: TokenizeOptions): Promise<
|
|
1434
|
+
tokenize(opts: TokenizeOptions): Promise<any>;
|
|
1387
1435
|
private createAddressSelector;
|
|
1388
1436
|
show(): void;
|
|
1389
1437
|
hide(options?: {
|
|
@@ -1501,6 +1549,18 @@ declare enum AuthorizationFailureReasons {
|
|
|
1501
1549
|
USER_CANCELLED = "USER_CANCELLED"
|
|
1502
1550
|
}
|
|
1503
1551
|
|
|
1552
|
+
type BillingAddressPrefill = Omit<NonNullable<MorData['billingLines']>, 'form'>;
|
|
1553
|
+
interface BillingAddressFormOptions {
|
|
1554
|
+
schema: JSONSchemaType;
|
|
1555
|
+
title?: string;
|
|
1556
|
+
prefill?: BillingAddressPrefill;
|
|
1557
|
+
styles?: DynamicElementStyles;
|
|
1558
|
+
translations?: DynamicElementTranslations;
|
|
1559
|
+
events?: {
|
|
1560
|
+
onReady?: () => void;
|
|
1561
|
+
};
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1504
1564
|
interface AuthFailedMsgOptions {
|
|
1505
1565
|
translations?: {
|
|
1506
1566
|
label?: string;
|
|
@@ -1520,7 +1580,7 @@ interface LoadingScreenStyles {
|
|
|
1520
1580
|
[StyleKeys.loader]?: Partial<CSSStyleDeclaration>;
|
|
1521
1581
|
}
|
|
1522
1582
|
|
|
1523
|
-
type GooglePayConfigInput = google.payments.api.IsReadyToPayPaymentMethodSpecification[] |
|
|
1583
|
+
type GooglePayConfigInput = google.payments.api.IsReadyToPayPaymentMethodSpecification[] | GooglePayWorkflowConfig;
|
|
1524
1584
|
interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
|
|
1525
1585
|
environment?: PayrailsEnvironment;
|
|
1526
1586
|
merchantInfo?: google.payments.api.MerchantInfo;
|
|
@@ -1830,7 +1890,9 @@ declare class Dropin extends PayrailsElement {
|
|
|
1830
1890
|
private paypal;
|
|
1831
1891
|
private lean;
|
|
1832
1892
|
private loadingScreen;
|
|
1833
|
-
|
|
1893
|
+
private billingAddressForm;
|
|
1894
|
+
private billingValidationBlocked;
|
|
1895
|
+
constructor(collectContainer: FramesContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions);
|
|
1834
1896
|
private get returnInfo();
|
|
1835
1897
|
private isHppIntegration;
|
|
1836
1898
|
private createStoredInstrumentElement;
|
|
@@ -1847,6 +1909,7 @@ declare class Dropin extends PayrailsElement {
|
|
|
1847
1909
|
private createApplePayButton;
|
|
1848
1910
|
private createCardPaymentButton;
|
|
1849
1911
|
private onAuthorizeSuccess;
|
|
1912
|
+
private validateBillingAddress;
|
|
1850
1913
|
private getElementEvents;
|
|
1851
1914
|
private onAuthorizePending;
|
|
1852
1915
|
private getErrorMessage;
|
|
@@ -1902,6 +1965,7 @@ interface DropinOptions {
|
|
|
1902
1965
|
mercadoPago?: GenericRedirectDropinOptions['translations'];
|
|
1903
1966
|
revolutPay?: GenericRedirectDropinOptions['translations'];
|
|
1904
1967
|
addressSelector?: AddressSelectorElementOptions['translations'];
|
|
1968
|
+
billingAddressForm?: BillingAddressFormOptions['translations'];
|
|
1905
1969
|
applePayButton?: ApplePayDropinOptions['translations'];
|
|
1906
1970
|
leanButton?: LeanDropinOptions['translations'];
|
|
1907
1971
|
errorMessages?: {
|
|
@@ -1922,6 +1986,7 @@ interface DropinOptions {
|
|
|
1922
1986
|
authFailed?: Partial<CSSStyleDeclaration>;
|
|
1923
1987
|
loadingScreen?: LoadingScreenStyles;
|
|
1924
1988
|
addressSelector?: AddressSelectorElementOptions['styles'];
|
|
1989
|
+
billingAddressForm?: BillingAddressFormOptions['styles'];
|
|
1925
1990
|
mercadoPago?: GenericRedirectDropinOptions['styles'];
|
|
1926
1991
|
revolutPay?: GenericRedirectDropinOptions['styles'];
|
|
1927
1992
|
};
|
|
@@ -1934,11 +1999,28 @@ interface ContainerStyles {
|
|
|
1934
1999
|
styles?: Partial<CSSStyleDeclaration>;
|
|
1935
2000
|
}
|
|
1936
2001
|
|
|
2002
|
+
interface DynamicElementFieldOptions {
|
|
2003
|
+
id: string;
|
|
2004
|
+
name: string;
|
|
2005
|
+
required?: boolean;
|
|
2006
|
+
property: JSONSchemaProperty;
|
|
2007
|
+
label: string;
|
|
2008
|
+
placeholder: string;
|
|
2009
|
+
value?: string;
|
|
2010
|
+
readOnly?: boolean;
|
|
2011
|
+
errors: DynamicElementErrorTranslation;
|
|
2012
|
+
styles?: DynamicElementFieldStyles;
|
|
2013
|
+
events: DynamicElementFieldEvents;
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
type FieldOptionsWithoutEvents = Omit<DynamicElementFieldOptions, 'events'>;
|
|
2017
|
+
|
|
1937
2018
|
interface DynamicElementOptions {
|
|
1938
2019
|
styles?: DynamicElementStyles;
|
|
1939
2020
|
translations?: DynamicElementTranslations;
|
|
1940
|
-
paymentMethod
|
|
2021
|
+
paymentMethod?: BasePaymentMethodConfig;
|
|
1941
2022
|
events?: DynamicElementEvents;
|
|
2023
|
+
fieldOverrides?: Record<string, Partial<FieldOptionsWithoutEvents>>;
|
|
1942
2024
|
}
|
|
1943
2025
|
interface FormConfig {
|
|
1944
2026
|
schema: JSONSchemaType;
|
|
@@ -1952,7 +2034,7 @@ declare class DynamicElementForm extends Tokenizable {
|
|
|
1952
2034
|
private __schema;
|
|
1953
2035
|
private _previousFormValidState;
|
|
1954
2036
|
constructor(options: DynamicElementOptions, formConfig: FormConfig, returnInfo?: ReturnInfo | undefined);
|
|
1955
|
-
|
|
2037
|
+
collect(): Promise<Record<string, any>>;
|
|
1956
2038
|
protected constructSaveInstrumentBody(tokens: any, opts?: TokenizeOptions): Promise<any>;
|
|
1957
2039
|
private isFormValid;
|
|
1958
2040
|
private isFormValidSilent;
|
|
@@ -2088,6 +2170,30 @@ interface PayPalScriptConfig {
|
|
|
2088
2170
|
locale?: string;
|
|
2089
2171
|
}
|
|
2090
2172
|
|
|
2173
|
+
interface PaymentAttemptContext {
|
|
2174
|
+
readonly executionId: string;
|
|
2175
|
+
readonly paymentMethodCode: PaymentMethodCode;
|
|
2176
|
+
}
|
|
2177
|
+
declare enum ACTION_REQUIRED_KIND {
|
|
2178
|
+
GENERIC_REDIRECT = "genericRedirect",
|
|
2179
|
+
THREE_DS = "3ds"
|
|
2180
|
+
}
|
|
2181
|
+
type ActionRequiredKind = `${ACTION_REQUIRED_KIND}`;
|
|
2182
|
+
interface ActionRequiredEvent extends PaymentAttemptContext {
|
|
2183
|
+
readonly url: string;
|
|
2184
|
+
readonly kind: ActionRequiredKind;
|
|
2185
|
+
/**
|
|
2186
|
+
* Call to take over the action. The SDK will not perform its default
|
|
2187
|
+
* behavior (navigate, mount the 3DS popup).
|
|
2188
|
+
*/
|
|
2189
|
+
preventDefault(): void;
|
|
2190
|
+
}
|
|
2191
|
+
type PayrailsEvents = {
|
|
2192
|
+
actionRequired: ActionRequiredEvent;
|
|
2193
|
+
};
|
|
2194
|
+
type PayrailsEventName = keyof PayrailsEvents;
|
|
2195
|
+
type PayrailsEventHandler<K extends PayrailsEventName> = (event: PayrailsEvents[K]) => void | Promise<void>;
|
|
2196
|
+
|
|
2091
2197
|
interface QueryDefinition<T> {
|
|
2092
2198
|
path: string[];
|
|
2093
2199
|
returnType: T;
|
|
@@ -2128,7 +2234,7 @@ declare class Payrails {
|
|
|
2128
2234
|
static preloadCardForm: typeof SdkLoader.preloadCardForm;
|
|
2129
2235
|
static init(initResponse: InitOptions, options?: PayrailsClientOptions): Payrails;
|
|
2130
2236
|
update(updateOptions: LookupUpdateOptions): void;
|
|
2131
|
-
collectContainer(containerOptions: CollectContainerOptions):
|
|
2237
|
+
collectContainer(containerOptions: CollectContainerOptions): FramesContainer;
|
|
2132
2238
|
googlePayButton(options: GooglePayButtonOptions): GooglePayButton;
|
|
2133
2239
|
isGooglePayAvailable(merchantInfo: google.payments.api.MerchantInfo): Promise<boolean>;
|
|
2134
2240
|
applePayButton(options: ApplePayButtonOptions): ApplePayButton;
|
|
@@ -2151,11 +2257,13 @@ declare class Payrails {
|
|
|
2151
2257
|
paypalButton(options?: PaypalButtonOptions): PaypalButton;
|
|
2152
2258
|
leanButton(options: LeanButtonOptions): LeanButton;
|
|
2153
2259
|
genericRedirectButton(options: GenericRedirectButtonOptions): GenericRedirectButton;
|
|
2154
|
-
dynamicElement(options: DynamicElementOptions): DynamicElementForm;
|
|
2260
|
+
dynamicElement(options: DynamicElementOptions & Required<Pick<DynamicElementOptions, 'paymentMethod'>>): DynamicElementForm;
|
|
2155
2261
|
getSavedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
|
|
2156
2262
|
private logIntegrationMode;
|
|
2157
2263
|
private constructor();
|
|
2158
2264
|
private getContainerLayout;
|
|
2265
|
+
on<K extends PayrailsEventName>(name: K, handler: PayrailsEventHandler<K>): () => void;
|
|
2266
|
+
off<K extends PayrailsEventName>(name: K, handler: PayrailsEventHandler<K>): void;
|
|
2159
2267
|
binLookup(): Promise<any>;
|
|
2160
2268
|
}
|
|
2161
2269
|
interface ClientEvents {
|
|
@@ -2281,5 +2389,5 @@ interface PayrailsClientOptions {
|
|
|
2281
2389
|
};
|
|
2282
2390
|
}
|
|
2283
2391
|
|
|
2284
|
-
export { AuthorizationFailureReasons, ElementType, INTEGRATION_TYPE, PAYMENT_METHOD_CODES, Payrails, PayrailsCollectContainer, PayrailsEnvironment, REVOLUT_PAY_DEFAULT_LABEL, REVOLUT_PAY_DEFAULT_THEME };
|
|
2285
|
-
export type { ApplePayButtonOptions, CardFormOptions, CardListOptions, CardPaymentButtonOptions, CollectContainerOptions, DropinOptions, ExecutionMeta, ExecutionMetaCustomer, ExecutionMetaKey, GenericRedirectButtonOptions, GooglePayButtonOptions, InitOptions, LeanButtonOptions, PaymentEvents, PaypalButtonOptions, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsSecureField, PayrailsSecureFieldEvent, ReturnInfo, RevolutPayButtonTheme, RevolutPayStyles, SaveInstrumentResponse, StorablePaymentCompositionOption, WorkflowExecutionResponse };
|
|
2392
|
+
export { ACTION_REQUIRED_KIND, AuthorizationFailureReasons, ElementType, INTEGRATION_TYPE, PAYMENT_METHOD_CODES, Payrails, PayrailsCollectContainer, PayrailsEnvironment, REVOLUT_PAY_DEFAULT_LABEL, REVOLUT_PAY_DEFAULT_THEME };
|
|
2393
|
+
export type { ActionRequiredEvent, ActionRequiredKind, ApplePayButtonOptions, CardFormOptions, CardListOptions, CardPaymentButtonOptions, CollectContainerOptions, DropinOptions, ExecutionMeta, ExecutionMetaCustomer, ExecutionMetaKey, GenericRedirectButtonOptions, GooglePayButtonOptions, InitOptions, LeanButtonOptions, PaymentAttemptContext, PaymentEvents, PaypalButtonOptions, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsEventHandler, PayrailsEventName, PayrailsEvents, PayrailsSecureField, PayrailsSecureFieldEvent, ReturnInfo, RevolutPayButtonTheme, RevolutPayStyles, SaveInstrumentResponse, StorablePaymentCompositionOption, WorkflowExecutionResponse };
|