@payrails/web-sdk 5.31.2 → 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 +7 -0
- package/index.js +4 -4
- package/package.json +1 -1
- package/payrails.d.ts +26 -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;
|
|
@@ -992,8 +998,11 @@ type CardNetwork = keyof typeof regexes;
|
|
|
992
998
|
|
|
993
999
|
interface PaymentInstallmentsElementOptions extends ElementOptions {
|
|
994
1000
|
showPaymentInstallmentsDropdown?: boolean;
|
|
995
|
-
|
|
996
|
-
|
|
1001
|
+
installmentConfig?: {
|
|
1002
|
+
defaultInstallment?: number | null;
|
|
1003
|
+
installmentOptions?: BaseInstallmentOption[] | null;
|
|
1004
|
+
installmentCurrency?: string;
|
|
1005
|
+
};
|
|
997
1006
|
translations?: {
|
|
998
1007
|
labels?: {
|
|
999
1008
|
paymentInstallments?: string;
|
|
@@ -1006,11 +1015,13 @@ interface PaymentInstallmentsElementOptions extends ElementOptions {
|
|
|
1006
1015
|
}
|
|
1007
1016
|
declare class PaymentInstallmentsDropdown extends PayrailsElement {
|
|
1008
1017
|
private options;
|
|
1018
|
+
private INSTALLMENT_STORAGE_KEY;
|
|
1009
1019
|
private installmentOptions;
|
|
1010
1020
|
constructor(options: PaymentInstallmentsElementOptions);
|
|
1011
1021
|
private generateOptionsHTML;
|
|
1012
1022
|
private renderOptions;
|
|
1013
1023
|
updateOptions(installmentOptions: BaseInstallmentOption[]): void;
|
|
1024
|
+
updateConfig(installmentConfig?: PaymentInstallmentsElementOptions['installmentConfig']): void;
|
|
1014
1025
|
private createHTML;
|
|
1015
1026
|
private applyStyles;
|
|
1016
1027
|
private addListeners;
|
|
@@ -1024,6 +1035,7 @@ declare class PayrailsElementWithPaymentInstallmentsDropdown extends PayrailsEle
|
|
|
1024
1035
|
constructor(elementType: string, options?: PaymentInstallmentsElementOptions | undefined);
|
|
1025
1036
|
get selectedInstallmentValue(): number;
|
|
1026
1037
|
updateInstallmentOptions(installmentOptions: BaseInstallmentOption[]): void;
|
|
1038
|
+
updateInstallmentConfig(installmentConfig?: PaymentInstallmentsElementOptions['installmentConfig']): void;
|
|
1027
1039
|
setDisabled(state: boolean): void;
|
|
1028
1040
|
}
|
|
1029
1041
|
|
|
@@ -1069,6 +1081,9 @@ interface CardFormOptions extends StoreInstrumentElementOptions {
|
|
|
1069
1081
|
showCardHolderName?: boolean;
|
|
1070
1082
|
showSingleExpiryDateField?: boolean;
|
|
1071
1083
|
enrollInstrumentToNetworkOffers?: boolean;
|
|
1084
|
+
installmentConfig?: {
|
|
1085
|
+
defaultInstallment?: number | null;
|
|
1086
|
+
};
|
|
1072
1087
|
layout?: CardFormLayout;
|
|
1073
1088
|
translations?: {
|
|
1074
1089
|
placeholders?: {
|
|
@@ -1132,6 +1147,7 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
|
1132
1147
|
private updateTranslations;
|
|
1133
1148
|
private updateEvents;
|
|
1134
1149
|
update(options: Partial<Pick<CardFormOptions, 'styles' | 'translations' | 'events'>>): void;
|
|
1150
|
+
updateInstallmentConfig(installmentConfig?: InstallmentUpdateConfig): void;
|
|
1135
1151
|
private createFormField;
|
|
1136
1152
|
private initializeCustomLayout;
|
|
1137
1153
|
private hasFieldBeenUsed;
|
|
@@ -1224,6 +1240,11 @@ interface PayrailsAmount {
|
|
|
1224
1240
|
value: string;
|
|
1225
1241
|
currency: string;
|
|
1226
1242
|
}
|
|
1243
|
+
interface LookupUpdateOptions {
|
|
1244
|
+
value: string;
|
|
1245
|
+
currency: string;
|
|
1246
|
+
installmentConfig?: InstallmentUpdateConfig | null;
|
|
1247
|
+
}
|
|
1227
1248
|
interface Links {
|
|
1228
1249
|
method: 'GET' | 'POST';
|
|
1229
1250
|
href: string;
|
|
@@ -1562,6 +1583,7 @@ declare class Dropin extends PayrailsElement {
|
|
|
1562
1583
|
private createStoredInstrumentElement;
|
|
1563
1584
|
private createInstallmentsDropdown;
|
|
1564
1585
|
private getInstallmentOptionsForInstrument;
|
|
1586
|
+
updateInstallmentConfig(installmentConfig?: InstallmentUpdateConfig): void;
|
|
1565
1587
|
private createHppIntegrationElement;
|
|
1566
1588
|
private get totalPaymentOptions();
|
|
1567
1589
|
private createCreditCardButton;
|
|
@@ -1597,6 +1619,7 @@ interface DropinOptions {
|
|
|
1597
1619
|
showSingleExpiryDateField?: boolean;
|
|
1598
1620
|
layout?: CardFormLayout;
|
|
1599
1621
|
disablePaymentButton?: boolean;
|
|
1622
|
+
installmentConfig?: CardFormOptions['installmentConfig'];
|
|
1600
1623
|
} & StorablePaymentMethodConfiguration;
|
|
1601
1624
|
payPal?: StorablePaymentMethodConfiguration;
|
|
1602
1625
|
googlePay?: StorablePaymentMethodConfiguration & {
|
|
@@ -1828,7 +1851,7 @@ declare class Payrails {
|
|
|
1828
1851
|
private __sharedState;
|
|
1829
1852
|
static preloadCardForm: typeof SdkLoader.preloadCardForm;
|
|
1830
1853
|
static init(initResponse: InitOptions, options?: PayrailsClientOptions): Payrails;
|
|
1831
|
-
update(
|
|
1854
|
+
update(updateOptions: LookupUpdateOptions): void;
|
|
1832
1855
|
collectContainer(containerOptions: CollectContainerOptions): PayrailsCollectContainer;
|
|
1833
1856
|
googlePayButton(options: GooglePayButtonOptions): GooglePayButton;
|
|
1834
1857
|
isGooglePayAvailable(merchantInfo: google.payments.api.MerchantInfo): Promise<boolean>;
|