@payrails/web-sdk 5.47.0 → 5.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/payrails.d.ts CHANGED
@@ -1,1265 +1,1279 @@
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;
377
- }
378
- interface BaseInstallmentOption {
379
- count: number;
380
- amount: number;
381
- }
382
- interface PaymentInstallmentsConfig {
383
- [key: string]: BaseInstallmentOption[];
384
- }
385
- interface InstallmentUpdateConfig {
386
- defaultInstallment?: number | null;
387
- installmentCountry?: string | null;
388
- installmentOptions?: BaseInstallmentOption[] | null;
138
+
139
+ interface CollectElementInput$1 {
140
+ table?: string;
141
+ column?: string;
142
+ inputStyles?: object;
143
+ label?: string;
144
+ labelStyles?: object;
145
+ errorTextStyles?: object;
146
+ placeholder?: string;
147
+ type: ElementType$1;
148
+ altText?: string;
149
+ validations?: IValidationRule[];
150
+ skyflowID?: string;
389
151
  }
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>>;
152
+ interface ICollectOptions$1 {
153
+ tokens?: boolean;
154
+ additionalFields?: IInsertRecordInput;
155
+ upsert?: Array<IUpsertOptions>;
408
156
  }
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;
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;
428
168
  }
429
- interface PayPalConfig {
430
- clientId: string;
431
- merchantId: string;
432
- captureMode: 'Delayed' | 'Instant' | 'Manual';
433
- integrationMode: 'express' | 'normal';
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;
434
188
  }
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
- };
189
+
190
+ declare class ComposableElement {
191
+ #private;
444
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;
445
198
  }
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;
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;
458
216
  }
459
- interface PayPalMetadata {
460
- email?: string;
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>;
461
225
  }
462
- interface Country {
463
- code: string;
464
- name: string;
465
- iso3: string;
226
+ /**
227
+ * ComposableContainer class - Main container for managing secure form elements
228
+ *
229
+ * This class extends the base Container and provides functionality to:
230
+ * - Create and manage secure iframe-based form elements
231
+ * - Handle secure communication between parent and iframe contexts
232
+ * - Collect and tokenize sensitive data while maintaining PCI compliance
233
+ * - Manage element lifecycle (create, mount, validate, collect, destroy)
234
+ */
235
+ declare class ComposableContainer extends Container {
236
+ #private;
237
+ type: string;
238
+ private bus;
239
+ private iframe;
240
+ /**
241
+ * Constructor - Initializes the composable container
242
+ *
243
+ * Sets up the secure iframe, establishes communication channels,
244
+ * and prepares the container for element creation and management.
245
+ *
246
+ * @param options - Container configuration (layout, styles, etc.)
247
+ * @param metaData - Client metadata and configuration
248
+ * @param skyflowElements - Global elements registry
249
+ * @param context - Application context with logging and config
250
+ */
251
+ constructor(options: any, metaData: any, skyflowElements: any, context: any);
252
+ /**
253
+ * Creates a new composable form element
254
+ *
255
+ * This method creates a secure form element (like card number, CVV, etc.)
256
+ * that will be rendered inside the secure iframe. The element is added to
257
+ * the container's element list but not yet mounted to the DOM.
258
+ *
259
+ * @param input - Element configuration (type, styles, validations, etc.)
260
+ * @param options - Additional options like required field validation
261
+ * @returns ComposableElement instance for further configuration
262
+ */
263
+ create: (input: CollectElementInput, options?: any) => ComposableElement;
264
+ /**
265
+ * Registers an event listener for container events
266
+ *
267
+ * Allows the application to listen for events like form submission,
268
+ * validation errors, or other container-level events.
269
+ *
270
+ * @param eventName - The name of the event to listen for
271
+ * @param handler - The callback function to execute when the event occurs
272
+ */
273
+ on: (eventName: string, handler: any) => void;
274
+ /**
275
+ * Mounts the container and its elements to a DOM element
276
+ *
277
+ * This method organizes the created elements according to the specified layout,
278
+ * applies styling, and renders them within the provided DOM element.
279
+ * The elements are rendered inside secure iframes for PCI compliance.
280
+ *
281
+ * @param domElement - The DOM element where the form should be mounted
282
+ */
283
+ mount: (domElement: any) => void;
284
+ /**
285
+ * Mounts the container element to the DOM and triggers a mounted event
286
+ *
287
+ * This method mounts the container element to the specified DOM element
288
+ * and then emits an event to notify the SDK that the container has been mounted.
289
+ *
290
+ * @param domElement - The DOM element where the container should be mounted
291
+ */
292
+ mountContainerElement: (domElement: string) => void;
293
+ /**
294
+ * Unmounts the container and cleans up all resources
295
+ *
296
+ * This method removes all elements from the DOM, clears internal state,
297
+ * and removes the iframe to prevent memory leaks.
298
+ */
299
+ unmount: () => void;
300
+ /**
301
+ * Validates all elements in the container
302
+ *
303
+ * Checks that all elements are mounted and triggers validation
304
+ * in the secure iframe. Returns a promise that resolves with
305
+ * validation results.
306
+ *
307
+ * @returns Promise that resolves with validation results
308
+ */
309
+ validate: () => Promise<unknown>;
310
+ /**
311
+ * Collects data from all elements in the container
312
+ *
313
+ * This method securely collects sensitive data from all mounted elements,
314
+ * validates the data, and optionally tokenizes it. The actual data collection
315
+ * happens within the secure iframe to maintain PCI compliance.
316
+ *
317
+ * @param options - Collection options (tokenization, additional fields, etc.)
318
+ * @returns Promise that resolves with collected/tokenized data
319
+ */
320
+ collect: (options?: ICollectOptions) => Promise<unknown>;
321
+ /**
322
+ * Resets all form elements to their initial state
323
+ *
324
+ * Clears all input values and resets validation states
325
+ * by sending a reset command to the secure iframe.
326
+ */
327
+ reset(): void;
466
328
  }
467
- interface CardMetadata {
468
- bin?: string;
469
- suffix?: string;
470
- network?: string;
471
- binLookup?: {
472
- issuerCountry: Country;
473
- };
329
+
330
+ declare enum ContainerType {
331
+ COLLECT = "COLLECT",
332
+ COMPOSABLE = "COMPOSABLE"
474
333
  }
475
- interface BankAccountMetadata {
476
- bankAccount: {
477
- holder: HolderData;
478
- bank: BankData;
479
- account: AccountData;
480
- };
334
+ interface ISkyflow {
335
+ vaultID?: string;
336
+ vaultURL?: string;
337
+ getBearerToken: () => Promise<string>;
338
+ options?: Record<string, any>;
481
339
  }
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;
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;
492
354
  }
493
- type HolderType = 'individual' | 'corporate';
494
- interface BankData {
495
- name?: string;
496
- branchCode?: string;
497
- code?: string;
498
- address?: Address;
499
- swiftCode?: 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;
500
364
  }
501
- interface AccountData {
502
- number?: string;
503
- iban?: string;
504
- currency?: string;
505
- type?: AccountType;
506
- country?: Country;
365
+ interface ElementOptions {
366
+ id?: string;
367
+ dataTestId?: string;
368
+ className?: string | string[];
369
+ styles?: Partial<CSSStyleDeclaration>;
507
370
  }
508
- type AccountType = 'savings' | 'current';
509
- interface Address {
510
- country?: {
511
- code?: string;
512
- fullName?: string;
513
- iso3?: string;
514
- };
515
- postalCode?: string;
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;
516
383
  }
517
- declare enum PAYMENT_CLIENT_FLOW {
518
- 'REDIRECT' = "redirect",
519
- 'DIRECT' = "direct",
520
- 'EMBEDDED' = "embedded"
384
+
385
+ interface TokenizeOptions {
386
+ futureUsage?: FutureUsages;
387
+ storeInstrument?: boolean;
521
388
  }
522
- declare enum INTEGRATION_TYPE {
523
- API = "api",
524
- HPP = "hpp"
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>;
525
393
  }
526
394
 
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: {
535
- 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;
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"
403
+ }
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;
414
+ }
415
+ interface CollectElementOptions {
416
+ type: ElementType;
417
+ label?: string;
418
+ placeholder?: string;
419
+ altText?: string;
420
+ format?: string;
421
+ inputStyles?: object;
422
+ labelStyles?: object;
423
+ errorTextStyles?: object;
424
+ required?: boolean;
425
+ enableCardIcon?: boolean;
426
+ translations?: {
427
+ error?: {
428
+ default?: string;
546
429
  };
547
- holderName?: string;
548
- network: string;
549
- suffix: string;
550
- expiryMonth?: string;
551
- expiryYear?: string;
552
430
  };
553
- fingerprint?: string;
554
- futureUsage?: string;
555
431
  }
556
-
557
- interface SdkConfiguration {
558
- token: string;
559
- amount: PayrailsAmount;
560
- holderReference: string;
561
- links?: {
562
- binLookup?: Links;
563
- instrumentDelete?: Links;
564
- instrumentUpdate?: Links;
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>;
565
440
  };
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
- };
441
+ errorTextStyles?: {
442
+ base?: Partial<CSSStyleDeclaration>;
581
443
  };
582
- execution?: WorkflowExecutionResponse;
583
- featureConfig?: SdkFeatureConfig;
584
- morData?: MorData;
444
+ fonts?: FontDescriptor[];
585
445
  }
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;
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;
596
459
  };
460
+ setError?: (clientErrorText: string) => void;
461
+ resetError?: () => void;
462
+ update?: (data: Partial<CollectElementOptions>) => void;
463
+ setAttribute: (attribute: string, value: string | number) => void;
597
464
  }
