@payrails/web-sdk 3.1.0 → 3.2.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.
Files changed (3) hide show
  1. package/index.js +5 -4
  2. package/package.json +1 -6
  3. package/payrails.d.ts +970 -962
package/payrails.d.ts CHANGED
@@ -1,1027 +1,1035 @@
1
1
  /// <reference types="applepayjs" />
2
2
  /// <reference types="googlepay" />
3
- declare enum PAYMENT_METHOD_CODES {
4
- 'CARD' = "card",
5
- 'GOOGLE_PAY' = "googlePay",
6
- 'PAYPAL' = "payPal",
7
- 'APPLE_PAY' = "applePay"
8
- }
9
- declare enum PAYMENT_INSTRUMENT_STATUS {
10
- 'ENABLED' = "enabled",
11
- 'CREATED' = "created",
12
- 'DELETED' = "deleted",
13
- 'DISABLED' = "disabled",
14
- 'INVALID' = "invalid",
15
- 'TRANSIENT' = "transient"
16
- }
17
- declare class WorkflowExecution {
18
- private executionResponse;
19
- constructor(executionResponse: WorkflowExecutionResponse);
20
- get lookup(): {
21
- httpCode: number;
22
- body: {
23
- data: {
24
- paymentCompositionOptions: StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined>[];
25
- };
26
- links: {
27
- authorize: {
28
- href: string;
29
- method: "POST";
30
- };
31
- execution: string;
32
- };
33
- name: "lookup";
34
- };
35
- } | undefined;
36
- get holderReference(): string;
37
- get savedCreditCards(): StoredPaymentInstrument<CardMetadata>[];
38
- get savedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
39
- get savedGooglePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
40
- get savedApplePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
41
- get paypalConfig(): PayPalConfig;
42
- get googlePayConfig(): GooglePayConfig[];
43
- isPaymentMethodAvailable(paymentMethod: PAYMENT_METHOD_CODES): boolean;
44
- get applePayConfig(): {
45
- merchantIdentifier: string;
46
- supportedNetworks: string[];
47
- countryCode: string;
48
- merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
49
- };
50
- get url(): string;
51
- get response(): WorkflowExecutionResponse;
52
- get meta(): {
53
- customer?: {
54
- country?: {
55
- code: string;
56
- } | undefined;
57
- } | undefined;
58
- };
59
- get availablePaymentMethods(): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined>[];
60
- get authorizeLink(): string | undefined;
61
- get createSessionLink(): string | undefined;
62
- get storedPaymentInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
63
- private getStoredInstrumentForPaymentMethod;
64
- }
65
- interface WorkflowExecutionResponse {
66
- id: string;
67
- merchantReference: string;
68
- holderReference: string;
69
- actionRequired?: string;
70
- meta: {
71
- customer?: {
72
- country?: {
73
- code: string;
74
- };
75
- };
76
- };
77
- status: Array<{
78
- code: string;
79
- time: string;
80
- }>;
81
- initialResults: Array<{
82
- httpCode: number;
83
- body: {
84
- data: {
85
- paymentCompositionOptions: Array<StorablePaymentCompositionOption>;
86
- };
87
- links: {
88
- authorize: {
89
- href: string;
90
- method: 'POST';
91
- };
92
- execution: string;
93
- };
94
- name: 'lookup';
95
- };
96
- }>;
97
- links: {
98
- startPaymentSession?: {
99
- href: string;
100
- method: 'POST';
101
- };
102
- confirm?: {
103
- href: string;
104
- action?: {
105
- parameters?: {
106
- orderId?: string;
107
- tokenId?: string;
108
- };
109
- };
110
- };
111
- '3ds'?: string;
112
- self: string;
113
- };
114
- }
115
- interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C = undefined | ApplePayConfig | PayPalConfig | GooglePayConfig> {
116
- paymentMethodCode?: PAYMENT_METHOD_CODES;
117
- description: string;
118
- id: string;
119
- status: PAYMENT_INSTRUMENT_STATUS;
120
- config: C;
121
- paymentInstruments?: Array<StoredPaymentInstrument<I>>;
122
- integrationType: string;
123
- }
124
- interface GooglePayConfig {
125
- parameters: {
126
- allowedAuthMethods: string[];
127
- allowedCardNetworks: string[];
128
- };
129
- tokenizationSpecification: {
130
- parameters: {
131
- gateway: string;
132
- gatewayMerchantId: string;
133
- };
134
- type: string;
135
- };
136
- type: string;
137
- }
138
- interface PayPalConfig {
139
- clientId: string;
140
- merchantId: string;
141
- captureMode: 'Delayed' | 'Instant' | 'Manual';
142
- }
143
- interface ApplePayConfig {
144
- parameters: {
145
- merchantIdentifier: string;
146
- supportedNetworks: string[];
147
- countryCode: string;
148
- merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
149
- };
150
- type: string;
151
- }
152
- interface StoredPaymentInstrument<T = CardMetadata | PayPalMetadata> {
153
- id: string;
154
- status: PAYMENT_INSTRUMENT_STATUS;
155
- paymentMethod: PAYMENT_METHOD_CODES;
156
- data?: T;
157
- }
158
- interface PayPalMetadata {
159
- email?: string;
160
- }
161
- interface CardMetadata {
162
- bin?: string;
163
- suffix?: string;
3
+ declare enum PAYMENT_METHOD_CODES {
4
+ 'CARD' = "card",
5
+ 'GOOGLE_PAY' = "googlePay",
6
+ 'PAYPAL' = "payPal",
7
+ 'APPLE_PAY' = "applePay"
8
+ }
9
+ declare enum PAYMENT_INSTRUMENT_STATUS {
10
+ 'ENABLED' = "enabled",
11
+ 'CREATED' = "created",
12
+ 'DELETED' = "deleted",
13
+ 'DISABLED' = "disabled",
14
+ 'INVALID' = "invalid",
15
+ 'TRANSIENT' = "transient"
16
+ }
17
+ declare class WorkflowExecution {
18
+ private executionResponse;
19
+ constructor(executionResponse: WorkflowExecutionResponse);
20
+ get lookup(): {
21
+ httpCode: number;
22
+ body: {
23
+ data: {
24
+ paymentCompositionOptions: StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined>[];
25
+ };
26
+ links: {
27
+ authorize: {
28
+ href: string;
29
+ method: "POST";
30
+ };
31
+ execution: string;
32
+ };
33
+ name: "lookup";
34
+ };
35
+ } | undefined;
36
+ get holderReference(): string;
37
+ get savedCreditCards(): StoredPaymentInstrument<CardMetadata>[];
38
+ get savedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
39
+ get savedGooglePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
40
+ get savedApplePayAccounts(): StoredPaymentInstrument<CardMetadata>[];
41
+ get paypalConfig(): PayPalConfig;
42
+ get googlePayConfig(): GooglePayConfig[];
43
+ isPaymentMethodAvailable(paymentMethod: PAYMENT_METHOD_CODES): boolean;
44
+ get applePayConfig(): {
45
+ merchantIdentifier: string;
46
+ supportedNetworks: string[];
47
+ countryCode: string;
48
+ merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
49
+ };
50
+ get url(): string;
51
+ get response(): WorkflowExecutionResponse;
52
+ get meta(): {
53
+ customer?: {
54
+ country?: {
55
+ code: string;
56
+ } | undefined;
57
+ } | undefined;
58
+ };
59
+ get availablePaymentMethods(): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined>[];
60
+ get authorizeLink(): string | undefined;
61
+ get createSessionLink(): string | undefined;
62
+ get storedPaymentInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
63
+ private getStoredInstrumentForPaymentMethod;
64
+ }
65
+ interface WorkflowExecutionResponse {
66
+ id: string;
67
+ merchantReference: string;
68
+ holderReference: string;
69
+ actionRequired?: string;
70
+ meta: {
71
+ customer?: {
72
+ country?: {
73
+ code: string;
74
+ };
75
+ };
76
+ };
77
+ status: Array<{
78
+ code: string;
79
+ time: string;
80
+ }>;
81
+ initialResults: Array<{
82
+ httpCode: number;
83
+ body: {
84
+ data: {
85
+ paymentCompositionOptions: Array<StorablePaymentCompositionOption>;
86
+ };
87
+ links: {
88
+ authorize: {
89
+ href: string;
90
+ method: 'POST';
91
+ };
92
+ execution: string;
93
+ };
94
+ name: 'lookup';
95
+ };
96
+ }>;
97
+ links: {
98
+ startPaymentSession?: {
99
+ href: string;
100
+ method: 'POST';
101
+ };
102
+ confirm?: {
103
+ href: string;
104
+ action?: {
105
+ parameters?: {
106
+ orderId?: string;
107
+ tokenId?: string;
108
+ };
109
+ };
110
+ };
111
+ '3ds'?: string;
112
+ self: string;
113
+ };
114
+ workflow: {
115
+ code: string;
116
+ version: number;
117
+ };
118
+ }
119
+ interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C = undefined | ApplePayConfig | PayPalConfig | GooglePayConfig> {
120
+ paymentMethodCode?: PAYMENT_METHOD_CODES;
121
+ description: string;
122
+ id: string;
123
+ status: PAYMENT_INSTRUMENT_STATUS;
124
+ config: C;
125
+ paymentInstruments?: Array<StoredPaymentInstrument<I>>;
126
+ integrationType: string;
127
+ }
128
+ interface GooglePayConfig {
129
+ parameters: {
130
+ allowedAuthMethods: string[];
131
+ allowedCardNetworks: string[];
132
+ };
133
+ tokenizationSpecification: {
134
+ parameters: {
135
+ gateway: string;
136
+ gatewayMerchantId: string;
137
+ };
138
+ type: string;
139
+ };
140
+ type: string;
141
+ }
142
+ interface PayPalConfig {
143
+ clientId: string;
144
+ merchantId: string;
145
+ captureMode: 'Delayed' | 'Instant' | 'Manual';
146
+ }
147
+ interface ApplePayConfig {
148
+ parameters: {
149
+ merchantIdentifier: string;
150
+ supportedNetworks: string[];
151
+ countryCode: string;
152
+ merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
153
+ };
154
+ type: string;
155
+ }
156
+ interface StoredPaymentInstrument<T = CardMetadata | PayPalMetadata> {
157
+ id: string;
158
+ status: PAYMENT_INSTRUMENT_STATUS;
159
+ paymentMethod: PAYMENT_METHOD_CODES;
160
+ data?: T;
161
+ }
162
+ interface PayPalMetadata {
163
+ email?: string;
164
+ }
165
+ interface CardMetadata {
166
+ bin?: string;
167
+ suffix?: string;
164
168
  }
165
169
 
166
- interface SaveInstrumentResponse {
167
- id: string;
168
- createdAt: string;
169
- holderId: string;
170
- paymentMethod: PAYMENT_METHOD_CODES.CARD;
171
- status: PAYMENT_INSTRUMENT_STATUS;
172
- data: {
173
- bin: string;
174
- binLookup?: {
175
- bin: string;
176
- network: string;
177
- issuer?: string;
178
- issuerCountry?: {
179
- code?: string;
180
- name?: string;
181
- iso3?: string;
182
- };
183
- type?: string;
184
- };
185
- holderName?: string;
186
- network: string;
187
- suffix: string;
188
- expiryMonth?: string;
189
- expiryYear?: string;
190
- };
191
- fingerprint?: string;
192
- futureUsage?: string;
170
+ interface SaveInstrumentResponse {
171
+ id: string;
172
+ createdAt: string;
173
+ holderId: string;
174
+ paymentMethod: PAYMENT_METHOD_CODES.CARD;
175
+ status: PAYMENT_INSTRUMENT_STATUS;
176
+ data: {
177
+ bin: string;
178
+ binLookup?: {
179
+ bin: string;
180
+ network: string;
181
+ issuer?: string;
182
+ issuerCountry?: {
183
+ code?: string;
184
+ name?: string;
185
+ iso3?: string;
186
+ };
187
+ type?: string;
188
+ };
189
+ holderName?: string;
190
+ network: string;
191
+ suffix: string;
192
+ expiryMonth?: string;
193
+ expiryYear?: string;
194
+ };
195
+ fingerprint?: string;
196
+ futureUsage?: string;
193
197
  }
194
198
 
195
- declare enum ElementType$1 {
196
- CVV = "CVV",
197
- EXPIRATION_DATE = "EXPIRATION_DATE",
198
- CARD_NUMBER = "CARD_NUMBER",
199
- CARDHOLDER_NAME = "CARDHOLDER_NAME",
200
- INPUT_FIELD = "INPUT_FIELD",
201
- PIN = "PIN",
202
- EXPIRATION_MONTH = "EXPIRATION_MONTH",
203
- EXPIRATION_YEAR = "EXPIRATION_YEAR"
199
+ declare enum ElementType$1 {
200
+ CVV = "CVV",
201
+ EXPIRATION_DATE = "EXPIRATION_DATE",
202
+ CARD_NUMBER = "CARD_NUMBER",
203
+ CARDHOLDER_NAME = "CARDHOLDER_NAME",
204
+ INPUT_FIELD = "INPUT_FIELD",
205
+ PIN = "PIN",
206
+ EXPIRATION_MONTH = "EXPIRATION_MONTH",
207
+ EXPIRATION_YEAR = "EXPIRATION_YEAR"
204
208
  }
205
209
 
206
- declare enum RedactionType {
207
- DEFAULT = "DEFAULT",
208
- PLAIN_TEXT = "PLAIN_TEXT",
209
- MASKED = "MASKED",
210
- REDACTED = "REDACTED"
211
- }
212
- declare enum RequestMethod {
213
- GET = "GET",
214
- POST = "POST",
215
- PUT = "PUT",
216
- PATCH = "PATCH",
217
- DELETE = "DELETE"
218
- }
219
- declare enum EventName {
220
- CHANGE = "CHANGE",
221
- READY = "READY",
222
- FOCUS = "FOCUS",
223
- BLUR = "BLUR",
224
- SUBMIT = "SUBMIT"
225
- }
226
- declare enum LogLevel {
227
- WARN = "WARN",
228
- INFO = "INFO",
229
- DEBUG = "DEBUG",
230
- ERROR = "ERROR"
231
- }
232
- declare enum Env {
233
- DEV = "DEV",
234
- PROD = "PROD"
235
- }
236
- declare enum ValidationRuleType {
237
- REGEX_MATCH_RULE = "REGEX_MATCH_RULE",
238
- LENGTH_MATCH_RULE = "LENGTH_MATCH_RULE",
239
- ELEMENT_VALUE_MATCH_RULE = "ELEMENT_VALUE_MATCH_RULE"
240
- }
241
- interface IInsertRecordInput {
242
- records: IInsertRecord[];
243
- }
244
- interface IInsertRecord {
245
- table: string;
246
- fields: Record<string, any>;
247
- skyflowID?: string;
248
- }
249
- interface IGetRecord {
250
- ids?: string[];
251
- redaction?: RedactionType;
252
- table: string;
253
- columnName?: string;
254
- columnValues?: string[];
255
- }
256
- interface IGetInput {
257
- records: IGetRecord[];
258
- }
259
- interface IGetOptions {
260
- tokens?: boolean;
261
- }
262
- interface ISkyflowIdRecord {
263
- ids: string[];
264
- redaction: RedactionType;
265
- table: string;
266
- }
267
- interface IGetByIdInput {
268
- records: ISkyflowIdRecord[];
269
- }
270
- interface Context {
271
- logLevel: LogLevel;
272
- env: Env;
273
- }
274
- interface IValidationRule {
275
- type: ValidationRuleType;
276
- params: any;
277
- }
278
- interface IUpsertOption {
279
- table: string;
280
- column: string;
281
- }
282
- interface IInsertOptions {
283
- tokens?: boolean;
284
- upsert?: IUpsertOption[];
285
- }
286
- interface IDeleteRecord {
287
- id: String;
288
- table: String;
289
- }
290
- interface IDeleteOptions {
291
- }
292
- interface IDeleteRecordInput {
293
- options?: IDeleteOptions;
294
- records: IDeleteRecord[];
210
+ declare enum RedactionType {
211
+ DEFAULT = "DEFAULT",
212
+ PLAIN_TEXT = "PLAIN_TEXT",
213
+ MASKED = "MASKED",
214
+ REDACTED = "REDACTED"
215
+ }
216
+ declare enum RequestMethod {
217
+ GET = "GET",
218
+ POST = "POST",
219
+ PUT = "PUT",
220
+ PATCH = "PATCH",
221
+ DELETE = "DELETE"
222
+ }
223
+ declare enum EventName {
224
+ CHANGE = "CHANGE",
225
+ READY = "READY",
226
+ FOCUS = "FOCUS",
227
+ BLUR = "BLUR",
228
+ SUBMIT = "SUBMIT"
229
+ }
230
+ declare enum LogLevel {
231
+ WARN = "WARN",
232
+ INFO = "INFO",
233
+ DEBUG = "DEBUG",
234
+ ERROR = "ERROR"
235
+ }
236
+ declare enum Env {
237
+ DEV = "DEV",
238
+ PROD = "PROD"
239
+ }
240
+ declare enum ValidationRuleType {
241
+ REGEX_MATCH_RULE = "REGEX_MATCH_RULE",
242
+ LENGTH_MATCH_RULE = "LENGTH_MATCH_RULE",
243
+ ELEMENT_VALUE_MATCH_RULE = "ELEMENT_VALUE_MATCH_RULE"
244
+ }
245
+ interface IInsertRecordInput {
246
+ records: IInsertRecord[];
247
+ }
248
+ interface IInsertRecord {
249
+ table: string;
250
+ fields: Record<string, any>;
251
+ skyflowID?: string;
252
+ }
253
+ interface IGetRecord {
254
+ ids?: string[];
255
+ redaction?: RedactionType;
256
+ table: string;
257
+ columnName?: string;
258
+ columnValues?: string[];
259
+ }
260
+ interface IGetInput {
261
+ records: IGetRecord[];
262
+ }
263
+ interface IGetOptions {
264
+ tokens?: boolean;
265
+ }
266
+ interface ISkyflowIdRecord {
267
+ ids: string[];
268
+ redaction: RedactionType;
269
+ table: string;
270
+ }
271
+ interface IGetByIdInput {
272
+ records: ISkyflowIdRecord[];
273
+ }
274
+ interface Context {
275
+ logLevel: LogLevel;
276
+ env: Env;
277
+ }
278
+ interface IValidationRule {
279
+ type: ValidationRuleType;
280
+ params: any;
281
+ }
282
+ interface IUpsertOption {
283
+ table: string;
284
+ column: string;
285
+ }
286
+ interface IInsertOptions {
287
+ tokens?: boolean;
288
+ upsert?: IUpsertOption[];
289
+ }
290
+ interface IDeleteRecord {
291
+ id: String;
292
+ table: String;
293
+ }
294
+ interface IDeleteOptions {
295
+ }
296
+ interface IDeleteRecordInput {
297
+ options?: IDeleteOptions;
298
+ records: IDeleteRecord[];
295
299
  }
296
300
 
297
- interface IUpsertOptions {
298
- table: string;
299
- column: string;
301
+ interface IUpsertOptions {
302
+ table: string;
303
+ column: string;
300
304
  }
301
305
 
302
- declare abstract class Container {
306
+ declare abstract class Container {
303
307
  }
304
308
 
305
- declare class EventEmitter {
306
- events: Record<string, {
307
- priority: boolean;
308
- callback: Function;
309
- }[]>;
310
- constructor();
311
- on(event: string, callback: Function, priority?: boolean): void;
312
- off(event: string, callback: Function): void;
313
- _emit(event: string, ...args: any[]): void;
314
- hasListener(event: string): boolean;
315
- resetEvents(): void;
316
- static createChild(ChildObject: any): void;
309
+ declare class EventEmitter {
310
+ events: Record<string, {
311
+ priority: boolean;
312
+ callback: Function;
313
+ }[]>;
314
+ constructor();
315
+ on(event: string, callback: Function, priority?: boolean): void;
316
+ off(event: string, callback: Function): void;
317
+ _emit(event: string, ...args: any[]): void;
318
+ hasListener(event: string): boolean;
319
+ resetEvents(): void;
320
+ static createChild(ChildObject: any): void;
317
321
  }
318
322
 
319
- declare abstract class SkyflowElement {
320
- abstract mount(domElementSelector: any): any;
321
- abstract unmount(): any;
322
- abstract setError(clientErrorText: string): any;
323
- abstract resetError(): any;
324
- abstract iframeName(): any;
325
- abstract getID(): any;
323
+ declare abstract class SkyflowElement {
324
+ abstract mount(domElementSelector: any): any;
325
+ abstract unmount(): any;
326
+ abstract setError(clientErrorText: string): any;
327
+ abstract resetError(): any;
328
+ abstract iframeName(): any;
329
+ abstract getID(): any;
326
330
  }
327
331
 
328
- declare class CollectElement extends SkyflowElement {
329
- #private;
330
- elementType: string;
331
- type: string;
332
- containerId: string;
333
- constructor(elementId: string, elementGroup: any, metaData: any, container: any, isSingleElementAPI: boolean | undefined, destroyCallback: Function, updateCallback: Function, context: Context, groupEventEmitter?: EventEmitter);
334
- getID: () => string;
335
- mount: (domElement: any) => void;
336
- unmount: () => void;
337
- update: (group: any) => void;
338
- updateElement: (elementOptions: any) => void;
339
- getState: () => {
340
- isEmpty: boolean;
341
- isComplete: boolean;
342
- isValid: boolean;
343
- isFocused: boolean;
344
- value: string | Object | Blob | undefined;
345
- required: boolean;
346
- };
347
- getOptions: () => any;
348
- on(eventName: string, handler: any): void;
349
- iframeName(): string;
350
- isMounted(): boolean;
351
- isValidElement(): boolean;
352
- setError(clientErrorText: string): void;
353
- resetError(): void;
354
- setValue(elementValue: string): void;
355
- clearValue(): void;
332
+ declare class CollectElement extends SkyflowElement {
333
+ #private;
334
+ elementType: string;
335
+ type: string;
336
+ containerId: string;
337
+ constructor(elementId: string, elementGroup: any, metaData: any, container: any, isSingleElementAPI: boolean | undefined, destroyCallback: Function, updateCallback: Function, context: Context, groupEventEmitter?: EventEmitter);
338
+ getID: () => string;
339
+ mount: (domElement: any) => void;
340
+ unmount: () => void;
341
+ update: (group: any) => void;
342
+ updateElement: (elementOptions: any) => void;
343
+ getState: () => {
344
+ isEmpty: boolean;
345
+ isComplete: boolean;
346
+ isValid: boolean;
347
+ isFocused: boolean;
348
+ value: string | Object | Blob | undefined;
349
+ required: boolean;
350
+ };
351
+ getOptions: () => any;
352
+ on(eventName: string, handler: any): void;
353
+ iframeName(): string;
354
+ isMounted(): boolean;
355
+ isValidElement(): boolean;
356
+ setError(clientErrorText: string): void;
357
+ resetError(): void;
358
+ setValue(elementValue: string): void;
359
+ clearValue(): void;
356
360
  }
357
361
 
358
- interface CollectElementInput$1 {
359
- table?: string;
360
- column?: string;
361
- inputStyles?: object;
362
- label?: string;
363
- labelStyles?: object;
364
- errorTextStyles?: object;
365
- placeholder?: string;
366
- type: ElementType$1;
367
- altText?: string;
368
- validations?: IValidationRule[];
369
- skyflowID?: string;
370
- }
371
- interface ICollectOptions$1 {
372
- tokens?: boolean;
373
- additionalFields?: IInsertRecordInput;
374
- upsert?: Array<IUpsertOptions>;
375
- }
376
- declare class CollectContainer extends Container {
377
- #private;
378
- type: string;
379
- constructor(options: any, metaData: any, skyflowElements: any, context: any);
380
- create: (input: CollectElementInput$1, options?: any) => CollectElement;
381
- collect: (options?: ICollectOptions$1) => Promise<unknown>;
362
+ interface CollectElementInput$1 {
363
+ table?: string;
364
+ column?: string;
365
+ inputStyles?: object;
366
+ label?: string;
367
+ labelStyles?: object;
368
+ errorTextStyles?: object;
369
+ placeholder?: string;
370
+ type: ElementType$1;
371
+ altText?: string;
372
+ validations?: IValidationRule[];
373
+ skyflowID?: string;
374
+ }
375
+ interface ICollectOptions$1 {
376
+ tokens?: boolean;
377
+ additionalFields?: IInsertRecordInput;
378
+ upsert?: Array<IUpsertOptions>;
379
+ }
380
+ declare class CollectContainer extends Container {
381
+ #private;
382
+ type: string;
383
+ constructor(options: any, metaData: any, skyflowElements: any, context: any);
384
+ create: (input: CollectElementInput$1, options?: any) => CollectElement;
385
+ collect: (options?: ICollectOptions$1) => Promise<unknown>;
382
386
  }
383
387
 
384
- declare class ComposableElement {
385
- #private;
386
- type: string;
387
- constructor(name: any, eventEmitter: any);
388
- on(eventName: string, handler: any): void;
389
- update: (options: any) => void;
388
+ declare class ComposableElement {
389
+ #private;
390
+ type: string;
391
+ constructor(name: any, eventEmitter: any);
392
+ on(eventName: string, handler: any): void;
393
+ update: (options: any) => void;
390
394
  }
391
395
 
392
- interface CollectElementInput {
393
- table?: string;
394
- column?: string;
395
- inputStyles?: object;
396
- label?: string;
397
- labelStyles?: object;
398
- errorTextStyles?: object;
399
- placeholder?: string;
400
- type: ElementType$1;
401
- altText?: string;
402
- validations?: IValidationRule[];
403
- skyflowID?: string;
404
- }
405
- interface ICollectOptions {
406
- tokens?: boolean;
407
- additionalFields?: IInsertRecordInput;
408
- upsert?: Array<IUpsertOptions>;
409
- }
410
- declare class ComposableContainer extends Container {
411
- #private;
412
- type: string;
413
- constructor(options: any, metaData: any, skyflowElements: any, context: any);
414
- create: (input: CollectElementInput, options?: any) => ComposableElement;
415
- on: (eventName: string, handler: any) => void;
416
- mount: (domElement: any) => void;
417
- unmount: () => void;
418
- collect: (options?: ICollectOptions) => Promise<unknown>;
396
+ interface CollectElementInput {
397
+ table?: string;
398
+ column?: string;
399
+ inputStyles?: object;
400
+ label?: string;
401
+ labelStyles?: object;
402
+ errorTextStyles?: object;
403
+ placeholder?: string;
404
+ type: ElementType$1;
405
+ altText?: string;
406
+ validations?: IValidationRule[];
407
+ skyflowID?: string;
408
+ }
409
+ interface ICollectOptions {
410
+ tokens?: boolean;
411
+ additionalFields?: IInsertRecordInput;
412
+ upsert?: Array<IUpsertOptions>;
413
+ }
414
+ declare class ComposableContainer extends Container {
415
+ #private;
416
+ type: string;
417
+ constructor(options: any, metaData: any, skyflowElements: any, context: any);
418
+ create: (input: CollectElementInput, options?: any) => ComposableElement;
419
+ on: (eventName: string, handler: any) => void;
420
+ mount: (domElement: any) => void;
421
+ unmount: () => void;
422
+ collect: (options?: ICollectOptions) => Promise<unknown>;
419
423
  }
420
424
 
421
- declare enum ContainerType {
422
- COLLECT = "COLLECT",
423
- COMPOSABLE = "COMPOSABLE"
424
- }
425
- interface ISkyflow {
426
- vaultID?: string;
427
- vaultURL?: string;
428
- getBearerToken: () => Promise<string>;
429
- options?: Record<string, any>;
430
- }
431
- declare class Skyflow {
432
- #private;
433
- constructor(config: ISkyflow);
434
- static init(config: ISkyflow): Skyflow;
435
- container(type: ContainerType, options?: Record<string, any>): CollectContainer | ComposableContainer;
436
- insert(records: IInsertRecordInput, options?: IInsertOptions): Promise<any>;
437
- getById(getByIdInput: IGetByIdInput): Promise<unknown>;
438
- get(getInput: IGetInput, options?: IGetOptions): Promise<unknown>;
439
- delete(records: IDeleteRecordInput, options?: IDeleteOptions): Promise<unknown>;
440
- static get ContainerType(): typeof ContainerType;
441
- static get ElementType(): typeof ElementType$1;
442
- static get RedactionType(): typeof RedactionType;
443
- static get RequestMethod(): typeof RequestMethod;
444
- static get LogLevel(): typeof LogLevel;
445
- static get EventName(): typeof EventName;
446
- static get Env(): typeof Env;
447
- static get ValidationRuleType(): typeof ValidationRuleType;
425
+ declare enum ContainerType {
426
+ COLLECT = "COLLECT",
427
+ COMPOSABLE = "COMPOSABLE"
428
+ }
429
+ interface ISkyflow {
430
+ vaultID?: string;
431
+ vaultURL?: string;
432
+ getBearerToken: () => Promise<string>;
433
+ options?: Record<string, any>;
434
+ }
435
+ declare class Skyflow {
436
+ #private;
437
+ constructor(config: ISkyflow);
438
+ static init(config: ISkyflow): Skyflow;
439
+ container(type: ContainerType, options?: Record<string, any>): CollectContainer | ComposableContainer;
440
+ insert(records: IInsertRecordInput, options?: IInsertOptions): Promise<any>;
441
+ getById(getByIdInput: IGetByIdInput): Promise<unknown>;
442
+ get(getInput: IGetInput, options?: IGetOptions): Promise<unknown>;
443
+ delete(records: IDeleteRecordInput, options?: IDeleteOptions): Promise<unknown>;
444
+ static get ContainerType(): typeof ContainerType;
445
+ static get ElementType(): typeof ElementType$1;
446
+ static get RedactionType(): typeof RedactionType;
447
+ static get RequestMethod(): typeof RequestMethod;
448
+ static get LogLevel(): typeof LogLevel;
449
+ static get EventName(): typeof EventName;
450
+ static get Env(): typeof Env;
451
+ static get ValidationRuleType(): typeof ValidationRuleType;
448
452
  }
449
453
 
450
- declare enum ElementType {
451
- CARD_NUMBER = "CARD_NUMBER",
452
- CARDHOLDER_NAME = "CARDHOLDER_NAME",
453
- CVV = "CVV",
454
- EXPIRATION_MONTH = "EXPIRATION_MONTH",
455
- EXPIRATION_YEAR = "EXPIRATION_YEAR"
454
+ declare enum ElementType {
455
+ CARD_NUMBER = "CARD_NUMBER",
456
+ CARDHOLDER_NAME = "CARDHOLDER_NAME",
457
+ CVV = "CVV",
458
+ EXPIRATION_MONTH = "EXPIRATION_MONTH",
459
+ EXPIRATION_YEAR = "EXPIRATION_YEAR"
456
460
  }
457
461
 
458
- interface Mountable {
459
- mount(selector: string | PayrailsElement): void;
460
- unmount(): void;
461
- }
462
- interface ElementOptions {
463
- id?: string;
464
- className?: string;
465
- styles?: Partial<CSSStyleDeclaration>;
466
- }
467
- declare class PayrailsElement implements Mountable {
468
- protected element: HTMLElement;
469
- protected subElements: Array<Mountable>;
470
- readonly id: string | undefined;
471
- constructor(elementType: string, { id, className }?: ElementOptions);
472
- get parentElement(): HTMLElement | null;
473
- get selector(): string;
474
- mount(location: string): void;
475
- unmount(): void;
462
+ interface Mountable {
463
+ mount(selector: string | PayrailsElement): void;
464
+ unmount(): void;
465
+ }
466
+ interface ElementOptions {
467
+ id?: string;
468
+ className?: string;
469
+ styles?: Partial<CSSStyleDeclaration>;
470
+ }
471
+ declare class PayrailsElement implements Mountable {
472
+ protected element: HTMLElement;
473
+ protected subElements: Array<Mountable>;
474
+ readonly id: string | undefined;
475
+ constructor(elementType: string, { id, className }?: ElementOptions);
476
+ get parentElement(): HTMLElement | null;
477
+ get selector(): string;
478
+ mount(location: string): void;
479
+ unmount(): void;
476
480
  }
477
481
 
478
- interface StoreInstrumentElementOptions extends ElementOptions {
479
- showStoreInstrumentCheckbox?: boolean;
480
- alwaysStoreInstrument?: boolean;
481
- translations?: {
482
- labels?: {
483
- storeInstrument?: string;
484
- saveInstrument?: string;
485
- };
486
- };
487
- styles?: {
488
- storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
489
- };
490
- events?: PayrailsSDKEvents;
491
- }
492
- declare class StoreInstrumentCheckbox extends PayrailsElement {
493
- private options;
494
- constructor(options: StoreInstrumentElementOptions);
495
- get isChecked(): boolean;
496
- private createHTML;
497
- private applyStyles;
498
- private addListeners;
499
- }
500
- declare abstract class PayrailsElementWithStoreInstrumentCheckbox extends PayrailsElement {
501
- protected options?: StoreInstrumentElementOptions | undefined;
502
- protected storeInstrumentCheckbox: StoreInstrumentCheckbox | null;
503
- protected constructor(elementType: string, options?: StoreInstrumentElementOptions | undefined);
504
- protected get shouldStoreInstrument(): boolean;
482
+ interface StoreInstrumentElementOptions extends ElementOptions {
483
+ showStoreInstrumentCheckbox?: boolean;
484
+ alwaysStoreInstrument?: boolean;
485
+ translations?: {
486
+ labels?: {
487
+ storeInstrument?: string;
488
+ saveInstrument?: string;
489
+ };
490
+ };
491
+ styles?: {
492
+ storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
493
+ };
494
+ events?: PayrailsSDKEvents;
495
+ }
496
+ declare class StoreInstrumentCheckbox extends PayrailsElement {
497
+ private options;
498
+ constructor(options: StoreInstrumentElementOptions);
499
+ get isChecked(): boolean;
500
+ private createHTML;
501
+ private applyStyles;
502
+ private addListeners;
503
+ }
504
+ declare abstract class PayrailsElementWithStoreInstrumentCheckbox extends PayrailsElement {
505
+ protected options?: StoreInstrumentElementOptions | undefined;
506
+ protected storeInstrumentCheckbox: StoreInstrumentCheckbox | null;
507
+ protected constructor(elementType: string, options?: StoreInstrumentElementOptions | undefined);
508
+ protected get shouldStoreInstrument(): boolean;
505
509
  }
506
510
 
507
- interface ApplePayButtonOptions extends StoreInstrumentElementOptions {
508
- clientDomain?: string;
509
- events?: PaymentEvents & {
510
- onApplePayAvailable?: () => void;
511
- };
512
- styles?: {
513
- type?: 'plain' | 'buy' | 'addMoney' | 'book' | 'checkout' | 'continue' | 'contribute' | 'donate' | 'inStore' | 'order' | 'reload' | 'rent' | 'setUp' | 'subscribe' | 'support' | 'tip' | 'topUp';
514
- style?: 'white' | 'whiteOutline' | 'black' | 'automatic';
515
- } & StoreInstrumentElementOptions['styles'];
516
- }
517
- declare global {
518
- interface Window {
519
- ApplePaySession?: ApplePaySession;
520
- }
521
- }
522
- declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
523
- private sdkConfig;
524
- private execution;
525
- protected options: ApplePayButtonOptions;
526
- private appleButton;
527
- private loadScript;
528
- private paymentExecutor;
529
- constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: ApplePayButtonOptions);
530
- mount(location: string): void;
531
- unmount(): void;
532
- private isApplePayAvailable;
533
- private mountApplePayButton;
534
- private createApplePaySession;
535
- private onApplePayAuthorized;
511
+ interface ApplePayButtonOptions extends StoreInstrumentElementOptions {
512
+ clientDomain?: string;
513
+ events?: PaymentEvents & {
514
+ onApplePayAvailable?: () => void;
515
+ };
516
+ styles?: {
517
+ type?: 'plain' | 'buy' | 'addMoney' | 'book' | 'checkout' | 'continue' | 'contribute' | 'donate' | 'inStore' | 'order' | 'reload' | 'rent' | 'setUp' | 'subscribe' | 'support' | 'tip' | 'topUp';
518
+ style?: 'white' | 'whiteOutline' | 'black' | 'automatic';
519
+ } & StoreInstrumentElementOptions['styles'];
520
+ }
521
+ declare global {
522
+ interface Window {
523
+ ApplePaySession?: ApplePaySession;
524
+ }
525
+ }
526
+ declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
527
+ private sdkConfig;
528
+ private execution;
529
+ protected options: ApplePayButtonOptions;
530
+ private appleButton;
531
+ private loadScript;
532
+ private paymentExecutor;
533
+ constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: ApplePayButtonOptions);
534
+ mount(location: string): void;
535
+ unmount(): void;
536
+ private isApplePayAvailable;
537
+ private mountApplePayButton;
538
+ private createApplePaySession;
539
+ private onApplePayAuthorized;
536
540
  }
537
541
 
538
- declare const regexes: {
539
- visa: RegExp;
540
- mastercard: RegExp;
541
- amex: RegExp;
542
- diners: RegExp;
543
- discover: RegExp;
544
- jcb: RegExp;
545
- hipercard: RegExp;
546
- unionpay: RegExp;
547
- maestro: RegExp;
548
- };
542
+ declare const regexes: {
543
+ visa: RegExp;
544
+ mastercard: RegExp;
545
+ amex: RegExp;
546
+ diners: RegExp;
547
+ discover: RegExp;
548
+ jcb: RegExp;
549
+ hipercard: RegExp;
550
+ unionpay: RegExp;
551
+ maestro: RegExp;
552
+ };
549
553
  type CardNetwork = keyof typeof regexes;
550
554
 
551
- interface OnChange {
552
- isValid: boolean;
553
- cardNetwork: CardNetwork | '';
554
- bin?: string;
555
- }
556
- interface CardFormOptions extends StoreInstrumentElementOptions {
557
- showCardHolderName?: boolean;
558
- enrollInstrumentToNetworkOffers?: boolean;
559
- translations?: {
560
- placeholders?: {
561
- [key in ElementType]?: string;
562
- };
563
- labels?: {
564
- [key in ElementType | 'saveCreditCard']?: string;
565
- } & {
566
- saveInstrument?: string;
567
- storeInstrument?: string;
568
- };
569
- };
570
- events?: {
571
- onFocus?: () => void;
572
- onChange?: (e: OnChange) => void;
573
- onSaveInstrumentCheckboxChanged?: PayrailsSDKEvents['onSaveInstrumentCheckboxChanged'];
574
- onReady?: () => void;
575
- };
576
- styles?: {
577
- wrapper?: Partial<CSSStyleDeclaration>;
578
- base?: Partial<CSSStyleDeclaration>;
579
- storeCardCheckbox?: Partial<CSSStyleDeclaration>;
580
- storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
581
- errorTextStyles?: {
582
- base: Partial<CSSStyleDeclaration>;
583
- };
584
- inputFields?: {
585
- [key in ElementType | 'all']?: CardFieldStyles;
586
- };
587
- labels?: {
588
- [key in ElementType | 'all']?: Partial<CSSStyleDeclaration>;
589
- };
590
- };
591
- }
592
- declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
593
- private readonly collectContainer;
594
- protected readonly options?: CardFormOptions | undefined;
595
- get bin(): string;
596
- private readonly formFields;
597
- constructor(collectContainer: PayrailsCollectContainer, options?: CardFormOptions | undefined);
598
- tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
599
- show(): void;
600
- hide(): void;
601
- private triggerOnReady;
602
- private prepareLabelStyles;
603
- private prepareInputStyles;
604
- get isValid(): boolean;
605
- get cardNetwork(): "" | "visa" | "mastercard" | "amex" | "diners" | "discover" | "jcb" | "hipercard" | "unionpay" | "maestro";
606
- onChange(): void;
607
- collectValues(): Promise<{
608
- cardData: TokenizedCollectResult | EncryptedCollectResult;
609
- storeInstrument: boolean;
610
- enrollInstrumentToNetworkOffers: boolean;
611
- }>;
612
- private enforceEnrollInstrumentToNetworkOffersForMasterCard;
613
- }
614
- interface LabelStyles {
615
- base?: Partial<CSSStyleDeclaration>;
616
- }
617
- interface CardFieldStyles extends LabelStyles {
618
- complete?: Partial<CSSStyleDeclaration>;
619
- empty?: Partial<CSSStyleDeclaration>;
620
- focus?: Partial<CSSStyleDeclaration>;
621
- invalid?: Partial<CSSStyleDeclaration>;
622
- cardIcon?: Partial<CSSStyleDeclaration>;
623
- copyIcon?: Partial<CSSStyleDeclaration>;
555
+ interface OnChange {
556
+ isValid: boolean;
557
+ cardNetwork: CardNetwork | '';
558
+ bin?: string;
559
+ }
560
+ interface CardFormOptions extends StoreInstrumentElementOptions {
561
+ showCardHolderName?: boolean;
562
+ enrollInstrumentToNetworkOffers?: boolean;
563
+ translations?: {
564
+ placeholders?: {
565
+ [key in ElementType]?: string;
566
+ };
567
+ labels?: {
568
+ [key in ElementType | 'saveCreditCard']?: string;
569
+ } & {
570
+ saveInstrument?: string;
571
+ storeInstrument?: string;
572
+ };
573
+ };
574
+ events?: {
575
+ onFocus?: () => void;
576
+ onChange?: (e: OnChange) => void;
577
+ onSaveInstrumentCheckboxChanged?: PayrailsSDKEvents['onSaveInstrumentCheckboxChanged'];
578
+ onReady?: () => void;
579
+ };
580
+ styles?: {
581
+ wrapper?: Partial<CSSStyleDeclaration>;
582
+ base?: Partial<CSSStyleDeclaration>;
583
+ storeCardCheckbox?: Partial<CSSStyleDeclaration>;
584
+ storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
585
+ errorTextStyles?: {
586
+ base: Partial<CSSStyleDeclaration>;
587
+ };
588
+ inputFields?: {
589
+ [key in ElementType | 'all']?: CardFieldStyles;
590
+ };
591
+ labels?: {
592
+ [key in ElementType | 'all']?: Partial<CSSStyleDeclaration>;
593
+ };
594
+ };
595
+ }
596
+ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
597
+ private readonly collectContainer;
598
+ protected readonly options?: CardFormOptions | undefined;
599
+ get bin(): string;
600
+ private readonly formFields;
601
+ constructor(collectContainer: PayrailsCollectContainer, options?: CardFormOptions | undefined);
602
+ tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
603
+ show(): void;
604
+ hide(): void;
605
+ private triggerOnReady;
606
+ private prepareLabelStyles;
607
+ private prepareInputStyles;
608
+ get isValid(): boolean;
609
+ get cardNetwork(): "" | "visa" | "mastercard" | "amex" | "diners" | "discover" | "jcb" | "hipercard" | "unionpay" | "maestro";
610
+ onChange(): void;
611
+ collectValues(): Promise<{
612
+ cardData: TokenizedCollectResult | EncryptedCollectResult;
613
+ storeInstrument: boolean;
614
+ enrollInstrumentToNetworkOffers: boolean;
615
+ }>;
616
+ private enforceEnrollInstrumentToNetworkOffersForMasterCard;
617
+ }
618
+ interface LabelStyles {
619
+ base?: Partial<CSSStyleDeclaration>;
620
+ }
621
+ interface CardFieldStyles extends LabelStyles {
622
+ complete?: Partial<CSSStyleDeclaration>;
623
+ empty?: Partial<CSSStyleDeclaration>;
624
+ focus?: Partial<CSSStyleDeclaration>;
625
+ invalid?: Partial<CSSStyleDeclaration>;
626
+ cardIcon?: Partial<CSSStyleDeclaration>;
627
+ copyIcon?: Partial<CSSStyleDeclaration>;
624
628
  }
625
629
 
626
- interface CardListOptions {
627
- onCardChange: (selectedCard: StoredPaymentInstrument<CardMetadata>) => void;
628
- }
629
- declare class CardList extends PayrailsElement {
630
- private readonly workflowExecution;
631
- private listItems;
632
- constructor(workflowExecution: WorkflowExecution, options?: CardListOptions);
633
- reset(): void;
630
+ interface CardListOptions {
631
+ onCardChange: (selectedCard: StoredPaymentInstrument<CardMetadata>) => void;
632
+ }
633
+ declare class CardList extends PayrailsElement {
634
+ private readonly workflowExecution;
635
+ private listItems;
636
+ constructor(workflowExecution: WorkflowExecution, options?: CardListOptions);
637
+ reset(): void;
634
638
  }
635
639
 
636
- interface RedirectReturnLinks {
637
- success?: string;
638
- cancel?: string;
639
- error?: string;
640
+ interface RedirectReturnLinks {
641
+ success?: string;
642
+ cancel?: string;
643
+ error?: string;
640
644
  }
641
645
 
642
- interface CardPaymentButtonOptions {
643
- events?: PayrailsSDKEvents & {
644
- onStateChanged?: (state: 'enabled' | 'disabled') => void;
645
- };
646
- translations?: {
647
- label: string;
648
- };
649
- styles?: {
650
- base?: Partial<CSSStyleDeclaration>;
651
- disabled?: Partial<CSSStyleDeclaration>;
652
- loading?: Partial<CSSStyleDeclaration>;
653
- hover?: Partial<CSSStyleDeclaration>;
654
- };
655
- }
656
- declare class CardPaymentButton extends PayrailsElement {
657
- private readonly sdkConfig;
658
- private readonly execution;
659
- private readonly options;
660
- private readonly returnLinks;
661
- selectedInstrument: StoredPaymentInstrument | null;
662
- get bin(): string | undefined;
663
- private paymentExecutor;
664
- private cardForm;
665
- constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: CardPaymentButtonOptions, returnLinks: RedirectReturnLinks);
666
- setDisabled(isDisabled: boolean): void;
667
- setSavedCreditCard(savedCard: StoredPaymentInstrument<CardMetadata>): void;
668
- setSavedInstrument(savedInstrument: StoredPaymentInstrument): void;
669
- private setStyles;
670
- private removeStyles;
671
- setLabel(label: string): void;
672
- setCardForm(cardForm: CardForm): void;
673
- triggerLoading(isLoading: boolean): void;
674
- private onAuthorizationFailed;
675
- private onPay;
676
- private constructTokenizedPayment;
677
- private constructEncryptedPayment;
678
- private handleAuthorizationResult;
679
- private handle3ds;
680
- }
681
- declare enum AuthorizationFailureReasons {
682
- VALIDATION_FAILED = "VALIDATION_FAILED",
683
- AUTHORIZATION_ERROR = "AUTHORIZATION_ERROR",
684
- AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
685
- UNKNOWN_ERROR = "UNKNOWN_ERROR"
646
+ interface CardPaymentButtonOptions {
647
+ events?: PayrailsSDKEvents & {
648
+ onStateChanged?: (state: 'enabled' | 'disabled') => void;
649
+ };
650
+ translations?: {
651
+ label: string;
652
+ };
653
+ styles?: {
654
+ base?: Partial<CSSStyleDeclaration>;
655
+ disabled?: Partial<CSSStyleDeclaration>;
656
+ loading?: Partial<CSSStyleDeclaration>;
657
+ hover?: Partial<CSSStyleDeclaration>;
658
+ };
659
+ }
660
+ declare class CardPaymentButton extends PayrailsElement {
661
+ private readonly sdkConfig;
662
+ private readonly execution;
663
+ private readonly options;
664
+ private readonly returnLinks;
665
+ selectedInstrument: StoredPaymentInstrument | null;
666
+ get bin(): string | undefined;
667
+ private paymentExecutor;
668
+ private cardForm;
669
+ constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: CardPaymentButtonOptions, returnLinks: RedirectReturnLinks);
670
+ setDisabled(isDisabled: boolean): void;
671
+ setSavedCreditCard(savedCard: StoredPaymentInstrument<CardMetadata>): void;
672
+ setSavedInstrument(savedInstrument: StoredPaymentInstrument): void;
673
+ private setStyles;
674
+ private removeStyles;
675
+ setLabel(label: string): void;
676
+ setCardForm(cardForm: CardForm): void;
677
+ triggerLoading(isLoading: boolean): void;
678
+ private onAuthorizationFailed;
679
+ private onPay;
680
+ private constructTokenizedPayment;
681
+ private constructEncryptedPayment;
682
+ private handleAuthorizationResult;
683
+ private handle3ds;
684
+ }
685
+ declare enum AuthorizationFailureReasons {
686
+ VALIDATION_FAILED = "VALIDATION_FAILED",
687
+ AUTHORIZATION_ERROR = "AUTHORIZATION_ERROR",
688
+ AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
689
+ UNKNOWN_ERROR = "UNKNOWN_ERROR"
686
690
  }
687
691
 
688
- interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
689
- environment?: 'TEST' | 'PRODUCTION';
690
- merchantInfo?: {
691
- merchantId: string;
692
- merchantName?: string;
693
- };
694
- events?: PaymentEvents & UIEvents & {
695
- onGooglePayAvailable?: () => void;
696
- };
697
- styles?: {
698
- buttonColor?: google.payments.api.ButtonColor;
699
- buttonType?: google.payments.api.ButtonType;
700
- buttonSizeMode?: google.payments.api.ButtonSizeMode;
701
- buttonLocale?: string;
702
- storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
703
- };
704
- }
705
- declare class GooglePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
706
- private sdkConfig;
707
- private execution;
708
- protected options: GooglePayButtonOptions;
709
- private googleButton;
710
- private paymentExecutor;
711
- private loadScript;
712
- constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: GooglePayButtonOptions);
713
- private sdkLoaded;
714
- private onLoadPaymentData;
715
- private onPaymentButtonClicked;
716
- mount(location: string): void;
717
- unmount(): void;
692
+ interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
693
+ environment?: 'TEST' | 'PRODUCTION';
694
+ merchantInfo?: {
695
+ merchantId: string;
696
+ merchantName?: string;
697
+ };
698
+ events?: PaymentEvents & UIEvents & {
699
+ onGooglePayAvailable?: () => void;
700
+ };
701
+ styles?: {
702
+ buttonColor?: google.payments.api.ButtonColor;
703
+ buttonType?: google.payments.api.ButtonType;
704
+ buttonSizeMode?: google.payments.api.ButtonSizeMode;
705
+ buttonLocale?: string;
706
+ storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
707
+ };
708
+ }
709
+ declare class GooglePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
710
+ private sdkConfig;
711
+ private execution;
712
+ protected options: GooglePayButtonOptions;
713
+ private googleButton;
714
+ private paymentExecutor;
715
+ private loadScript;
716
+ constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: GooglePayButtonOptions);
717
+ private sdkLoaded;
718
+ private onLoadPaymentData;
719
+ private onPaymentButtonClicked;
720
+ mount(location: string): void;
721
+ unmount(): void;
718
722
  }
719
723
 
720
- interface DropinElementStyles {
721
- base?: Partial<CSSStyleDeclaration>;
722
- active?: Partial<CSSStyleDeclaration>;
724
+ interface DropinElementStyles {
725
+ base?: Partial<CSSStyleDeclaration>;
726
+ active?: Partial<CSSStyleDeclaration>;
723
727
  }
724
728
 
725
- interface GooglePayDropinOptions extends GooglePayButtonOptions {
726
- translations?: {
727
- labels?: {
728
- label?: string;
729
- storeInstrument?: string;
730
- };
731
- };
732
- styles?: GooglePayButtonOptions['styles'] & DropinElementStyles;
729
+ interface GooglePayDropinOptions extends GooglePayButtonOptions {
730
+ translations?: {
731
+ labels?: {
732
+ label?: string;
733
+ storeInstrument?: string;
734
+ };
735
+ };
736
+ styles?: GooglePayButtonOptions['styles'] & DropinElementStyles;
733
737
  }
734
738
 
735
- interface PaypalButtonOptions extends StoreInstrumentElementOptions {
736
- fraudNetGuid?: string;
737
- events?: PaymentEvents & UIEvents & {
738
- onPaypalAvailable?: () => void;
739
- };
740
- styles?: {
741
- color?: 'gold' | 'blue' | 'silver' | 'white' | 'black';
742
- height?: number;
743
- label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment' | 'subscribe' | 'donate';
744
- shape?: 'rect' | 'pill';
745
- tagline?: boolean;
746
- storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
747
- };
748
- }
749
- declare class PaypalButton extends PayrailsElementWithStoreInstrumentCheckbox {
750
- private sdkConfig;
751
- private execution;
752
- protected options?: PaypalButtonOptions | undefined;
753
- constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options?: PaypalButtonOptions | undefined);
754
- fraudNetGuid: string | undefined;
755
- private paymentExecutor;
756
- private button;
757
- private paypalLoader;
758
- private confirmLink;
759
- private buttonWrapperId;
760
- private checkboxWrapperId;
761
- private loadPaypal;
762
- private createPaypalButton;
763
- private createPayPalButtonConfig;
764
- private createBillingAgreementConfig;
765
- private createOneTimeOrderConfig;
766
- private createBaseConfig;
767
- private createOneTimeOrder;
768
- private approvePayment;
769
- mount(location: string): void;
770
- unmount(): void;
739
+ interface PaypalButtonOptions extends StoreInstrumentElementOptions {
740
+ fraudNetGuid?: string;
741
+ events?: PaymentEvents & UIEvents & {
742
+ onPaypalAvailable?: () => void;
743
+ };
744
+ styles?: {
745
+ color?: 'gold' | 'blue' | 'silver' | 'white' | 'black';
746
+ height?: number;
747
+ label?: 'paypal' | 'checkout' | 'buynow' | 'pay' | 'installment' | 'subscribe' | 'donate';
748
+ shape?: 'rect' | 'pill';
749
+ tagline?: boolean;
750
+ storeInstrumentCheckbox?: Partial<CSSStyleDeclaration>;
751
+ };
752
+ }
753
+ declare class PaypalButton extends PayrailsElementWithStoreInstrumentCheckbox {
754
+ private sdkConfig;
755
+ private execution;
756
+ protected options?: PaypalButtonOptions | undefined;
757
+ constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options?: PaypalButtonOptions | undefined);
758
+ fraudNetGuid: string | undefined;
759
+ private paymentExecutor;
760
+ private button;
761
+ private paypalLoader;
762
+ private confirmLink;
763
+ private buttonWrapperId;
764
+ private checkboxWrapperId;
765
+ private loadPaypal;
766
+ private createPaypalButton;
767
+ private createPayPalButtonConfig;
768
+ private createBillingAgreementConfig;
769
+ private createOneTimeOrderConfig;
770
+ private createBaseConfig;
771
+ private createOneTimeOrder;
772
+ private approvePayment;
773
+ mount(location: string): void;
774
+ unmount(): void;
771
775
  }
772
776
 
773
- interface PaypalDropinOptions extends PaypalButtonOptions {
774
- translations?: {
775
- labels?: {
776
- saveInstrument?: string;
777
- label?: string;
778
- };
779
- };
780
- styles?: PaypalButtonOptions['styles'] & DropinElementStyles;
777
+ interface PaypalDropinOptions extends PaypalButtonOptions {
778
+ translations?: {
779
+ labels?: {
780
+ saveInstrument?: string;
781
+ label?: string;
782
+ };
783
+ };
784
+ styles?: PaypalButtonOptions['styles'] & DropinElementStyles;
781
785
  }
782
786
 
783
- declare class Dropin extends PayrailsElement {
784
- private collectContainer;
785
- private readonly clientConfig;
786
- private readonly dropinConfig;
787
- private readonly execution;
788
- private readonly sdkConfig;
789
- private readonly returnLinks;
790
- private cardPaymentButton;
791
- private creditCard;
792
- private googlePay;
793
- private applePay;
794
- private cardForm;
795
- private paypal;
796
- constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions, execution: WorkflowExecution, sdkConfig: SdkConfiguration, returnLinks: RedirectReturnLinks);
797
- private createStoredInstrumentElement;
798
- private createCreditCardButton;
799
- private createGooglePayButton;
800
- private createPayPalButton;
801
- private createCardForm;
802
- private createApplePayButton;
803
- private createCardPaymentButton;
804
- private onAuthorizeSuccess;
805
- private onAuthorizeFailed;
806
- private isStoredInstrumentEnabled;
807
- }
808
- interface StorablePaymentMethodConfiguration extends StoreInstrumentElementOptions {
809
- showStoredInstruments?: boolean;
810
- }
811
- interface DropinOptions {
812
- paymentMethodsConfiguration?: {
813
- cards?: {
814
- showCardHolderName?: boolean;
815
- showExistingCards?: boolean;
816
- } & StorablePaymentMethodConfiguration;
817
- payPal?: StorablePaymentMethodConfiguration;
818
- googlePay?: StorablePaymentMethodConfiguration & {
819
- merchantInfo?: GooglePayButtonOptions['merchantInfo'];
820
- };
821
- applePay?: {
822
- clientDomain?: string;
823
- } & StorablePaymentMethodConfiguration;
824
- };
825
- returnInfo?: {
826
- success: string;
827
- error: string;
828
- };
829
- events?: PayrailsSDKEvents;
830
- translations?: {
831
- googlePayButton?: GooglePayDropinOptions['translations'];
832
- cardPaymentButton?: CardPaymentButtonOptions['translations'];
833
- cardForm?: CardFormOptions['translations'];
834
- paymentResult?: {
835
- success?: string;
836
- fail?: string;
837
- };
838
- paypalButton?: PaypalDropinOptions['translations'];
839
- };
840
- styles?: {
841
- element?: DropinElementStyles;
842
- googlePayButton?: GooglePayButtonOptions['styles'];
843
- paypalButton?: PaypalDropinOptions['styles'];
844
- applePayButton?: ApplePayButtonOptions['styles'];
845
- cardForm?: CardFormOptions['styles'];
846
- };
787
+ declare class Dropin extends PayrailsElement {
788
+ private collectContainer;
789
+ private readonly clientConfig;
790
+ private readonly dropinConfig;
791
+ private readonly execution;
792
+ private readonly sdkConfig;
793
+ private readonly returnLinks;
794
+ private cardPaymentButton;
795
+ private creditCard;
796
+ private googlePay;
797
+ private applePay;
798
+ private cardForm;
799
+ private paypal;
800
+ constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions, execution: WorkflowExecution, sdkConfig: SdkConfiguration, returnLinks: RedirectReturnLinks);
801
+ private createStoredInstrumentElement;
802
+ private createCreditCardButton;
803
+ private createGooglePayButton;
804
+ private createPayPalButton;
805
+ private createCardForm;
806
+ private createApplePayButton;
807
+ private createCardPaymentButton;
808
+ private onAuthorizeSuccess;
809
+ private onAuthorizeFailed;
810
+ private isStoredInstrumentEnabled;
811
+ }
812
+ interface StorablePaymentMethodConfiguration extends StoreInstrumentElementOptions {
813
+ showStoredInstruments?: boolean;
814
+ }
815
+ interface DropinOptions {
816
+ paymentMethodsConfiguration?: {
817
+ cards?: {
818
+ showCardHolderName?: boolean;
819
+ showExistingCards?: boolean;
820
+ } & StorablePaymentMethodConfiguration;
821
+ payPal?: StorablePaymentMethodConfiguration;
822
+ googlePay?: StorablePaymentMethodConfiguration & {
823
+ merchantInfo?: GooglePayButtonOptions['merchantInfo'];
824
+ };
825
+ applePay?: {
826
+ clientDomain?: string;
827
+ } & StorablePaymentMethodConfiguration;
828
+ };
829
+ returnInfo?: {
830
+ success: string;
831
+ error: string;
832
+ };
833
+ events?: PayrailsSDKEvents;
834
+ translations?: {
835
+ googlePayButton?: GooglePayDropinOptions['translations'];
836
+ cardPaymentButton?: CardPaymentButtonOptions['translations'];
837
+ cardForm?: CardFormOptions['translations'];
838
+ paymentResult?: {
839
+ success?: string;
840
+ fail?: string;
841
+ };
842
+ paypalButton?: PaypalDropinOptions['translations'];
843
+ };
844
+ styles?: {
845
+ element?: DropinElementStyles;
846
+ googlePayButton?: GooglePayButtonOptions['styles'];
847
+ paypalButton?: PaypalDropinOptions['styles'];
848
+ applePayButton?: ApplePayButtonOptions['styles'];
849
+ cardForm?: CardFormOptions['styles'];
850
+ };
847
851
  }
848
852
 
849
- type FraudNetPageId = 'home-page' | 'search-result-page' | 'category-page' | 'product-detail-page' | 'cart-page' | 'inline-cart-page' | 'checkout-page';
850
- declare class FraudNet implements Mountable {
851
- private pageId;
852
- private sdkConfig;
853
- private environment;
854
- constructor(pageId: FraudNetPageId, sdkConfig: SdkConfiguration, environment: PayrailsClientOptions['environment']);
855
- readonly guid: any;
856
- mount(): void;
857
- unmount(): void;
858
- private loadFraudnet;
859
- private readonly fnclsVal;
860
- private readonly execution;
861
- private readonly configId;
862
- private readonly scriptId;
863
- private get payPalConfig();
864
- private createFraudnetConfig;
853
+ type FraudNetPageId = 'home-page' | 'search-result-page' | 'category-page' | 'product-detail-page' | 'cart-page' | 'inline-cart-page' | 'checkout-page';
854
+ declare class FraudNet implements Mountable {
855
+ private pageId;
856
+ private sdkConfig;
857
+ private environment;
858
+ constructor(pageId: FraudNetPageId, sdkConfig: SdkConfiguration, environment: PayrailsClientOptions['environment']);
859
+ readonly guid: any;
860
+ mount(): void;
861
+ unmount(): void;
862
+ private loadFraudnet;
863
+ private readonly fnclsVal;
864
+ private readonly execution;
865
+ private readonly configId;
866
+ private readonly scriptId;
867
+ private get payPalConfig();
868
+ private createFraudnetConfig;
865
869
  }
866
870
 
867
- interface PayrailsClientOptions {
868
- environment?: 'TEST' | 'PRODUCTION';
869
- events?: {
870
- onClientInitialized: (execution: WorkflowExecution) => void;
871
- };
872
- returnLinks?: RedirectReturnLinks;
873
- }
874
- declare class Payrails {
875
- private sdkConfiguration;
876
- private vaultClient;
877
- private execution;
878
- private options?;
879
- private __container;
880
- private __cardForm;
881
- private __cardList;
882
- private __cardPaymentButton;
883
- private __fraudNet;
884
- private __paypalButton;
885
- static preloadCardForm: () => void;
886
- static init(initResponse: InitOptions, options?: PayrailsClientOptions): Payrails;
887
- update(amount: PayrailsAmount): void;
888
- collectContainer(containerOptions: CollectContainerOptions): PayrailsCollectContainer;
889
- googlePayButton(options: GooglePayButtonOptions): GooglePayButton;
890
- applePayButton(options: ApplePayButtonOptions): ApplePayButton;
891
- cardList(options?: CardListOptions): CardList;
892
- cardForm(options?: CardFormOptions): CardForm;
893
- dropin(options: DropinOptions): Dropin;
894
- getSavedCreditCards(): StoredPaymentInstrument<CardMetadata>[];
895
- paymentButton(options: CardPaymentButtonOptions): CardPaymentButton;
896
- paypalButton(options?: PaypalButtonOptions): PaypalButton;
897
- getSavedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
898
- fraudNet(pageId: FraudNetPageId): FraudNet;
899
- private constructor();
900
- private getContainerLayout;
901
- }
902
- interface InitOptions {
903
- version: string;
904
- data: string;
905
- }
906
- interface PaymentEvents {
907
- onAuthorizeSuccess?: (e?: any) => void;
908
- onAuthorizeFailed?: (e?: any) => void;
909
- onPaymentButtonClicked?: (e?: {
910
- bin?: string;
911
- }) => Promise<boolean>;
912
- onPaymentSessionExpired?: () => void;
913
- onThreeDSecureChallenge?: () => void;
914
- }
915
- interface UIEvents {
916
- onSaveInstrumentCheckboxChanged?: ({ checked }: {
917
- checked: boolean;
918
- }) => void;
919
- }
920
- type PayrailsSDKEvents = PaymentEvents & UIEvents;
921
- interface SdkConfiguration {
922
- token: string;
923
- amount: PayrailsAmount;
924
- holderReference: string;
925
- vaultConfiguration: {
926
- cardTableName: string;
927
- token: string;
928
- vaultId: string;
929
- vaultUrl: string;
930
- providerId: string;
931
- providerConfigId: string;
932
- vaultType: 'Skyflow' | 'Payrails' | 'Test';
933
- links: {
934
- saveInstrument: {
935
- href: string;
936
- };
937
- };
938
- };
939
- execution: WorkflowExecutionResponse;
940
- }
941
- interface PayrailsAmount {
942
- value: string;
943
- currency: string;
871
+ interface PayrailsClientOptions {
872
+ environment?: 'TEST' | 'PRODUCTION';
873
+ events?: {
874
+ onClientInitialized: (execution: WorkflowExecution) => void;
875
+ };
876
+ returnLinks?: RedirectReturnLinks;
877
+ telemetry?: {
878
+ enabled?: boolean;
879
+ logLevel?: 'debug' | 'error';
880
+ };
881
+ }
882
+ declare class Payrails {
883
+ private sdkConfiguration;
884
+ private vaultClient;
885
+ private execution;
886
+ private options?;
887
+ private __container;
888
+ private __cardForm;
889
+ private __cardList;
890
+ private __cardPaymentButton;
891
+ private __fraudNet;
892
+ private __paypalButton;
893
+ static preloadCardForm: () => void;
894
+ static init(initResponse: InitOptions, options?: PayrailsClientOptions): Payrails;
895
+ update(amount: PayrailsAmount): void;
896
+ collectContainer(containerOptions: CollectContainerOptions): PayrailsCollectContainer;
897
+ googlePayButton(options: GooglePayButtonOptions): GooglePayButton;
898
+ applePayButton(options: ApplePayButtonOptions): ApplePayButton;
899
+ cardList(options?: CardListOptions): CardList;
900
+ cardForm(options?: CardFormOptions): CardForm;
901
+ dropin(options: DropinOptions): Dropin;
902
+ getSavedCreditCards(): StoredPaymentInstrument<CardMetadata>[];
903
+ paymentButton(options: CardPaymentButtonOptions): CardPaymentButton;
904
+ paypalButton(options?: PaypalButtonOptions): PaypalButton;
905
+ getSavedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
906
+ fraudNet(pageId: FraudNetPageId): FraudNet;
907
+ private constructor();
908
+ private getContainerLayout;
909
+ }
910
+ interface InitOptions {
911
+ version: string;
912
+ data: string;
913
+ }
914
+ interface PaymentEvents {
915
+ onAuthorizeSuccess?: (e?: any) => void;
916
+ onAuthorizeFailed?: (e?: any) => void;
917
+ onPaymentButtonClicked?: (e?: {
918
+ bin?: string;
919
+ }) => Promise<boolean>;
920
+ onPaymentSessionExpired?: () => void;
921
+ onThreeDSecureChallenge?: () => void;
922
+ }
923
+ interface UIEvents {
924
+ onSaveInstrumentCheckboxChanged?: ({ checked }: {
925
+ checked: boolean;
926
+ }) => void;
927
+ }
928
+ type PayrailsSDKEvents = PaymentEvents & UIEvents;
929
+ interface SdkConfiguration {
930
+ token: string;
931
+ amount: PayrailsAmount;
932
+ holderReference: string;
933
+ vaultConfiguration: {
934
+ cardTableName: string;
935
+ token: string;
936
+ vaultId: string;
937
+ vaultUrl: string;
938
+ providerId: string;
939
+ providerConfigId: string;
940
+ vaultType: 'Skyflow' | 'Payrails' | 'Test';
941
+ links: {
942
+ saveInstrument: {
943
+ href: string;
944
+ };
945
+ };
946
+ };
947
+ execution: WorkflowExecutionResponse;
948
+ }
949
+ interface PayrailsAmount {
950
+ value: string;
951
+ currency: string;
944
952
  }
945
953
 
946
- type TokenizedCollectResult = {
947
- skyflow_id?: string;
948
- card_number?: string;
949
- cardholder_name?: string;
950
- expiry_month?: string;
951
- expiry_year?: string;
952
- security_code: string;
953
- instrumentId?: string;
954
- };
955
- interface EncryptedCollectResult {
956
- vaultProviderConfigId: string;
957
- encryptedData: string;
958
- }
959
- interface CollectElementOptions {
960
- type: ElementType;
961
- label?: string;
962
- placeholder?: string;
963
- altText?: string;
964
- format?: string;
965
- inputStyles?: object;
966
- labelStyles?: object;
967
- errorTextStyles?: object;
968
- required?: boolean;
969
- enableCardIcon?: boolean;
970
- }
971
- type PayrailsContainerType = 'COLLECT' | 'COMPOSABLE';
972
- interface CollectContainerOptions {
973
- layout?: number[];
974
- cardTableName?: string;
975
- containerType?: PayrailsContainerType;
976
- styles?: {
977
- base?: Partial<CSSStyleDeclaration>;
978
- };
979
- errorTextStyles?: {
980
- base?: Partial<CSSStyleDeclaration>;
981
- };
982
- }
983
- interface PayrailsSecureField {
984
- on(eventName: string, handler: any): void;
985
- mount?: (domElement: any) => void;
986
- unmount?: () => void;
987
- getState?: () => {
988
- isEmpty: boolean;
989
- isComplete: boolean;
990
- isValid: boolean;
991
- isFocused: boolean;
992
- value: unknown;
993
- required: boolean;
994
- };
995
- isValidElement?: () => boolean;
996
- setError?: (clientErrorText: string) => void;
997
- resetError?: () => void;
998
- setValue?: (elementValue: string) => void;
999
- clearValue?: () => void;
1000
- }
1001
- declare class PayrailsCollectContainer implements Mountable {
1002
- private sdkConfig;
1003
- bin: string;
1004
- readonly id = "payrails-container-wrapper";
1005
- private readonly __container;
1006
- private element;
1007
- private readonly cardTableName;
1008
- private readonly containerType;
1009
- constructor(__client: Skyflow, options: CollectContainerOptions, sdkConfig: SdkConfiguration);
1010
- createCollectElement(options: CollectElementOptions): PayrailsSecureField;
1011
- mount(selector: string): void;
1012
- unmount(): void;
1013
- collect(): Promise<TokenizedCollectResult | EncryptedCollectResult>;
1014
- private collectSkyflowData;
1015
- private collectPayrailsData;
1016
- tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
1017
- private constructSaveInstrumentBody;
1018
- private attachCustomEventHandler;
1019
- private formatBin;
1020
- private get elementToFieldMap();
1021
- }
1022
- interface TokenizeOptions {
1023
- futureUsage?: 'CardOnFile' | 'Subscription' | 'UnscheduledCardOnFile';
1024
- storeInstrument?: boolean;
954
+ type TokenizedCollectResult = {
955
+ skyflow_id?: string;
956
+ card_number?: string;
957
+ cardholder_name?: string;
958
+ expiry_month?: string;
959
+ expiry_year?: string;
960
+ security_code: string;
961
+ instrumentId?: string;
962
+ };
963
+ interface EncryptedCollectResult {
964
+ vaultProviderConfigId: string;
965
+ encryptedData: string;
966
+ }
967
+ interface CollectElementOptions {
968
+ type: ElementType;
969
+ label?: string;
970
+ placeholder?: string;
971
+ altText?: string;
972
+ format?: string;
973
+ inputStyles?: object;
974
+ labelStyles?: object;
975
+ errorTextStyles?: object;
976
+ required?: boolean;
977
+ enableCardIcon?: boolean;
978
+ }
979
+ type PayrailsContainerType = 'COLLECT' | 'COMPOSABLE';
980
+ interface CollectContainerOptions {
981
+ layout?: number[];
982
+ cardTableName?: string;
983
+ containerType?: PayrailsContainerType;
984
+ styles?: {
985
+ base?: Partial<CSSStyleDeclaration>;
986
+ };
987
+ errorTextStyles?: {
988
+ base?: Partial<CSSStyleDeclaration>;
989
+ };
990
+ }
991
+ interface PayrailsSecureField {
992
+ on(eventName: string, handler: any): void;
993
+ mount?: (domElement: any) => void;
994
+ unmount?: () => void;
995
+ getState?: () => {
996
+ isEmpty: boolean;
997
+ isComplete: boolean;
998
+ isValid: boolean;
999
+ isFocused: boolean;
1000
+ value: unknown;
1001
+ required: boolean;
1002
+ };
1003
+ isValidElement?: () => boolean;
1004
+ setError?: (clientErrorText: string) => void;
1005
+ resetError?: () => void;
1006
+ setValue?: (elementValue: string) => void;
1007
+ clearValue?: () => void;
1008
+ }
1009
+ declare class PayrailsCollectContainer implements Mountable {
1010
+ private sdkConfig;
1011
+ bin: string;
1012
+ readonly id = "payrails-container-wrapper";
1013
+ private readonly __container;
1014
+ private element;
1015
+ private readonly cardTableName;
1016
+ private readonly containerType;
1017
+ constructor(__client: Skyflow, options: CollectContainerOptions, sdkConfig: SdkConfiguration);
1018
+ createCollectElement(options: CollectElementOptions): PayrailsSecureField;
1019
+ mount(selector: string): void;
1020
+ unmount(): void;
1021
+ collect(): Promise<TokenizedCollectResult | EncryptedCollectResult>;
1022
+ private collectSkyflowData;
1023
+ private collectPayrailsData;
1024
+ tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
1025
+ private constructSaveInstrumentBody;
1026
+ private attachCustomEventHandler;
1027
+ private formatBin;
1028
+ private get elementToFieldMap();
1029
+ }
1030
+ interface TokenizeOptions {
1031
+ futureUsage?: 'CardOnFile' | 'Subscription' | 'UnscheduledCardOnFile';
1032
+ storeInstrument?: boolean;
1025
1033
  }
1026
1034
 
1027
1035
  export { ApplePayButtonOptions, AuthorizationFailureReasons, CardFormOptions, CardListOptions, CardPaymentButtonOptions, DropinOptions, ElementType, GooglePayButtonOptions, InitOptions, PaymentEvents, PaypalButtonOptions, Payrails, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsSecureField, SaveInstrumentResponse, WorkflowExecutionResponse };