@payrails/web-sdk 5.31.2-RC.0 → 5.32.0
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 +16 -4
- package/index.js +4 -4
- package/package.json +1 -1
- package/payrails.d.ts +29 -3
- package/payrails.js +4 -4
package/package.json
CHANGED
package/payrails.d.ts
CHANGED
|
@@ -210,6 +210,7 @@ declare class WorkflowExecution {
|
|
|
210
210
|
paymentMethodCode: PAYMENT_METHOD_CODES;
|
|
211
211
|
payoutMethodCode?: PAYMENT_METHOD_CODES;
|
|
212
212
|
};
|
|
213
|
+
static updateInstallmentOptions(installmentOptions?: PaymentInstallmentsConfig): void;
|
|
213
214
|
}
|
|
214
215
|
interface WorkflowExecutionResponse {
|
|
215
216
|
id: string;
|
|
@@ -290,6 +291,11 @@ interface BaseInstallmentOption {
|
|
|
290
291
|
interface PaymentInstallmentsConfig {
|
|
291
292
|
[key: string]: BaseInstallmentOption[];
|
|
292
293
|
}
|
|
294
|
+
interface InstallmentUpdateConfig {
|
|
295
|
+
defaultInstallment?: number | null;
|
|
296
|
+
installmentCountry?: string | null;
|
|
297
|
+
installmentOptions?: BaseInstallmentOption[] | null;
|
|
298
|
+
}
|
|
293
299
|
interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C = undefined | ApplePayConfig | PayPalConfig | GooglePayConfig> extends BasePaymentMethodConfig {
|
|
294
300
|
id: string;
|
|
295
301
|
description?: string;
|
|
@@ -583,6 +589,7 @@ declare class CollectElement extends SkyflowElement {
|
|
|
583
589
|
resetError(): void;
|
|
584
590
|
setValue(elementValue: string): void;
|
|
585
591
|
clearValue(): void;
|
|
592
|
+
setAttribute(attribute: string, value: string | number): void;
|
|
586
593
|
}
|
|
587
594
|
|
|
588
595
|
interface CollectElementInput$1 {
|
|
@@ -642,6 +649,7 @@ declare class ComposableElement {
|
|
|
642
649
|
constructor(name: any, eventEmitter: any);
|
|
643
650
|
on(eventName: string, handler: any): void;
|
|
644
651
|
update: (options: any) => void;
|
|
652
|
+
setAttribute(attribute: string, value: string | number): void;
|
|
645
653
|
}
|
|
646
654
|
|
|
647
655
|
/**
|
|
@@ -900,6 +908,7 @@ interface PayrailsSecureField {
|
|
|
900
908
|
setValue?: (elementValue: string) => void;
|
|
901
909
|
clearValue?: () => void;
|
|
902
910
|
update?: (data: Partial<CollectElementOptions>) => void;
|
|
911
|
+
setAttribute: (attribute: string, value: string | number) => void;
|
|
903
912
|
}
|
|
904
913
|
declare class PayrailsCollectContainer implements Mountable {
|
|
905
914
|
bin: string;
|
|
@@ -989,8 +998,11 @@ type CardNetwork = keyof typeof regexes;
|
|
|
989
998
|
|
|
990
999
|
interface PaymentInstallmentsElementOptions extends ElementOptions {
|
|
991
1000
|
showPaymentInstallmentsDropdown?: boolean;
|
|
992
|
-
|
|
993
|
-
|
|
1001
|
+
installmentConfig?: {
|
|
1002
|
+
defaultInstallment?: number | null;
|
|
1003
|
+
installmentOptions?: BaseInstallmentOption[] | null;
|
|
1004
|
+
installmentCurrency?: string;
|
|
1005
|
+
};
|
|
994
1006
|
translations?: {
|
|
995
1007
|
labels?: {
|
|
996
1008
|
paymentInstallments?: string;
|
|
@@ -1003,11 +1015,13 @@ interface PaymentInstallmentsElementOptions extends ElementOptions {
|
|
|
1003
1015
|
}
|
|
1004
1016
|
declare class PaymentInstallmentsDropdown extends PayrailsElement {
|
|
1005
1017
|
private options;
|
|
1018
|
+
private INSTALLMENT_STORAGE_KEY;
|
|
1006
1019
|
private installmentOptions;
|
|
1007
1020
|
constructor(options: PaymentInstallmentsElementOptions);
|
|
1008
1021
|
private generateOptionsHTML;
|
|
1009
1022
|
private renderOptions;
|
|
1010
1023
|
updateOptions(installmentOptions: BaseInstallmentOption[]): void;
|
|
1024
|
+
updateConfig(installmentConfig?: PaymentInstallmentsElementOptions['installmentConfig']): void;
|
|
1011
1025
|
private createHTML;
|
|
1012
1026
|
private applyStyles;
|
|
1013
1027
|
private addListeners;
|
|
@@ -1021,6 +1035,7 @@ declare class PayrailsElementWithPaymentInstallmentsDropdown extends PayrailsEle
|
|
|
1021
1035
|
constructor(elementType: string, options?: PaymentInstallmentsElementOptions | undefined);
|
|
1022
1036
|
get selectedInstallmentValue(): number;
|
|
1023
1037
|
updateInstallmentOptions(installmentOptions: BaseInstallmentOption[]): void;
|
|
1038
|
+
updateInstallmentConfig(installmentConfig?: PaymentInstallmentsElementOptions['installmentConfig']): void;
|
|
1024
1039
|
setDisabled(state: boolean): void;
|
|
1025
1040
|
}
|
|
1026
1041
|
|
|
@@ -1066,6 +1081,9 @@ interface CardFormOptions extends StoreInstrumentElementOptions {
|
|
|
1066
1081
|
showCardHolderName?: boolean;
|
|
1067
1082
|
showSingleExpiryDateField?: boolean;
|
|
1068
1083
|
enrollInstrumentToNetworkOffers?: boolean;
|
|
1084
|
+
installmentConfig?: {
|
|
1085
|
+
defaultInstallment?: number | null;
|
|
1086
|
+
};
|
|
1069
1087
|
layout?: CardFormLayout;
|
|
1070
1088
|
translations?: {
|
|
1071
1089
|
placeholders?: {
|
|
@@ -1129,6 +1147,7 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
|
1129
1147
|
private updateTranslations;
|
|
1130
1148
|
private updateEvents;
|
|
1131
1149
|
update(options: Partial<Pick<CardFormOptions, 'styles' | 'translations' | 'events'>>): void;
|
|
1150
|
+
updateInstallmentConfig(installmentConfig?: InstallmentUpdateConfig): void;
|
|
1132
1151
|
private createFormField;
|
|
1133
1152
|
private initializeCustomLayout;
|
|
1134
1153
|
private hasFieldBeenUsed;
|
|
@@ -1221,6 +1240,11 @@ interface PayrailsAmount {
|
|
|
1221
1240
|
value: string;
|
|
1222
1241
|
currency: string;
|
|
1223
1242
|
}
|
|
1243
|
+
interface LookupUpdateOptions {
|
|
1244
|
+
value: string;
|
|
1245
|
+
currency: string;
|
|
1246
|
+
installmentConfig?: InstallmentUpdateConfig | null;
|
|
1247
|
+
}
|
|
1224
1248
|
interface Links {
|
|
1225
1249
|
method: 'GET' | 'POST';
|
|
1226
1250
|
href: string;
|
|
@@ -1559,6 +1583,7 @@ declare class Dropin extends PayrailsElement {
|
|
|
1559
1583
|
private createStoredInstrumentElement;
|
|
1560
1584
|
private createInstallmentsDropdown;
|
|
1561
1585
|
private getInstallmentOptionsForInstrument;
|
|
1586
|
+
updateInstallmentConfig(installmentConfig?: InstallmentUpdateConfig): void;
|
|
1562
1587
|
private createHppIntegrationElement;
|
|
1563
1588
|
private get totalPaymentOptions();
|
|
1564
1589
|
private createCreditCardButton;
|
|
@@ -1594,6 +1619,7 @@ interface DropinOptions {
|
|
|
1594
1619
|
showSingleExpiryDateField?: boolean;
|
|
1595
1620
|
layout?: CardFormLayout;
|
|
1596
1621
|
disablePaymentButton?: boolean;
|
|
1622
|
+
installmentConfig?: CardFormOptions['installmentConfig'];
|
|
1597
1623
|
} & StorablePaymentMethodConfiguration;
|
|
1598
1624
|
payPal?: StorablePaymentMethodConfiguration;
|
|
1599
1625
|
googlePay?: StorablePaymentMethodConfiguration & {
|
|
@@ -1825,7 +1851,7 @@ declare class Payrails {
|
|
|
1825
1851
|
private __sharedState;
|
|
1826
1852
|
static preloadCardForm: typeof SdkLoader.preloadCardForm;
|
|
1827
1853
|
static init(initResponse: InitOptions, options?: PayrailsClientOptions): Payrails;
|
|
1828
|
-
update(
|
|
1854
|
+
update(updateOptions: LookupUpdateOptions): void;
|
|
1829
1855
|
collectContainer(containerOptions: CollectContainerOptions): PayrailsCollectContainer;
|
|
1830
1856
|
googlePayButton(options: GooglePayButtonOptions): GooglePayButton;
|
|
1831
1857
|
isGooglePayAvailable(merchantInfo: google.payments.api.MerchantInfo): Promise<boolean>;
|