@payrails/web-sdk 5.31.2 → 5.33.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 +13 -0
- package/index.js +4 -4
- package/package.json +3 -2
- package/payrails.d.ts +28 -3
- package/payrails.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payrails/web-sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.33.0",
|
|
4
4
|
"description": "SDK providing tokenization options on the client for merchants",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "payrails.d.ts",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"@rollup/plugin-html": "2.0.0",
|
|
14
14
|
"@types/applepayjs": "14.0.9",
|
|
15
15
|
"@types/googlepay": "0.7.5",
|
|
16
|
-
"rollup-plugin-import-css": "3.5.8"
|
|
16
|
+
"rollup-plugin-import-css": "3.5.8",
|
|
17
|
+
"vitest-fetch-mock": "0.4.5"
|
|
17
18
|
},
|
|
18
19
|
"scripts": {}
|
|
19
20
|
}
|
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;
|
|
@@ -1443,6 +1464,8 @@ declare class GenericRedirectButton extends PayrailsElement {
|
|
|
1443
1464
|
private handleAuthorizationResult;
|
|
1444
1465
|
private createPopupWithTimeout;
|
|
1445
1466
|
private redirectToPaymentLink;
|
|
1467
|
+
private monitorRedirectInNewTab;
|
|
1468
|
+
private watchTabClosure;
|
|
1446
1469
|
private updateStyles;
|
|
1447
1470
|
private updateTranslations;
|
|
1448
1471
|
private updateEvents;
|
|
@@ -1562,6 +1585,7 @@ declare class Dropin extends PayrailsElement {
|
|
|
1562
1585
|
private createStoredInstrumentElement;
|
|
1563
1586
|
private createInstallmentsDropdown;
|
|
1564
1587
|
private getInstallmentOptionsForInstrument;
|
|
1588
|
+
updateInstallmentConfig(installmentConfig?: InstallmentUpdateConfig): void;
|
|
1565
1589
|
private createHppIntegrationElement;
|
|
1566
1590
|
private get totalPaymentOptions();
|
|
1567
1591
|
private createCreditCardButton;
|
|
@@ -1597,6 +1621,7 @@ interface DropinOptions {
|
|
|
1597
1621
|
showSingleExpiryDateField?: boolean;
|
|
1598
1622
|
layout?: CardFormLayout;
|
|
1599
1623
|
disablePaymentButton?: boolean;
|
|
1624
|
+
installmentConfig?: CardFormOptions['installmentConfig'];
|
|
1600
1625
|
} & StorablePaymentMethodConfiguration;
|
|
1601
1626
|
payPal?: StorablePaymentMethodConfiguration;
|
|
1602
1627
|
googlePay?: StorablePaymentMethodConfiguration & {
|
|
@@ -1828,7 +1853,7 @@ declare class Payrails {
|
|
|
1828
1853
|
private __sharedState;
|
|
1829
1854
|
static preloadCardForm: typeof SdkLoader.preloadCardForm;
|
|
1830
1855
|
static init(initResponse: InitOptions, options?: PayrailsClientOptions): Payrails;
|
|
1831
|
-
update(
|
|
1856
|
+
update(updateOptions: LookupUpdateOptions): void;
|
|
1832
1857
|
collectContainer(containerOptions: CollectContainerOptions): PayrailsCollectContainer;
|
|
1833
1858
|
googlePayButton(options: GooglePayButtonOptions): GooglePayButton;
|
|
1834
1859
|
isGooglePayAvailable(merchantInfo: google.payments.api.MerchantInfo): Promise<boolean>;
|