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