598
- interface SdkFeatureConfig {
599
- gpayIframeRollout?: number;
465
+ interface FramesContainer extends Mountable {
466
+ createCollectElement: (options: CollectElementOptions) => PayrailsSecureField;
467
+ fetchBinLookup: (bin: string) => Promise<{
468
+ bin: string;
469
+ }>;
470
+ validate: () => Promise<ValidateCardFormResult>;
471
+ collect: () => Promise<EncryptedCollectResult>;
472
+ tokenize: (opts: TokenizeOptions) => Promise<any>;
473
+ reset: () => void;
474
+ bin: string;
475
+ isBinLookupEnabled: boolean;
476
+ readonly id: string;
477
+ readonly dataTestId: string;
478
+ readonly className: string;
600
479
  }
601
- interface PayrailsAmount {
602
- value: string;
603
- currency: string;
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
+ }>;
604
508
  }
605
- interface LookupUpdateOptions {
606
- value?: string;
607
- currency?: string;
608
- installmentConfig?: InstallmentUpdateConfig | null;
609
- meta?: ExecutionMetaUpdate;
509
+
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;
610
519
  }
611
- interface Links {
612
- method: 'GET' | 'POST';
613
- href: string;
520
+ interface JSONSchemaDependentSchema {
521
+ oneOf: Array<{
522
+ properties: Record<string, {
523
+ const: string | number;
524
+ }>;
525
+ required: string[];
526
+ }>;
614
527
  }
615
-
616
- interface ReturnInfo {
617
- success?: string;
618
- cancel?: string;
619
- error?: string;
620
- pending?: string;
528
+ interface JSONSchemaProperty {
529
+ type?: 'string' | 'number' | 'boolean' | 'array' | 'object';
530
+ title?: string;
531
+ oneOf?: JSONSchemaOneOfOption[];
532
+ pattern?: string;
533
+ minLength?: number;
534
+ maxLength?: number;
535
+ errorMessage?: Record<string, string>;
536
+ $ref?: string;
537
+ [UI_POSITION_FIELD]?: number;
538
+ properties?: Record<string, JSONSchemaType>;
621
539
  }
622
- interface PayoutResponse {
623
- name: 'payout';
624
- executedAt: string;
625
- workspaceId: string;
626
- actionId: string;
627
- links: {
628
- execution: string;
629
- };
540
+ interface DynamicElementEvents {
541
+ onReady?: () => void;
542
+ onValidationChange?: (isValid: boolean) => void;
630
543
  }
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;
544
+ interface DynamicElementFieldEvents {
545
+ onChange: (value: any) => void;
546
+ onReady: (initialValue: any) => void;
547
+ onBlur: () => void;
640
548
  }
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;
549
+ interface DynamicElementFieldTranslation {
550
+ label?: string;
551
+ placeholder?: string;
552
+ errors?: Partial<DynamicElementErrorTranslation>;
651
553
  }
652
- interface ElementOptions {
653
- id?: string;
654
- dataTestId?: string;
655
- className?: string | string[];
656
- styles?: Partial<CSSStyleDeclaration>;
554
+ interface DynamicElementErrorTranslation {
555
+ required: string;
556
+ minLength: string;
557
+ maxLength: string;
558
+ pattern: string;
559
+ oneOf: string;
657
560
  }
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;
561
+ type DynamicElementTranslations = {
562
+ fields?: Record<string, DynamicElementFieldTranslation>;
563
+ errors?: Partial<DynamicElementErrorTranslation>;
564
+ };
565
+ interface DynamicElementElementStyles {
566
+ base?: Partial<CSSStyleDeclaration>;
567
+ complete?: Partial<CSSStyleDeclaration>;
568
+ empty?: Partial<CSSStyleDeclaration>;
569
+ focus?: Partial<CSSStyleDeclaration>;
570
+ invalid?: Partial<CSSStyleDeclaration>;
670
571
  }
671
-
672
- interface IAddress {
673
- country?: {
674
- code?: string;
675
- fullName?: string;
676
- iso3?: string;
572
+ type DynamicElementInputFieldStyles = DynamicElementElementStyles;
573
+ type DynamicElementSelectFieldStyles = DynamicElementElementStyles;
574
+ interface DynamicElementTabsFieldStyles {
575
+ tab: {
576
+ base?: Partial<CSSStyleDeclaration>;
577
+ active?: Partial<CSSStyleDeclaration>;
677
578
  };
678
- postalCode?: string;
579
+ container?: DynamicElementElementStyles;
679
580
  }
680
- interface IOnChange {
681
- isValid: boolean;
682
- billingAddress?: IAddress;
581
+ interface DynamicElementFieldStyles {
582
+ base?: Partial<CSSStyleDeclaration>;
583
+ label?: Partial<CSSStyleDeclaration>;
584
+ errors?: Partial<CSSStyleDeclaration>;
585
+ input?: DynamicElementInputFieldStyles;
586
+ select?: DynamicElementSelectFieldStyles;
587
+ tabs?: DynamicElementTabsFieldStyles;
683
588
  }
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
- };
589
+ interface DynamicElementStyles {
590
+ all: Omit<DynamicElementFieldStyles, 'label'>;
591
+ fields?: Record<string, DynamicElementFieldStyles>;
711
592
  }
712
593
 
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;
594
+ declare enum PAYMENT_METHOD_CODES {
595
+ 'CARD' = "card",
596
+ 'GOOGLE_PAY' = "googlePay",
597
+ 'PAYPAL' = "payPal",
598
+ 'APPLE_PAY' = "applePay",
599
+ 'GENERIC_REDIRECT' = "genericRedirect",
600
+ 'LEAN' = "lean",
601
+ 'MERCADO_PAGO' = "mercadoPago",
602
+ 'PIX' = "pix",
603
+ 'BANK_ACCOUNT' = "bankAccount",
604
+ 'IDEAL' = "iDeal",
605
+ 'YAPE' = "yape",
606
+ 'UPI' = "upi",
607
+ 'KLARNA' = "klarna",
608
+ 'ONE_VOUCHER' = "1voucher",
609
+ 'ALFA' = "alfa",
610
+ 'APLAZO' = "aplazo",
611
+ 'BANK_TRANSFER' = "bankTransfer",
612
+ 'CAPITEC_PAY' = "capitecPay",
613
+ 'EASYPAISA' = "easypaisa",
614
+ 'EFT_PRO' = "eftPro",
615
+ 'FAWRY_PAY' = "fawryPay",
616
+ 'JAZZ_CASH' = "jazzCash",
617
+ 'KONNECT' = "konnect",
618
+ 'KUESKI' = "kueski",
619
+ 'MONO_DIRECT_DEBIT' = "monoDirectDebit",
620
+ 'O_PAY_WALLET' = "oPayWallet",
621
+ 'PAGA_WALLET' = "pagaWallet",
622
+ 'PAYFLEX' = "payflex",
623
+ 'PAY_JUST_NOW' = "payjustnow",
624
+ 'WAFA_CASH_WALLET' = "wafaCashWallet",
625
+ 'MERCADO_PAGO_WALLET' = "mercadoPagoWallet",
626
+ 'MERCADO_PAGO_CONSUMER_CREDIT' = "mercadoPagoConsumerCredit",
627
+ 'NET_BANKING' = "netBanking",
628
+ 'CASH_FREE_WALLET' = "cashFreeWallet",
629
+ 'PAYTM_WALLET' = "paytmWallet",
630
+ 'NIBSS_PAY' = "nibssPay",
631
+ 'NIBSS_INSTANT_PAY' = "nibssInstantPay",
632
+ 'MEEZA_WALLET' = "meezaWallet",
633
+ 'VODAFONE_CASH' = "vodafoneCash",
634
+ 'SEPA_DIRECT_DEBIT' = "sepaDirectDebit",
635
+ 'MODO' = "modo",
636
+ 'PAYZONE_CASH' = "payzoneCash",
637
+ 'REVOLUT_PAY' = "revolutPay"
727
638
  }
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;
639
+ declare const PAYMENT_METHOD_CODE_BY_METHOD: { readonly [K in keyof typeof PAYMENT_METHOD_CODES]: (typeof PAYMENT_METHOD_CODES)[K]; };
640
+ type PaymentMethodCode = PAYMENT_METHOD_CODES | (typeof PAYMENT_METHOD_CODE_BY_METHOD)[keyof typeof PAYMENT_METHOD_CODE_BY_METHOD] | (string & {});
641
+ declare enum PAYMENT_INSTRUMENT_STATUS {
642
+ 'ENABLED' = "enabled",
643
+ 'CREATED' = "created",
644
+ 'DELETED' = "deleted",
645
+ 'DISABLED' = "disabled",
646
+ 'INVALID' = "invalid",
647
+ 'TRANSIENT' = "transient"
735
648
  }
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;
649
+ type ExecutionMetaKey = keyof ExecutionMetaByKey;
650
+ interface ExecutionMetaCustomer {
651
+ phone?: {
652
+ countryCode?: string;
653
+ number?: string;
654
+ };
655
+ country?: {
656
+ name?: string;
657
+ code?: string;
658
+ iso3?: string;
659
+ };
660
+ reference?: string;
661
+ name?: string;
662
+ lastName?: string;
663
+ email?: string;
664
+ type?: string;
665
+ birthDate?: string;
666
+ language?: string;
667
+ identityCardNumber?: string;
741
668
  }
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;
669
+ interface ExecutionMetaOrder {
670
+ billingAddress?: {
671
+ country?: {
672
+ name?: string;
673
+ code?: string;
674
+ iso3?: string;
752
675
  };
753
676
  };
754
- events?: PaymentEvents & Pick<UIEvents, 'onDeliveryAddressChanged'> & {
755
- onApplePayAvailable?: () => void;
677
+ }
678
+ type ExecutionMetaByKey = {
679
+ customer: ExecutionMetaCustomer;
680
+ };
681
+ type ExecutionMetaUpdate = {
682
+ [Key in ExecutionMetaKey]: {
683
+ key: Key;
684
+ value: ExecutionMetaByKey[Key];
756
685
  };
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'];
686
+ }[ExecutionMetaKey];
687
+ interface ExecutionMeta {
688
+ customer?: ExecutionMetaCustomer;
689
+ order?: ExecutionMetaOrder;
762
690
  }
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;
691
+ declare class WorkflowExecution {
692
+ private static _updatedMetaKeys;
693
+ private static _response;
694
+ static get response(): WorkflowExecutionResponse;
695
+ static setResponse(response: WorkflowExecutionResponse): typeof WorkflowExecution;
779
696
  /**
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.
697
+ * Non-throwing read of the current execution id. Returns `undefined` when
698
+ * the workflow execution hasn't been initialized yet. Prefer this over
699
+ * `WorkflowExecution.response.id` in observational code paths (event
700
+ * emission, logging, analytics) where the workflow not being loaded should
701
+ * degrade gracefully instead of throwing.
791
702
  */
792
- private onApplePayShippingContactSelected;
793
- private onApplePayAuthorized;
794
- private doAuthorizedPayment;
795
- private doTokenize;
703
+ static get executionId(): string | undefined;
704
+ static get workflowCode(): string;
705
+ static get lookup(): {
706
+ httpCode: number;
707
+ body: {
708
+ data: {
709
+ paymentCompositionOptions?: Array<StorablePaymentCompositionOption>;
710
+ payoutCompositionOptions?: Array<StorablePaymentCompositionOption>;
711
+ };
712
+ links: {
713
+ execution: string;
714
+ authorize?: {
715
+ href: string;
716
+ method: "POST";
717
+ };
718
+ payout?: {
719
+ href: string;
720
+ method: "POST";
721
+ };
722
+ startPaymentSession?: {
723
+ href: string;
724
+ method: "POST";
725
+ };
726
+ createInstrument?: {
727
+ href: string;
728
+ method: "POST";
729
+ };
730
+ };
731
+ name: "lookup";
732
+ };
733
+ } | undefined;
734
+ static get holderReference(): string;
735
+ static get savedCreditCards(): StoredPaymentInstrument<CardMetadata>[];
736
+ static get savedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
737
+ static get savedGooglePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
738
+ static get savedApplePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
739
+ static get paypalConfig(): PayPalConfig;
740
+ static get googlePayConfig(): any;
741
+ static isPaymentMethodAvailable(paymentMethod: PaymentMethodCode): boolean;
742
+ static get applePayConfig(): {
743
+ merchantIdentifier: string;
744
+ supportedNetworks: string[];
745
+ countryCode: string;
746
+ merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
747
+ requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
748
+ requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
749
+ };
750
+ static get url(): string;
751
+ static get meta(): ExecutionMeta;
752
+ static get availablePaymentMethods(): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig | undefined>[];
753
+ static get authorizeLink(): string | undefined;
754
+ static get payoutLink(): string | undefined;
755
+ static get createSessionLink(): string | undefined;
756
+ static get createInstrumentLink(): string | undefined;
757
+ static get storedPaymentInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
758
+ static get storedDropinInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
759
+ static getFullPaymentMethodConfig(paymentMethod: PaymentMethodCode): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig | undefined> | undefined;
760
+ static isAddressSelectorEnabled(paymentMethod: PaymentMethodCode): boolean | undefined;
761
+ static isPaymentInstallmentsEnabled(paymentMethod: PaymentMethodCode): boolean | undefined;
762
+ static getPaymentInstallmentOptions(paymentMethod: PaymentMethodCode): PaymentInstallmentsConfig;
763
+ static getStoredInstrumentForPaymentMethod<T = CardMetadata | PayPalMetadata>(paymentMethod: PaymentMethodCode): Array<StoredPaymentInstrument<T>>;
764
+ static getPaymentMethodForStoredInstrument<T extends CardMetadata | PayPalMetadata>(instrument: StoredPaymentInstrument<T>): {
765
+ id: string;
766
+ description?: string;
767
+ status: PAYMENT_INSTRUMENT_STATUS;
768
+ integrationType: INTEGRATION_TYPE;
769
+ config: ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig | undefined;
770
+ clientConfig?: {
771
+ flow?: PAYMENT_CLIENT_FLOW;
772
+ displayName?: string;
773
+ supportsInstallments?: boolean;
774
+ installments?: PaymentInstallmentsConfig;
775
+ supportsBillingInfo?: boolean;
776
+ schema?: JSONSchemaType;
777
+ additionalConfig?: any;
778
+ instrumentDataSchema?: JSONSchemaType;
779
+ };
780
+ payoutInstruments?: StoredPaymentInstrument<CardMetadata | PayPalMetadata>[] | undefined;
781
+ paymentMethodCode: PaymentMethodCode;
782
+ payoutMethodCode?: PaymentMethodCode;
783
+ } | undefined;
784
+ static getPaymentMethodConfig(paymentMethod: StorablePaymentCompositionOption): {
785
+ id: string;
786
+ description?: string;
787
+ status: PAYMENT_INSTRUMENT_STATUS;
788
+ integrationType: INTEGRATION_TYPE;
789
+ config: ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig | undefined;
790
+ clientConfig?: {
791
+ flow?: PAYMENT_CLIENT_FLOW;
792
+ displayName?: string;
793
+ supportsInstallments?: boolean;
794
+ installments?: PaymentInstallmentsConfig;
795
+ supportsBillingInfo?: boolean;
796
+ schema?: JSONSchemaType;
797
+ additionalConfig?: any;
798
+ instrumentDataSchema?: JSONSchemaType;
799
+ };
800
+ payoutInstruments?: StoredPaymentInstrument<CardMetadata | PayPalMetadata>[] | undefined;
801
+ paymentMethodCode: PaymentMethodCode;
802
+ payoutMethodCode?: PaymentMethodCode;
803
+ };
804
+ static updateInstallmentOptions(installmentOptions?: PaymentInstallmentsConfig): void;
805
+ static updateMeta<K extends ExecutionMetaKey>(key: K, value: ExecutionMetaByKey[K]): void;
806
+ static getAllowedMeta(): ExecutionMeta;
807
+ static getUpdatedMeta(): ExecutionMeta;
808
+ private static pickMetaByKeys;
796
809
  }
797
-
798
- interface BinLookupResponse {
799
- bin: string;
800
- network: string;
801
- issuer?: string;
802
- issuerCountry?: {
803
- code?: string;
804
- name?: string;
805
- iso3?: string;
810
+ interface WorkflowExecutionResponse {
811
+ id: string;
812
+ merchantReference: string;
813
+ holderReference: string;
814
+ holderId?: string;
815
+ actionRequired?: string;
816
+ meta: ExecutionMeta;
817
+ status: Array<{
818
+ code: string;
819
+ time: string;
820
+ }>;
821
+ initialResults: Array<{
822
+ httpCode: number;
823
+ body: {
824
+ data: {
825
+ paymentCompositionOptions?: Array<StorablePaymentCompositionOption>;
826
+ payoutCompositionOptions?: Array<StorablePaymentCompositionOption>;
827
+ };
828
+ links: {
829
+ execution: string;
830
+ authorize?: {
831
+ href: string;
832
+ method: 'POST';
833
+ };
834
+ payout?: {
835
+ href: string;
836
+ method: 'POST';
837
+ };
838
+ startPaymentSession?: {
839
+ href: string;
840
+ method: 'POST';
841
+ };
842
+ createInstrument?: {
843
+ href: string;
844
+ method: 'POST';
845
+ };
846
+ };
847
+ name: 'lookup';
848
+ };
849
+ }>;
850
+ links: {
851
+ startPaymentSession?: {
852
+ href: string;
853
+ method: 'POST';
854
+ };
855
+ createInstrument?: {
856
+ href: string;
857
+ method: 'POST';
858
+ };
859
+ confirm?: {
860
+ href: string;
861
+ action?: {
862
+ parameters?: {
863
+ orderId?: string;
864
+ tokenId?: string;
865
+ };
866
+ paymentId?: string;
867
+ sdkToken?: string;
868
+ appToken?: string;
869
+ successUrl?: string;
870
+ failureUrl?: string;
871
+ sandbox?: boolean;
872
+ };
873
+ };
874
+ redirect?: string;
875
+ '3ds'?: string;
876
+ self: string;
877
+ };
878
+ workflow: {
879
+ code: string;
880
+ version: number;
806
881
  };
807
- type?: string;
808
- }
809
-
810
- declare enum RedactionType {
811
- DEFAULT = "DEFAULT",
812
- PLAIN_TEXT = "PLAIN_TEXT",
813
- MASKED = "MASKED",
814
- REDACTED = "REDACTED"
815
- }
816
- declare enum RequestMethod$1 {
817
- GET = "GET",
818
- POST = "POST",
819
- PUT = "PUT",
820
- PATCH = "PATCH",
821
- DELETE = "DELETE"
822
- }
823
- declare enum EventName {
824
- CHANGE = "CHANGE",
825
- READY = "READY",
826
- FOCUS = "FOCUS",
827
- BLUR = "BLUR",
828
- SUBMIT = "SUBMIT"
829
882
  }
830
- declare enum LogLevel {
831
- WARN = "WARN",
832
- INFO = "INFO",
833
- DEBUG = "DEBUG",
834
- ERROR = "ERROR"
883
+ interface BasePaymentMethodConfig {
884
+ paymentMethodCode: PaymentMethodCode;
885
+ payoutMethodCode?: PaymentMethodCode;
835
886
  }
836
- declare enum Env {
837
- DEV = "DEV",
838
- PROD = "PROD"
887
+ interface BaseInstallmentOption {
888
+ count: number;
889
+ amount: number;
839
890
  }
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"
891
+ interface PaymentInstallmentsConfig {
892
+ [key: string]: BaseInstallmentOption[];
844
893
  }
845
- interface IInsertRecordInput {
846
- records: IInsertRecord[];
894
+ interface InstallmentUpdateConfig {
895
+ defaultInstallment?: number | null;
896
+ installmentCountry?: string | null;
897
+ installmentOptions?: BaseInstallmentOption[] | null;
847
898
  }
848
- interface IInsertRecord {
849
- table: string;
850
- fields: Record<string, any>;
851
- skyflowID?: string;
899
+ interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C = undefined | ApplePayConfig | PayPalConfig | GooglePayWorkflowConfig> extends BasePaymentMethodConfig {
900
+ id: string;
901
+ description?: string;
902
+ status: PAYMENT_INSTRUMENT_STATUS;
903
+ integrationType: INTEGRATION_TYPE;
904
+ config: C;
905
+ clientConfig?: {
906
+ flow?: PAYMENT_CLIENT_FLOW;
907
+ displayName?: string;
908
+ supportsInstallments?: boolean;
909
+ installments?: PaymentInstallmentsConfig;
910
+ supportsBillingInfo?: boolean;
911
+ schema?: JSONSchemaType;
912
+ additionalConfig?: any;
913
+ instrumentDataSchema?: JSONSchemaType;
914
+ };
915
+ paymentInstruments?: Array<StoredPaymentInstrument<I>>;
916
+ payoutInstruments?: Array<StoredPaymentInstrument<I>>;
852
917
  }
853
- interface Context {
854
- logLevel: LogLevel;
855
- env: Env;
918
+ interface GooglePayWorkflowConfig {
919
+ parameters: {
920
+ allowedAuthMethods: google.payments.api.CardAuthMethod[];
921
+ allowedCardNetworks: google.payments.api.CardNetwork[];
922
+ billingAddressParameters?: {
923
+ format?: string;
924
+ };
925
+ billingAddressRequired?: boolean;
926
+ };
927
+ tokenizationSpecification: google.payments.api.PaymentMethodTokenizationSpecification;
928
+ type: google.payments.api.PaymentMethodType;
929
+ apiVersion?: number;
930
+ apiVersionMinor?: number;
931
+ allowedPaymentMethods?: google.payments.api.PaymentMethodSpecification[];
932
+ emailRequired?: boolean;
933
+ shippingAddressRequired?: boolean;
934
+ shippingAddressParameters?: google.payments.api.ShippingAddressParameters;
935
+ merchantInfo?: google.payments.api.MerchantInfo;
936
+ existingPaymentMethodRequired?: boolean;
856
937
  }
857
- interface IValidationRule {
858
- type: ValidationRuleType;
859
- params: any;
938
+ interface PayPalConfig {
939
+ clientId: string;
940
+ merchantId: string;
941
+ captureMode: 'Delayed' | 'Instant' | 'Manual';
942
+ integrationMode: 'express' | 'normal';
860
943
  }
861
-
862
- interface IUpsertOptions {
863
- table: string;
864
- column: string;
944
+ interface ApplePayConfig {
945
+ parameters: {
946
+ merchantIdentifier: string;
947
+ supportedNetworks: string[];
948
+ countryCode: string;
949
+ merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
950
+ requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
951
+ requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
952
+ };
953
+ type: string;
865
954
  }
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"
955
+ interface StoredPaymentInstrument<T = CardMetadata | PayPalMetadata | BankAccountMetadata> {
956
+ id: string;
957
+ status: PAYMENT_INSTRUMENT_STATUS;
958
+ paymentMethod: PaymentMethodCode;
959
+ displayName?: string;
960
+ data?: T;
961
+ default?: boolean;
962
+ createdAt?: string;
963
+ updatedAt?: string;
964
+ holderId?: string;
965
+ fingerprint?: string;
966
+ futureUsage?: FutureUsages;
876
967
  }
877
-
878
- declare abstract class Container {
968
+ interface PayPalMetadata {
969
+ email?: string;
879
970
  }
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;
971
+ interface Country {
972
+ code: string;
973
+ name: string;
974
+ iso3: string;
893
975
  }
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;
976
+ interface CardMetadata {
977
+ bin?: string;
978
+ suffix?: string;
979
+ network?: string;
980
+ binLookup?: {
981
+ issuerCountry: Country;
982
+ };
902
983
  }
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;
984
+ interface BankAccountMetadata {
985
+ bankAccount: {
986
+ holder: HolderData;
987
+ bank: BankData;
988
+ account: AccountData;
922
989
  };
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;
934
990
  }
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;
991
+ interface HolderData {
992
+ firstName?: string;
993
+ lastName?: string;
994
+ companyName?: string;
995
+ address?: Address;
996
+ email?: string;
997
+ dob?: string;
998
+ country?: Country;
999
+ city?: string;
1000
+ type: HolderType;
948
1001
  }
949
- interface ICollectOptions$1 {
950
- tokens?: boolean;
951
- additionalFields?: IInsertRecordInput;
952
- upsert?: Array<IUpsertOptions>;
1002
+ type HolderType = 'individual' | 'corporate';
1003
+ interface BankData {
1004
+ name?: string;
1005
+ branchCode?: string;
1006
+ code?: string;
1007
+ address?: Address;
1008
+ swiftCode?: string;
1009
+ }
1010
+ interface AccountData {
1011
+ number?: string;
1012
+ iban?: string;
1013
+ currency?: string;
1014
+ type?: AccountType;
1015
+ country?: Country;
953
1016
  }
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;
1017
+ type AccountType = 'savings' | 'current';
1018
+ interface Address {
1019
+ country?: {
1020
+ code?: string;
1021
+ fullName?: string;
1022
+ iso3?: string;
1023
+ };
1024
+ postalCode?: string;
965
1025
  }
966
-
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;
1026
+ declare enum PAYMENT_CLIENT_FLOW {
1027
+ 'REDIRECT' = "redirect",
1028
+ 'DIRECT' = "direct",
1029
+ 'EMBEDDED' = "embedded"
1030
+ }
1031
+ declare enum INTEGRATION_TYPE {
1032
+ API = "api",
1033
+ HPP = "hpp"
985
1034
  }
986
1035
 
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;
1036
+ type FutureUsages = 'CardOnFile' | 'Subscription' | 'UnscheduledCardOnFile';
1037
+ interface SaveInstrumentResponse {
1038
+ id: string;
1039
+ createdAt: string;
1040
+ holderId: string;
1041
+ paymentMethod: PAYMENT_METHOD_CODES.CARD;
1042
+ status: PAYMENT_INSTRUMENT_STATUS;
1043
+ data: {
1044
+ bin: string;
1045
+ binLookup?: {
1046
+ bin: string;
1047
+ network: string;
1048
+ issuer?: string;
1049
+ issuerCountry?: {
1050
+ code?: string;
1051
+ name?: string;
1052
+ iso3?: string;
1053
+ };
1054
+ type?: string;
1055
+ };
1056
+ holderName?: string;
1057
+ network: string;
1058
+ suffix: string;
1059
+ expiryMonth?: string;
1060
+ expiryYear?: string;
1061
+ };
1062
+ fingerprint?: string;
1063
+ futureUsage?: string;
995
1064
  }
996
1065
 
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;
1066
+ interface SdkConfiguration {
1067
+ token: string;
1068
+ amount: PayrailsAmount;
1069
+ holderReference: string;
1070
+ links?: {
1071
+ binLookup?: Links;
1072
+ instrumentDelete?: Links;
1073
+ instrumentUpdate?: Links;
1074
+ };
1075
+ type?: 'tokenization' | 'dropIn' | 'secureFields';
1076
+ vaultConfiguration: {
1077
+ cardTableName: string;
1078
+ token: string;
1079
+ vaultId: string;
1080
+ vaultUrl: string;
1081
+ providerId: string;
1082
+ providerConfigId: string;
1083
+ vaultType: 'Payrails' | 'Test';
1084
+ encryptionPublicKey?: string;
1085
+ links: {
1086
+ saveInstrument: {
1087
+ href: string;
1088
+ };
1089
+ };
1090
+ };
1091
+ execution?: WorkflowExecutionResponse;
1092
+ featureConfig?: SdkFeatureConfig;
1093
+ morData?: MorData;
1013
1094
  }
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>;
1095
+ interface MorData {
1096
+ billingLines?: {
1097
+ street?: string;
1098
+ line2?: string;
1099
+ city?: string;
1100
+ state?: string;
1101
+ postalCode?: string;
1102
+ email?: string;
1103
+ country?: string;
1104
+ form?: JSONSchemaType;
1105
+ };
1022
1106
  }
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;
1107
+ interface SdkFeatureConfig {
1108
+ gpayIframeRollout?: number;
1109
+ secureFieldsRollout?: number;
1125
1110
  }
1126
-
1127
- declare enum ContainerType {
1128
- COLLECT = "COLLECT",
1129
- COMPOSABLE = "COMPOSABLE"
1111
+ interface PayrailsAmount {
1112
+ value: string;
1113
+ currency: string;
1130
1114
  }
1131
- interface ISkyflow {
1132
- vaultID?: string;
1133
- vaultURL?: string;
1134
- getBearerToken: () => Promise<string>;
1135
- options?: Record<string, any>;
1115
+ interface LookupUpdateOptions {
1116
+ value?: string;
1117
+ currency?: string;
1118
+ installmentConfig?: InstallmentUpdateConfig | null;
1119
+ meta?: ExecutionMetaUpdate;
1136
1120
  }
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;
1121
+ interface Links {
1122
+ method: 'GET' | 'POST';
1123
+ href: string;
1151
1124
  }
1152
1125
 
1153
- interface TokenizeOptions {
1154
- futureUsage?: FutureUsages;
1155
- storeInstrument?: boolean;
1126
+ interface ReturnInfo {
1127
+ success?: string;
1128
+ cancel?: string;
1129
+ error?: string;
1130
+ pending?: string;
1156
1131
  }
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>;
1132
+ interface PayoutResponse {
1133
+ name: 'payout';
1134
+ executedAt: string;
1135
+ workspaceId: string;
1136
+ actionId: string;
1137
+ links: {
1138
+ execution: string;
1139
+ };
1161
1140
  }
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"
1141
+ type PayoutComposition = Array<{
1142
+ integrationType: string;
1143
+ amount: PayrailsAmount;
1144
+ paymentMethodCode: PaymentMethodCode;
1145
+ paymentInstrumentId?: string;
1146
+ }>;
1147
+ interface PayoutReqBody {
1148
+ amount: PayrailsAmount;
1149
+ payoutComposition: PayoutComposition;
1170
1150
  }
1151
+ type ERROR_RESULT = 'Unknown' | 'UnexpectedProviderResponse' | 'ProviderUnknownError' | 'ProviderConnectionError' | 'Timeout' | 'ProviderTimeout' | 'GenericRejection' | 'DuplicateOperation' | 'OperationNotAllowed' | 'NetworkTransactionReferenceRejected' | 'PayerCanceled' | 'LimitExceeded' | 'InstrumentNotAllowed' | 'InvalidInstrument' | 'InsufficientBalance' | 'BlockedInstrument' | 'ExpiredInstrument' | 'ValidationError' | 'ParamsError' | 'ProviderConfigError' | 'InvalidSignature' | 'InternalServerError' | 'AuthenticationError' | 'PaymentMethodNotSupported' | 'PayerAuthenticationRequired' | 'PayerAuthenticationFailed' | 'FraudRisk';
1171
1152
 
1172
- type FieldErrors = Partial<Record<'cardNumber' | 'expiry' | 'cvv' | 'holderName', string>>;
1173
- type ValidateCardFormResult = {
1153
+ interface IAddress {
1154
+ country?: {
1155
+ code?: string;
1156
+ fullName?: string;
1157
+ iso3?: string;
1158
+ };
1159
+ postalCode?: string;
1160
+ }
1161
+ interface IOnChange {
1174
1162
  isValid: boolean;
1175
- error?: string;
1176
- fieldErrors?: FieldErrors;
1177
- };
1178
- interface EncryptedCollectResult {
1179
- vaultProviderConfigId: string;
1180
- encryptedData: string;
1163
+ billingAddress?: IAddress;
1181
1164
  }
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;
1165
+ interface AddressSelectorElementOptions extends ElementOptions {
1193
1166
  translations?: {
1194
- error?: {
1195
- default?: string;
1167
+ labels?: {
1168
+ countrySelector?: string;
1169
+ postalCodeInput?: string;
1170
+ };
1171
+ placeholders?: {
1172
+ postalCodeInput?: string;
1173
+ countrySelector?: string;
1196
1174
  };
1197
1175
  };
1198
- }
1199
- type PayrailsContainerType = 'COLLECT' | 'COMPOSABLE';
1200
- interface CollectContainerOptions {
1201
- layout?: number[];
1202
- cardTableName?: string;
1203
- containerType?: PayrailsContainerType;
1204
1176
  styles?: {
1205
- base?: Partial<CSSStyleDeclaration>;
1177
+ wrapper?: Partial<CSSStyleDeclaration>;
1178
+ countrySelector?: {
1179
+ wrapper?: Partial<CSSStyleDeclaration>;
1180
+ element?: Partial<CSSStyleDeclaration>;
1181
+ label?: Partial<CSSStyleDeclaration>;
1182
+ };
1183
+ postalCodeInput?: {
1184
+ wrapper?: Partial<CSSStyleDeclaration>;
1185
+ element?: Partial<CSSStyleDeclaration>;
1186
+ label?: Partial<CSSStyleDeclaration>;
1187
+ };
1206
1188
  };
1207
- errorTextStyles?: {
1208
- base?: Partial<CSSStyleDeclaration>;
1189
+ events?: {
1190
+ onBillingAddressChanged?: (e: IOnChange) => void;
1209
1191
  };
1210
- fonts?: FontDescriptor[];
1211
1192
  }
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;
1193
+
1194
+ interface StoreInstrumentElementOptions extends ElementOptions {
1195
+ showStoreInstrumentCheckbox?: boolean;
1196
+ alwaysStoreInstrument?: boolean;
1197
+ defaultStoreInstrumentState?: 'checked' | 'unchecked';
1198
+ translations?: {
1199
+ labels?: {
1200
+ storeInstrument?: string;
1201
+ saveInstrument?: string;
1202
+ };
1225
1203
  };
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;
1204
+ styles?: {
1205
+ storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
1206
+ };
1207
+ events?: PayrailsSDKEvents;
1233
1208
  }
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;
1209
+ declare class StoreInstrumentCheckbox extends PayrailsElement {
1210
+ private options;
1211
+ constructor(options: StoreInstrumentElementOptions);
1212
+ get isChecked(): boolean;
1213
+ private createHTML;
1214
+ private applyStyles;
1215
+ private addListeners;
1216
+ }
1217
+ declare abstract class PayrailsElementWithStoreInstrumentCheckbox extends PayrailsElement {
1218
+ protected options?: StoreInstrumentElementOptions | undefined;
1219
+ protected storeInstrumentCheckbox: StoreInstrumentCheckbox | null;
1220
+ protected constructor(elementType: string, options?: StoreInstrumentElementOptions | undefined);
1221
+ protected get shouldStoreInstrument(): boolean;
1222
+ }
1223
+
1224
+ interface ApplePayButtonOptions extends StoreInstrumentElementOptions {
1225
+ clientDomain?: string;
1226
+ showPaymentMethodLogo?: boolean;
1227
+ abortAfterAuthorizeFailed?: boolean;
1228
+ translations?: {
1229
+ labels?: {
1230
+ storeInstrument?: string;
1231
+ saveInstrument?: string;
1232
+ paymentScreenLabel?: string;
1233
+ };
1234
+ };
1235
+ events?: PaymentEvents & Pick<UIEvents, 'onDeliveryAddressChanged'> & {
1236
+ onApplePayAvailable?: () => void;
1237
+ };
1238
+ styles?: {
1239
+ type?: 'plain' | 'buy' | 'addMoney' | 'book' | 'checkout' | 'continue' | 'contribute' | 'donate' | 'inStore' | 'order' | 'reload' | 'rent' | 'setUp' | 'subscribe' | 'support' | 'tip' | 'topUp';
1240
+ style?: 'white' | 'whiteOutline' | 'black' | 'automatic';
1241
+ locale?: string;
1242
+ } & StoreInstrumentElementOptions['styles'];
1243
+ }
1244
+ declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
1245
+ protected options: ApplePayButtonOptions;
1246
+ private appleButton;
1247
+ private paymentExecutor;
1248
+ private action;
1249
+ private isProcessing;
1250
+ private completedSessions;
1251
+ private abortedSessionReasons;
1252
+ static isApplePayAvailable(): Promise<boolean>;
1253
+ constructor(options: ApplePayButtonOptions);
1254
+ mount(location: string): void;
1250
1255
  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
- }>;
1256
+ private mountApplePayButton;
1257
+ private onAuthorizeFailedHandler;
1258
+ private completeApplePaySession;
1259
+ private createApplePaySession;
1260
+ /**
1261
+ * Apple Pay only exposes redacted contact fields here for privacy
1262
+ * (`countryCode`, `administrativeArea`, `locality`, `postalCode`); full
1263
+ * address is revealed in `onpaymentauthorized` after the user authorizes.
1264
+ *
1265
+ * The session must be answered with `completeShippingContactSelection`
1266
+ * within ~30s or Apple aborts the sheet — so the merchant's
1267
+ * `onDeliveryAddressChanged` callback must be fast.
1268
+ *
1269
+ * `amount` is passed in (rather than read from `getSDKConfig()`) so the
1270
+ * response carries the same total the session was created with, even if
1271
+ * the SDK config is mutated mid-flow.
1272
+ */
1273
+ private onApplePayShippingContactSelected;
1274
+ private onApplePayAuthorized;
1275
+ private doAuthorizedPayment;
1276
+ private doTokenize;
1263
1277
  }
1264
1278
 
1265
1279
  declare const regexes: {
@@ -1391,13 +1405,25 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
1391
1405
  private defaultStyles;
1392
1406
  private defaultTranslations;
1393
1407
  private eventsRef?;
1394
- constructor(collectContainer: PayrailsCollectContainer, options?: CardFormOptions | undefined);
1408
+ constructor(collectContainer: FramesContainer, options?: CardFormOptions | undefined);
1395
1409
  private initializeFormFields;
1396
1410
  getErrorTextStyles(errorTextStyles: any): any;
1397
1411
  private updateStyles;
1398
1412
  private updateTranslations;
1399
1413
  private updateEvents;
1400
1414
  update(options: Partial<Pick<CardFormOptions, 'styles' | 'translations' | 'events'>>): void;
1415
+ /**
1416
+ * Legacy (Skyflow) path: prepare per-field flat payloads and dispatch to
1417
+ * each field's vault element. Skyflow merges shallowly on its side.
1418
+ */
1419
+ private updateSkyflow;
1420
+ /**
1421
+ * Secure-fields path: forward styles/translations to the single CARD_FORM
1422
+ * frame 1:1; the frame fans them out per child via resolveFieldData. Host
1423
+ * defaults are deep-merged so successive updates accumulate symmetrically
1424
+ * with the frame's own accumulation.
1425
+ */
1426
+ private updateSecureFields;
1401
1427
  updateInstallmentConfig(installmentConfig?: InstallmentUpdateConfig): void;
1402
1428
  private createFormField;
1403
1429
  private isFieldRequired;
@@ -1405,7 +1431,7 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
1405
1431
  private hasFieldBeenUsed;
1406
1432
  private initializeDefaultLayout;
1407
1433
  private throttledFetchBinLookupIfChanged;
1408
- tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
1434
+ tokenize(opts: TokenizeOptions): Promise<any>;
1409
1435
  private createAddressSelector;
1410
1436
  show(): void;
1411
1437
  hide(options?: {
@@ -1554,7 +1580,7 @@ interface LoadingScreenStyles {
1554
1580
  [StyleKeys.loader]?: Partial<CSSStyleDeclaration>;
1555
1581
  }
1556
1582
 
1557
- type GooglePayConfigInput = google.payments.api.IsReadyToPayPaymentMethodSpecification[] | GooglePayConfig;
1583
+ type GooglePayConfigInput = google.payments.api.IsReadyToPayPaymentMethodSpecification[] | GooglePayWorkflowConfig;
1558
1584
  interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
1559
1585
  environment?: PayrailsEnvironment;
1560
1586
  merchantInfo?: google.payments.api.MerchantInfo;
@@ -1866,7 +1892,7 @@ declare class Dropin extends PayrailsElement {
1866
1892
  private loadingScreen;
1867
1893
  private billingAddressForm;
1868
1894
  private billingValidationBlocked;
1869
- constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions);
1895
+ constructor(collectContainer: FramesContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions);
1870
1896
  private get returnInfo();
1871
1897
  private isHppIntegration;
1872
1898
  private createStoredInstrumentElement;
@@ -2208,7 +2234,7 @@ declare class Payrails {
2208
2234
  static preloadCardForm: typeof SdkLoader.preloadCardForm;
2209
2235
  static init(initResponse: InitOptions, options?: PayrailsClientOptions): Payrails;
2210
2236
  update(updateOptions: LookupUpdateOptions): void;
2211
- collectContainer(containerOptions: CollectContainerOptions): PayrailsCollectContainer;
2237
+ collectContainer(containerOptions: CollectContainerOptions): FramesContainer;
2212
2238
  googlePayButton(options: GooglePayButtonOptions): GooglePayButton;
2213
2239
  isGooglePayAvailable(merchantInfo: google.payments.api.MerchantInfo): Promise<boolean>;
2214
2240
  applePayButton(options: ApplePayButtonOptions): ApplePayButton;