@payrails/web-sdk 5.29.1-rc.1 → 5.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -6
- package/index.js +4 -4
- package/package.json +1 -1
- package/payrails-styles.css +77 -77
- package/payrails.d.ts +135 -29
- package/payrails.js +4 -4
package/package.json
CHANGED
package/payrails-styles.css
CHANGED
|
@@ -683,6 +683,83 @@
|
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
685
|
|
|
686
|
+
button.payrails-generic-button {
|
|
687
|
+
border: none;
|
|
688
|
+
outline: none;
|
|
689
|
+
box-shadow: none;
|
|
690
|
+
margin: 0;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.payrails-generic-button * {
|
|
694
|
+
box-sizing: border-box;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.payrails-generic-button .dot-flashing-container {
|
|
698
|
+
width: 100%;
|
|
699
|
+
display: flex;
|
|
700
|
+
justify-content: center;
|
|
701
|
+
align-items: center;
|
|
702
|
+
position: relative;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.payrails-generic-button .dot-flashing-text {
|
|
706
|
+
visibility: hidden;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.payrails-generic-button .dot-flashing {
|
|
710
|
+
position: absolute;
|
|
711
|
+
left: auto;
|
|
712
|
+
right: auto;
|
|
713
|
+
width: 10px;
|
|
714
|
+
height: 10px;
|
|
715
|
+
border-radius: 5px;
|
|
716
|
+
background-color: currentColor;
|
|
717
|
+
color: currentColor;
|
|
718
|
+
animation: dot-flashing 1s infinite linear alternate;
|
|
719
|
+
animation-delay: 0.5s;
|
|
720
|
+
}
|
|
721
|
+
.payrails-generic-button .dot-flashing::before,
|
|
722
|
+
.payrails-generic-button .dot-flashing::after {
|
|
723
|
+
content: '';
|
|
724
|
+
display: inline-block;
|
|
725
|
+
position: absolute;
|
|
726
|
+
top: 0;
|
|
727
|
+
}
|
|
728
|
+
.payrails-generic-button .dot-flashing::before {
|
|
729
|
+
left: -15px;
|
|
730
|
+
width: 10px;
|
|
731
|
+
height: 10px;
|
|
732
|
+
border-radius: 5px;
|
|
733
|
+
background-color: currentColor;
|
|
734
|
+
color: currentColor;
|
|
735
|
+
animation: dot-flashing 1s infinite alternate;
|
|
736
|
+
animation-delay: 0s;
|
|
737
|
+
}
|
|
738
|
+
.payrails-generic-button .dot-flashing::after {
|
|
739
|
+
left: 15px;
|
|
740
|
+
width: 10px;
|
|
741
|
+
height: 10px;
|
|
742
|
+
border-radius: 5px;
|
|
743
|
+
background-color: currentColor;
|
|
744
|
+
color: currentColor;
|
|
745
|
+
animation: dot-flashing 1s infinite alternate;
|
|
746
|
+
animation-delay: 1s;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
@keyframes dot-flashing {
|
|
750
|
+
0% {
|
|
751
|
+
opacity: 1;
|
|
752
|
+
}
|
|
753
|
+
50%,
|
|
754
|
+
100% {
|
|
755
|
+
opacity: 0.2;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
#payrails-paypal-button-wrapper {
|
|
760
|
+
min-height: 44px;
|
|
761
|
+
}
|
|
762
|
+
|
|
686
763
|
.payrails-dynamic-element-form {
|
|
687
764
|
display: flex;
|
|
688
765
|
flex-direction: column;
|
|
@@ -803,83 +880,6 @@
|
|
|
803
880
|
color: unset;
|
|
804
881
|
}
|
|
805
882
|
|
|
806
|
-
button.payrails-generic-button {
|
|
807
|
-
border: none;
|
|
808
|
-
outline: none;
|
|
809
|
-
box-shadow: none;
|
|
810
|
-
margin: 0;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
.payrails-generic-button * {
|
|
814
|
-
box-sizing: border-box;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
.payrails-generic-button .dot-flashing-container {
|
|
818
|
-
width: 100%;
|
|
819
|
-
display: flex;
|
|
820
|
-
justify-content: center;
|
|
821
|
-
align-items: center;
|
|
822
|
-
position: relative;
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
.payrails-generic-button .dot-flashing-text {
|
|
826
|
-
visibility: hidden;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
.payrails-generic-button .dot-flashing {
|
|
830
|
-
position: absolute;
|
|
831
|
-
left: auto;
|
|
832
|
-
right: auto;
|
|
833
|
-
width: 10px;
|
|
834
|
-
height: 10px;
|
|
835
|
-
border-radius: 5px;
|
|
836
|
-
background-color: currentColor;
|
|
837
|
-
color: currentColor;
|
|
838
|
-
animation: dot-flashing 1s infinite linear alternate;
|
|
839
|
-
animation-delay: 0.5s;
|
|
840
|
-
}
|
|
841
|
-
.payrails-generic-button .dot-flashing::before,
|
|
842
|
-
.payrails-generic-button .dot-flashing::after {
|
|
843
|
-
content: '';
|
|
844
|
-
display: inline-block;
|
|
845
|
-
position: absolute;
|
|
846
|
-
top: 0;
|
|
847
|
-
}
|
|
848
|
-
.payrails-generic-button .dot-flashing::before {
|
|
849
|
-
left: -15px;
|
|
850
|
-
width: 10px;
|
|
851
|
-
height: 10px;
|
|
852
|
-
border-radius: 5px;
|
|
853
|
-
background-color: currentColor;
|
|
854
|
-
color: currentColor;
|
|
855
|
-
animation: dot-flashing 1s infinite alternate;
|
|
856
|
-
animation-delay: 0s;
|
|
857
|
-
}
|
|
858
|
-
.payrails-generic-button .dot-flashing::after {
|
|
859
|
-
left: 15px;
|
|
860
|
-
width: 10px;
|
|
861
|
-
height: 10px;
|
|
862
|
-
border-radius: 5px;
|
|
863
|
-
background-color: currentColor;
|
|
864
|
-
color: currentColor;
|
|
865
|
-
animation: dot-flashing 1s infinite alternate;
|
|
866
|
-
animation-delay: 1s;
|
|
867
|
-
}
|
|
868
|
-
|
|
869
|
-
@keyframes dot-flashing {
|
|
870
|
-
0% {
|
|
871
|
-
opacity: 1;
|
|
872
|
-
}
|
|
873
|
-
50%,
|
|
874
|
-
100% {
|
|
875
|
-
opacity: 0.2;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
#payrails-paypal-button-wrapper {
|
|
880
|
-
min-height: 44px;
|
|
881
|
-
}
|
|
882
|
-
|
|
883
883
|
.payrails-container-wrapper {
|
|
884
884
|
width: 100%;
|
|
885
885
|
min-height: 90px;
|
package/payrails.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import * as _payrails_iframe_event_bus from '@payrails/iframe-event-bus';
|
|
|
2
2
|
import { LogLevel as LogLevel$1 } from '@payrails/logger';
|
|
3
3
|
import { FraudProvider } from '@payrails/fraud-sdk';
|
|
4
4
|
|
|
5
|
+
declare const UI_POSITION_FIELD = "ui:position";
|
|
6
|
+
|
|
5
7
|
type JSONSchemaType = JSONSchemaProperty & {
|
|
6
8
|
required?: string[];
|
|
7
9
|
dependentSchemas?: Record<string, JSONSchemaDependentSchema>;
|
|
@@ -23,6 +25,7 @@ interface JSONSchemaProperty {
|
|
|
23
25
|
maxLength?: number;
|
|
24
26
|
errorMessage?: Record<string, string>;
|
|
25
27
|
$ref?: string;
|
|
28
|
+
[UI_POSITION_FIELD]?: number;
|
|
26
29
|
properties?: Record<string, JSONSchemaType>;
|
|
27
30
|
}
|
|
28
31
|
interface JSONSchemaOneOfOption {
|
|
@@ -33,6 +36,10 @@ interface JSONSchemaOneOfOption {
|
|
|
33
36
|
const: string | number;
|
|
34
37
|
title: string;
|
|
35
38
|
}
|
|
39
|
+
interface DynamicElementEvents {
|
|
40
|
+
onReady: () => void;
|
|
41
|
+
onValidationChange: (isValid: boolean) => void;
|
|
42
|
+
}
|
|
36
43
|
interface DynamicElementFieldTranslation {
|
|
37
44
|
label?: string;
|
|
38
45
|
placeholder?: string;
|
|
@@ -46,9 +53,6 @@ interface DynamicElementErrorTranslation {
|
|
|
46
53
|
oneOf: string;
|
|
47
54
|
}
|
|
48
55
|
type DynamicElementTranslations = {
|
|
49
|
-
labels?: {
|
|
50
|
-
submitButton?: string;
|
|
51
|
-
};
|
|
52
56
|
fields?: Record<string, DynamicElementFieldTranslation>;
|
|
53
57
|
errors?: Partial<DynamicElementErrorTranslation>;
|
|
54
58
|
};
|
|
@@ -103,14 +107,20 @@ declare class WorkflowExecution {
|
|
|
103
107
|
private static _response;
|
|
104
108
|
static get response(): WorkflowExecutionResponse;
|
|
105
109
|
static setResponse(response: WorkflowExecutionResponse): typeof WorkflowExecution;
|
|
110
|
+
static get workflowCode(): string;
|
|
106
111
|
static get lookup(): {
|
|
107
112
|
httpCode: number;
|
|
108
113
|
body: {
|
|
109
114
|
data: {
|
|
110
|
-
paymentCompositionOptions
|
|
115
|
+
paymentCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
116
|
+
payoutCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
111
117
|
};
|
|
112
118
|
links: {
|
|
113
|
-
authorize
|
|
119
|
+
authorize?: {
|
|
120
|
+
href: string;
|
|
121
|
+
method: "POST";
|
|
122
|
+
};
|
|
123
|
+
payout?: {
|
|
114
124
|
href: string;
|
|
115
125
|
method: "POST";
|
|
116
126
|
};
|
|
@@ -133,6 +143,7 @@ declare class WorkflowExecution {
|
|
|
133
143
|
countryCode: string;
|
|
134
144
|
merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
|
|
135
145
|
requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
146
|
+
requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
136
147
|
};
|
|
137
148
|
static get url(): string;
|
|
138
149
|
static get meta(): {
|
|
@@ -151,6 +162,7 @@ declare class WorkflowExecution {
|
|
|
151
162
|
};
|
|
152
163
|
static get availablePaymentMethods(): StorablePaymentCompositionOption<CardMetadata | PayPalMetadata, ApplePayConfig | PayPalConfig | GooglePayConfig | undefined>[];
|
|
153
164
|
static get authorizeLink(): string | undefined;
|
|
165
|
+
static get payoutLink(): string | undefined;
|
|
154
166
|
static get createSessionLink(): string | undefined;
|
|
155
167
|
static get storedPaymentInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
156
168
|
static get storedDropinInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
@@ -172,8 +184,11 @@ declare class WorkflowExecution {
|
|
|
172
184
|
supportsBillingInfo?: boolean;
|
|
173
185
|
schema?: JSONSchemaType;
|
|
174
186
|
additionalConfig?: any;
|
|
187
|
+
instrumentDataSchema?: JSONSchemaType;
|
|
175
188
|
};
|
|
189
|
+
payoutInstruments?: StoredPaymentInstrument<CardMetadata | PayPalMetadata>[] | undefined;
|
|
176
190
|
paymentMethodCode: PAYMENT_METHOD_CODES;
|
|
191
|
+
payoutMethodCode?: PAYMENT_METHOD_CODES;
|
|
177
192
|
} | undefined;
|
|
178
193
|
static getPaymentMethodConfig(paymentMethod: StorablePaymentCompositionOption): {
|
|
179
194
|
id: string;
|
|
@@ -188,14 +203,18 @@ declare class WorkflowExecution {
|
|
|
188
203
|
supportsBillingInfo?: boolean;
|
|
189
204
|
schema?: JSONSchemaType;
|
|
190
205
|
additionalConfig?: any;
|
|
206
|
+
instrumentDataSchema?: JSONSchemaType;
|
|
191
207
|
};
|
|
208
|
+
payoutInstruments?: StoredPaymentInstrument<CardMetadata | PayPalMetadata>[] | undefined;
|
|
192
209
|
paymentMethodCode: PAYMENT_METHOD_CODES;
|
|
210
|
+
payoutMethodCode?: PAYMENT_METHOD_CODES;
|
|
193
211
|
};
|
|
194
212
|
}
|
|
195
213
|
interface WorkflowExecutionResponse {
|
|
196
214
|
id: string;
|
|
197
215
|
merchantReference: string;
|
|
198
216
|
holderReference: string;
|
|
217
|
+
holderId?: string;
|
|
199
218
|
actionRequired?: string;
|
|
200
219
|
meta: {
|
|
201
220
|
customer?: {
|
|
@@ -219,10 +238,15 @@ interface WorkflowExecutionResponse {
|
|
|
219
238
|
httpCode: number;
|
|
220
239
|
body: {
|
|
221
240
|
data: {
|
|
222
|
-
paymentCompositionOptions
|
|
241
|
+
paymentCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
242
|
+
payoutCompositionOptions?: Array<StorablePaymentCompositionOption>;
|
|
223
243
|
};
|
|
224
244
|
links: {
|
|
225
|
-
authorize
|
|
245
|
+
authorize?: {
|
|
246
|
+
href: string;
|
|
247
|
+
method: 'POST';
|
|
248
|
+
};
|
|
249
|
+
payout?: {
|
|
226
250
|
href: string;
|
|
227
251
|
method: 'POST';
|
|
228
252
|
};
|
|
@@ -256,6 +280,7 @@ interface WorkflowExecutionResponse {
|
|
|
256
280
|
}
|
|
257
281
|
interface BasePaymentMethodConfig {
|
|
258
282
|
paymentMethodCode: PAYMENT_METHOD_CODES;
|
|
283
|
+
payoutMethodCode?: PAYMENT_METHOD_CODES;
|
|
259
284
|
}
|
|
260
285
|
interface BaseInstallmentOption {
|
|
261
286
|
count: number;
|
|
@@ -277,8 +302,10 @@ interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C
|
|
|
277
302
|
supportsBillingInfo?: boolean;
|
|
278
303
|
schema?: JSONSchemaType;
|
|
279
304
|
additionalConfig?: any;
|
|
305
|
+
instrumentDataSchema?: JSONSchemaType;
|
|
280
306
|
};
|
|
281
307
|
paymentInstruments?: Array<StoredPaymentInstrument<I>>;
|
|
308
|
+
payoutInstruments?: Array<StoredPaymentInstrument<I>>;
|
|
282
309
|
}
|
|
283
310
|
interface GooglePayConfig {
|
|
284
311
|
parameters: {
|
|
@@ -313,10 +340,11 @@ interface ApplePayConfig {
|
|
|
313
340
|
countryCode: string;
|
|
314
341
|
merchantCapabilities: ApplePayJS.ApplePayMerchantCapability[];
|
|
315
342
|
requiredBillingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
343
|
+
requiredShippingContactFields?: ApplePayJS.ApplePayContactField[];
|
|
316
344
|
};
|
|
317
345
|
type: string;
|
|
318
346
|
}
|
|
319
|
-
interface StoredPaymentInstrument<T = CardMetadata | PayPalMetadata> {
|
|
347
|
+
interface StoredPaymentInstrument<T = CardMetadata | PayPalMetadata | BankAccountMetadata> {
|
|
320
348
|
id: string;
|
|
321
349
|
status: PAYMENT_INSTRUMENT_STATUS;
|
|
322
350
|
paymentMethod: PAYMENT_METHOD_CODES;
|
|
@@ -326,18 +354,61 @@ interface StoredPaymentInstrument<T = CardMetadata | PayPalMetadata> {
|
|
|
326
354
|
interface PayPalMetadata {
|
|
327
355
|
email?: string;
|
|
328
356
|
}
|
|
357
|
+
interface Country {
|
|
358
|
+
code: string;
|
|
359
|
+
name: string;
|
|
360
|
+
iso3: string;
|
|
361
|
+
}
|
|
329
362
|
interface CardMetadata {
|
|
330
363
|
bin?: string;
|
|
331
364
|
suffix?: string;
|
|
332
365
|
network?: string;
|
|
333
366
|
binLookup?: {
|
|
334
|
-
issuerCountry:
|
|
335
|
-
code: string;
|
|
336
|
-
name: string;
|
|
337
|
-
iso3: string;
|
|
338
|
-
};
|
|
367
|
+
issuerCountry: Country;
|
|
339
368
|
};
|
|
340
369
|
}
|
|
370
|
+
interface BankAccountMetadata {
|
|
371
|
+
bankAccount: {
|
|
372
|
+
holder: HolderData;
|
|
373
|
+
bank: BankData;
|
|
374
|
+
account: AccountData;
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
interface HolderData {
|
|
378
|
+
firstName?: string;
|
|
379
|
+
lastName?: string;
|
|
380
|
+
companyName?: string;
|
|
381
|
+
address?: Address;
|
|
382
|
+
email?: string;
|
|
383
|
+
dob?: string;
|
|
384
|
+
country?: Country;
|
|
385
|
+
city?: string;
|
|
386
|
+
type: HolderType;
|
|
387
|
+
}
|
|
388
|
+
type HolderType = 'individual' | 'corporate';
|
|
389
|
+
interface BankData {
|
|
390
|
+
name?: string;
|
|
391
|
+
branchCode?: string;
|
|
392
|
+
code?: string;
|
|
393
|
+
address?: Address;
|
|
394
|
+
swiftCode?: string;
|
|
395
|
+
}
|
|
396
|
+
interface AccountData {
|
|
397
|
+
number?: string;
|
|
398
|
+
iban?: string;
|
|
399
|
+
currency?: string;
|
|
400
|
+
type?: AccountType;
|
|
401
|
+
country?: Country;
|
|
402
|
+
}
|
|
403
|
+
type AccountType = 'savings' | 'current';
|
|
404
|
+
interface Address {
|
|
405
|
+
country?: {
|
|
406
|
+
code?: string;
|
|
407
|
+
fullName?: string;
|
|
408
|
+
iso3?: string;
|
|
409
|
+
};
|
|
410
|
+
postalCode?: string;
|
|
411
|
+
}
|
|
341
412
|
declare enum PAYMENT_CLIENT_FLOW {
|
|
342
413
|
'REDIRECT' = "redirect",
|
|
343
414
|
'DIRECT' = "direct",
|
|
@@ -737,7 +808,7 @@ interface TokenizeOptions {
|
|
|
737
808
|
storeInstrument?: boolean;
|
|
738
809
|
}
|
|
739
810
|
declare abstract class Tokenizable extends PayrailsElement {
|
|
740
|
-
abstract collect(): Promise<any>;
|
|
811
|
+
protected abstract collect(): Promise<any>;
|
|
741
812
|
protected abstract constructSaveInstrumentBody(tokens: any, opts?: TokenizeOptions): Promise<any>;
|
|
742
813
|
tokenize(_opts?: TokenizeOptions): Promise<any>;
|
|
743
814
|
}
|
|
@@ -1026,12 +1097,14 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
|
1026
1097
|
private lastBinLookup;
|
|
1027
1098
|
private defaultStyles;
|
|
1028
1099
|
private defaultTranslations;
|
|
1100
|
+
private eventsRef?;
|
|
1029
1101
|
constructor(collectContainer: PayrailsCollectContainer, options?: CardFormOptions | undefined);
|
|
1030
1102
|
private initializeFormFields;
|
|
1031
1103
|
getErrorTextStyles(errorTextStyles: any): any;
|
|
1032
1104
|
private updateStyles;
|
|
1033
1105
|
private updateTranslations;
|
|
1034
|
-
|
|
1106
|
+
private updateEvents;
|
|
1107
|
+
update(options: Partial<Pick<CardFormOptions, 'styles' | 'translations' | 'events'>>): void;
|
|
1035
1108
|
private createFormField;
|
|
1036
1109
|
private initializeCustomLayout;
|
|
1037
1110
|
private hasFieldBeenUsed;
|
|
@@ -1094,13 +1167,6 @@ declare class CardList extends PayrailsElement {
|
|
|
1094
1167
|
reset(): void;
|
|
1095
1168
|
}
|
|
1096
1169
|
|
|
1097
|
-
declare enum RequestMethod {
|
|
1098
|
-
GET = "GET",
|
|
1099
|
-
POST = "POST",
|
|
1100
|
-
DELETE = "DELETE",
|
|
1101
|
-
PATCH = "PATCH"
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
1170
|
interface SdkConfiguration {
|
|
1105
1171
|
token: string;
|
|
1106
1172
|
amount: PayrailsAmount;
|
|
@@ -1122,7 +1188,6 @@ interface SdkConfiguration {
|
|
|
1122
1188
|
links: {
|
|
1123
1189
|
saveInstrument: {
|
|
1124
1190
|
href: string;
|
|
1125
|
-
method: RequestMethod;
|
|
1126
1191
|
};
|
|
1127
1192
|
};
|
|
1128
1193
|
};
|
|
@@ -1152,6 +1217,25 @@ declare global {
|
|
|
1152
1217
|
};
|
|
1153
1218
|
}
|
|
1154
1219
|
}
|
|
1220
|
+
interface PayoutResponse {
|
|
1221
|
+
name: 'payout';
|
|
1222
|
+
executedAt: string;
|
|
1223
|
+
workspaceId: string;
|
|
1224
|
+
actionId: string;
|
|
1225
|
+
links: {
|
|
1226
|
+
execution: string;
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
type PayoutComposition = Array<{
|
|
1230
|
+
integrationType: string;
|
|
1231
|
+
amount: PayrailsAmount;
|
|
1232
|
+
paymentMethodCode: PAYMENT_METHOD_CODES;
|
|
1233
|
+
paymentInstrumentId?: string;
|
|
1234
|
+
}>;
|
|
1235
|
+
interface PayoutReqBody {
|
|
1236
|
+
amount: PayrailsAmount;
|
|
1237
|
+
payoutComposition: PayoutComposition;
|
|
1238
|
+
}
|
|
1155
1239
|
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';
|
|
1156
1240
|
|
|
1157
1241
|
interface CardPaymentButtonOptions {
|
|
@@ -1195,7 +1279,8 @@ declare class CardPaymentButton extends PayrailsElement {
|
|
|
1195
1279
|
private constructEncryptedPayment;
|
|
1196
1280
|
private updateStyles;
|
|
1197
1281
|
private updateTranslations;
|
|
1198
|
-
|
|
1282
|
+
private updateEvents;
|
|
1283
|
+
update(options: Partial<Pick<CardPaymentButtonOptions, 'styles' | 'translations' | 'events'>>): void;
|
|
1199
1284
|
private handleAuthorizationResult;
|
|
1200
1285
|
}
|
|
1201
1286
|
declare enum AuthorizationFailureReasons {
|
|
@@ -1332,9 +1417,11 @@ declare class GenericRedirectButton extends PayrailsElement {
|
|
|
1332
1417
|
private redirectToPaymentLink;
|
|
1333
1418
|
private updateStyles;
|
|
1334
1419
|
private updateTranslations;
|
|
1420
|
+
private updateEvents;
|
|
1335
1421
|
update(options: {
|
|
1336
1422
|
styles?: ButtonOptions['styles'];
|
|
1337
1423
|
translations?: ButtonOptions['translations'];
|
|
1424
|
+
events?: ButtonOptions['events'];
|
|
1338
1425
|
}): void;
|
|
1339
1426
|
}
|
|
1340
1427
|
|
|
@@ -1443,7 +1530,6 @@ declare class Dropin extends PayrailsElement {
|
|
|
1443
1530
|
private loadingScreen;
|
|
1444
1531
|
constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions);
|
|
1445
1532
|
private isHppIntegration;
|
|
1446
|
-
private isEmbeddedElement;
|
|
1447
1533
|
private createStoredInstrumentElement;
|
|
1448
1534
|
private createInstallmentsDropdown;
|
|
1449
1535
|
private getInstallmentOptionsForInstrument;
|
|
@@ -1455,7 +1541,6 @@ declare class Dropin extends PayrailsElement {
|
|
|
1455
1541
|
private createCardForm;
|
|
1456
1542
|
private createApplePayButton;
|
|
1457
1543
|
private createCardPaymentButton;
|
|
1458
|
-
private createEmbeddedElement;
|
|
1459
1544
|
private onAuthorizeSuccess;
|
|
1460
1545
|
private getElementEvents;
|
|
1461
1546
|
private onAuthorizePending;
|
|
@@ -1538,8 +1623,8 @@ interface ContainerStyles {
|
|
|
1538
1623
|
interface DynamicElementOptions {
|
|
1539
1624
|
styles?: DynamicElementStyles;
|
|
1540
1625
|
translations?: DynamicElementTranslations;
|
|
1541
|
-
events?: PaymentEvents;
|
|
1542
1626
|
paymentMethod: BasePaymentMethodConfig;
|
|
1627
|
+
events?: DynamicElementEvents;
|
|
1543
1628
|
}
|
|
1544
1629
|
interface FormConfig {
|
|
1545
1630
|
schema: JSONSchemaType;
|
|
@@ -1551,10 +1636,13 @@ declare class DynamicElementForm extends Tokenizable {
|
|
|
1551
1636
|
private formFields;
|
|
1552
1637
|
private formData;
|
|
1553
1638
|
private __schema;
|
|
1639
|
+
private _previousFormValidState;
|
|
1554
1640
|
constructor(options: DynamicElementOptions, formConfig: FormConfig, returnInfo?: ReturnInfo | undefined);
|
|
1555
|
-
collect(): Promise<Record<string, any>>;
|
|
1641
|
+
protected collect(): Promise<Record<string, any>>;
|
|
1556
1642
|
protected constructSaveInstrumentBody(tokens: any, opts?: TokenizeOptions): Promise<any>;
|
|
1557
1643
|
private isFormValid;
|
|
1644
|
+
private isFormValidSilent;
|
|
1645
|
+
private checkAndTriggerValidationChange;
|
|
1558
1646
|
mount(location: string): Promise<void>;
|
|
1559
1647
|
private makeForm;
|
|
1560
1648
|
private createField;
|
|
@@ -1567,9 +1655,17 @@ declare class DynamicElementForm extends Tokenizable {
|
|
|
1567
1655
|
private evaluateDependencies;
|
|
1568
1656
|
}
|
|
1569
1657
|
|
|
1658
|
+
declare enum RequestMethod {
|
|
1659
|
+
GET = "GET",
|
|
1660
|
+
POST = "POST",
|
|
1661
|
+
DELETE = "DELETE",
|
|
1662
|
+
PATCH = "PATCH"
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1570
1665
|
type Operations = {
|
|
1571
1666
|
deleteInstrument: OperationConfig<void, DeleteInstrumentResponse>;
|
|
1572
1667
|
updateInstrument: OperationConfig<UpdateInstrumentBody, UpdateInstrumentResponse>;
|
|
1668
|
+
payout: OperationConfig<PayoutReqBody, PayoutResponse>;
|
|
1573
1669
|
};
|
|
1574
1670
|
interface UpdateInstrumentBody {
|
|
1575
1671
|
status?: 'enabled' | 'disabled';
|
|
@@ -1615,10 +1711,13 @@ type RequestCreator<TReq, TOperation extends keyof Operations> = (config: ApiCon
|
|
|
1615
1711
|
url: string;
|
|
1616
1712
|
body?: TReq;
|
|
1617
1713
|
};
|
|
1714
|
+
type LinkKey = keyof NonNullable<SdkConfiguration['links']> | 'payout';
|
|
1618
1715
|
interface OperationConfig<TReq, TRes> {
|
|
1619
|
-
linkKey:
|
|
1716
|
+
linkKey: LinkKey;
|
|
1620
1717
|
method: RequestMethod;
|
|
1621
1718
|
createRequest: RequestCreator<TReq, keyof Operations>;
|
|
1719
|
+
onSuccess?: (response: TRes) => Promise<any>;
|
|
1720
|
+
onError?: (error: Error) => Promise<any>;
|
|
1622
1721
|
requestType: TReq;
|
|
1623
1722
|
responseType: TRes;
|
|
1624
1723
|
}
|
|
@@ -1671,6 +1770,10 @@ interface InitOptions {
|
|
|
1671
1770
|
data: string;
|
|
1672
1771
|
}
|
|
1673
1772
|
|
|
1773
|
+
interface PublicSharedState {
|
|
1774
|
+
instrument: StoredPaymentInstrument | null;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1674
1777
|
interface PayrailsClientOptions {
|
|
1675
1778
|
environment?: PayrailsEnvironment;
|
|
1676
1779
|
events?: ClientEvents;
|
|
@@ -1692,6 +1795,7 @@ declare class Payrails {
|
|
|
1692
1795
|
private __genericRedirectButton;
|
|
1693
1796
|
private __dynamicElementForm;
|
|
1694
1797
|
private __dropin;
|
|
1798
|
+
private __sharedState;
|
|
1695
1799
|
static preloadCardForm: typeof SdkLoader.preloadCardForm;
|
|
1696
1800
|
static init(initResponse: InitOptions, options?: PayrailsClientOptions): Payrails;
|
|
1697
1801
|
update(amount: PayrailsAmount): void;
|
|
@@ -1700,6 +1804,7 @@ declare class Payrails {
|
|
|
1700
1804
|
isGooglePayAvailable(merchantInfo: google.payments.api.MerchantInfo): Promise<boolean>;
|
|
1701
1805
|
applePayButton(options: ApplePayButtonOptions): ApplePayButton;
|
|
1702
1806
|
isApplePayAvailable(): Promise<boolean>;
|
|
1807
|
+
setState({ instrument }: PublicSharedState): void;
|
|
1703
1808
|
cardList(options?: CardListOptions): CardList;
|
|
1704
1809
|
cardForm(options?: CardFormOptions): CardForm;
|
|
1705
1810
|
dropin(options: DropinOptions): Dropin;
|
|
@@ -1711,6 +1816,7 @@ declare class Payrails {
|
|
|
1711
1816
|
operation: TOperation;
|
|
1712
1817
|
}): Promise<Operations[TOperation]['responseType']>;
|
|
1713
1818
|
getStoredInstruments(): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
1819
|
+
getStoredInstrumentsByPaymentMethod(paymentMethod: PAYMENT_METHOD_CODES): StoredPaymentInstrument<PayPalMetadata & CardMetadata>[];
|
|
1714
1820
|
getAvailablePaymentMethods(): PAYMENT_METHOD_CODES[];
|
|
1715
1821
|
paymentButton(options: CardPaymentButtonOptions): CardPaymentButton;
|
|
1716
1822
|
paypalButton(options?: PaypalButtonOptions): PaypalButton;
|