@payrails/web-sdk 5.44.0-RC.0 → 5.44.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 +6 -0
- package/index.js +4 -4
- package/index.mjs +4 -4
- package/package.json +2 -2
- package/payrails.d.ts +47 -13
- package/payrails.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payrails/web-sdk",
|
|
3
|
-
"version": "5.44.0
|
|
3
|
+
"version": "5.44.0",
|
|
4
4
|
"description": "SDK providing tokenization options on the client for merchants",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "payrails.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@payrails/fraud-sdk": "1.4.2",
|
|
12
|
-
"@payrails/web-cse": "1.2.
|
|
12
|
+
"@payrails/web-cse": "1.2.4",
|
|
13
13
|
"@rollup/plugin-html": "2.0.0",
|
|
14
14
|
"@types/applepayjs": "14.0.9",
|
|
15
15
|
"@types/googlepay": "0.7.5",
|
package/payrails.d.ts
CHANGED
|
@@ -1258,6 +1258,7 @@ declare class PaymentInstallmentsDropdown extends PayrailsElement {
|
|
|
1258
1258
|
private INSTALLMENT_STORAGE_KEY;
|
|
1259
1259
|
private installmentOptions;
|
|
1260
1260
|
constructor(options: PaymentInstallmentsElementOptions);
|
|
1261
|
+
private getDefaultInstallment;
|
|
1261
1262
|
private generateOptionsHTML;
|
|
1262
1263
|
private renderOptions;
|
|
1263
1264
|
updateOptions(installmentOptions: BaseInstallmentOption[]): void;
|
|
@@ -1627,6 +1628,15 @@ interface CrediCardDropinOptions {
|
|
|
1627
1628
|
} & CardFormOptions['translations'];
|
|
1628
1629
|
}
|
|
1629
1630
|
|
|
1631
|
+
type RevolutPayButtonTheme = 'dark' | 'light' | 'lightOutline';
|
|
1632
|
+
declare const REVOLUT_PAY_DEFAULT_THEME: RevolutPayButtonTheme;
|
|
1633
|
+
declare const REVOLUT_PAY_DEFAULT_LABEL = "Pay with Revolut Pay";
|
|
1634
|
+
interface RevolutPayStyles {
|
|
1635
|
+
theme?: RevolutPayButtonTheme;
|
|
1636
|
+
width?: string;
|
|
1637
|
+
borderRadius?: string;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1630
1640
|
interface ButtonOptions {
|
|
1631
1641
|
id: string;
|
|
1632
1642
|
events?: PayrailsSDKEvents & {
|
|
@@ -1642,7 +1652,7 @@ interface ButtonOptions {
|
|
|
1642
1652
|
};
|
|
1643
1653
|
}
|
|
1644
1654
|
interface GenericRedirectButtonOptions {
|
|
1645
|
-
styles?: ButtonOptions['styles'];
|
|
1655
|
+
styles?: ButtonOptions['styles'] | RevolutPayStyles;
|
|
1646
1656
|
translations?: {
|
|
1647
1657
|
label?: string;
|
|
1648
1658
|
};
|
|
@@ -1651,14 +1661,18 @@ interface GenericRedirectButtonOptions {
|
|
|
1651
1661
|
openInNewTab?: boolean;
|
|
1652
1662
|
returnInfo?: ReturnInfo;
|
|
1653
1663
|
}
|
|
1664
|
+
type NormalisedOptions = Omit<GenericRedirectButtonOptions, 'styles'> & {
|
|
1665
|
+
styles?: ButtonOptions['styles'];
|
|
1666
|
+
};
|
|
1654
1667
|
declare class GenericRedirectButton extends PayrailsElement {
|
|
1655
|
-
protected options: GenericRedirectButtonOptions;
|
|
1656
1668
|
private readonly returnInfo?;
|
|
1657
1669
|
private popup;
|
|
1658
1670
|
private readonly paymentExecutor;
|
|
1659
1671
|
private isDisabled;
|
|
1660
1672
|
private isLoading;
|
|
1661
|
-
|
|
1673
|
+
private readonly isRevolutPay;
|
|
1674
|
+
protected options: NormalisedOptions;
|
|
1675
|
+
constructor(rawOptions: GenericRedirectButtonOptions, returnInfo?: ReturnInfo | undefined);
|
|
1662
1676
|
private setStyles;
|
|
1663
1677
|
private removeStyles;
|
|
1664
1678
|
private triggerLoading;
|
|
@@ -1673,7 +1687,7 @@ declare class GenericRedirectButton extends PayrailsElement {
|
|
|
1673
1687
|
private updateTranslations;
|
|
1674
1688
|
private updateEvents;
|
|
1675
1689
|
update(options: {
|
|
1676
|
-
styles?: ButtonOptions['styles'];
|
|
1690
|
+
styles?: ButtonOptions['styles'] | RevolutPayStyles;
|
|
1677
1691
|
translations?: ButtonOptions['translations'];
|
|
1678
1692
|
events?: ButtonOptions['events'];
|
|
1679
1693
|
}): void;
|
|
@@ -1687,7 +1701,7 @@ interface GenericRedirectDropinOptions {
|
|
|
1687
1701
|
};
|
|
1688
1702
|
styles?: {
|
|
1689
1703
|
element?: DropinElementStyles;
|
|
1690
|
-
button: ButtonOptions['styles'];
|
|
1704
|
+
button: ButtonOptions['styles'] | RevolutPayStyles;
|
|
1691
1705
|
};
|
|
1692
1706
|
translations?: {
|
|
1693
1707
|
label?: string;
|
|
@@ -1829,6 +1843,7 @@ interface DropinOptions {
|
|
|
1829
1843
|
paymentMethodsConfiguration?: {
|
|
1830
1844
|
[key: string]: any;
|
|
1831
1845
|
mercadoPago?: GenericRedirectDropinOptions['config'];
|
|
1846
|
+
revolutPay?: GenericRedirectDropinOptions['config'];
|
|
1832
1847
|
preselectFirstPaymentOption?: boolean;
|
|
1833
1848
|
showPaymentMethodLogo?: boolean;
|
|
1834
1849
|
cards?: {
|
|
@@ -1862,6 +1877,7 @@ interface DropinOptions {
|
|
|
1862
1877
|
};
|
|
1863
1878
|
paypalButton?: PaypalDropinOptions['translations'];
|
|
1864
1879
|
mercadoPago?: GenericRedirectDropinOptions['translations'];
|
|
1880
|
+
revolutPay?: GenericRedirectDropinOptions['translations'];
|
|
1865
1881
|
addressSelector?: AddressSelectorElementOptions['translations'];
|
|
1866
1882
|
applePayButton?: ApplePayDropinOptions['translations'];
|
|
1867
1883
|
leanButton?: LeanDropinOptions['translations'];
|
|
@@ -1884,6 +1900,7 @@ interface DropinOptions {
|
|
|
1884
1900
|
loadingScreen?: LoadingScreenStyles;
|
|
1885
1901
|
addressSelector?: AddressSelectorElementOptions['styles'];
|
|
1886
1902
|
mercadoPago?: GenericRedirectDropinOptions['styles'];
|
|
1903
|
+
revolutPay?: GenericRedirectDropinOptions['styles'];
|
|
1887
1904
|
};
|
|
1888
1905
|
fonts?: FontDescriptor[];
|
|
1889
1906
|
configuration?: {
|
|
@@ -2001,8 +2018,31 @@ interface ApiConfig<TReq> {
|
|
|
2001
2018
|
body?: TReq;
|
|
2002
2019
|
}
|
|
2003
2020
|
|
|
2021
|
+
declare enum ThirdPartySDK {
|
|
2022
|
+
ApplePay = "https://applepay.cdn-apple.com/jsapi/v1.3.2/apple-pay-sdk.js",
|
|
2023
|
+
GooglePay = "https://pay.google.com/gp/p/js/pay.js",
|
|
2024
|
+
PayPal = "paypal-sdk",
|
|
2025
|
+
Lean = "https://cdn.leantech.me/link/loader/prod/ae/latest/lean-link-loader.min.js"
|
|
2026
|
+
}
|
|
2004
2027
|
declare class SdkLoader {
|
|
2005
2028
|
private static readonly scriptMap;
|
|
2029
|
+
/**
|
|
2030
|
+
* Per-SDK HTML attributes applied to dynamically injected script elements.
|
|
2031
|
+
*
|
|
2032
|
+
* Apple Pay: Pinned to semantic version v1.3.7 with an SRI integrity hash
|
|
2033
|
+
* so the browser rejects any tampered payload. `crossorigin` is required
|
|
2034
|
+
* for SRI enforcement (see https://applepaydemo.apple.com/).
|
|
2035
|
+
* When upgrading, fetch the new version, recompute the sha384 hash, and
|
|
2036
|
+
* update both the enum URL and the integrity value below.
|
|
2037
|
+
*
|
|
2038
|
+
* Google Pay: Google's `pay.js` build process does not produce stable
|
|
2039
|
+
* hashes so SRI cannot be used. `crossorigin` is deliberately NOT set:
|
|
2040
|
+
* adding it breaks pay.js loading because Google's CDN does not return
|
|
2041
|
+
* the matching CORS headers on that response. Full PCI DSS v4 isolation
|
|
2042
|
+
* requires loading pay.js inside a sandboxed iframe (see Google's
|
|
2043
|
+
* guidance on PCI DSS v4 compliance with sandboxed iframes).
|
|
2044
|
+
*/
|
|
2045
|
+
private static readonly sdkScriptAttributes;
|
|
2006
2046
|
static load<T = void>(sdk: ThirdPartySDK, params?: PayPalScriptConfig): Promise<T>;
|
|
2007
2047
|
static reset(): void;
|
|
2008
2048
|
static invalidate(sdk: ThirdPartySDK): void;
|
|
@@ -2024,12 +2064,6 @@ interface PayPalScriptConfig {
|
|
|
2024
2064
|
intent: 'tokenize' | 'capture' | 'authorize';
|
|
2025
2065
|
locale?: string;
|
|
2026
2066
|
}
|
|
2027
|
-
declare enum ThirdPartySDK {
|
|
2028
|
-
ApplePay = "https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",
|
|
2029
|
-
GooglePay = "https://pay.google.com/gp/p/js/pay.js",
|
|
2030
|
-
PayPal = "paypal-sdk",
|
|
2031
|
-
Lean = "https://cdn.leantech.me/link/loader/prod/ae/latest/lean-link-loader.min.js"
|
|
2032
|
-
}
|
|
2033
2067
|
|
|
2034
2068
|
interface QueryDefinition<T> {
|
|
2035
2069
|
path: string[];
|
|
@@ -2207,5 +2241,5 @@ interface PayrailsClientOptions {
|
|
|
2207
2241
|
};
|
|
2208
2242
|
}
|
|
2209
2243
|
|
|
2210
|
-
export { AuthorizationFailureReasons, ElementType, INTEGRATION_TYPE, PAYMENT_METHOD_CODES, Payrails, PayrailsCollectContainer, PayrailsEnvironment };
|
|
2211
|
-
export type { ApplePayButtonOptions, CardFormOptions, CardListOptions, CardPaymentButtonOptions, CollectContainerOptions, DropinOptions, ExecutionMeta, ExecutionMetaCustomer, ExecutionMetaKey, GenericRedirectButtonOptions, GooglePayButtonOptions, InitOptions, LeanButtonOptions, PaymentEvents, PaypalButtonOptions, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsSecureField, PayrailsSecureFieldEvent, ReturnInfo, SaveInstrumentResponse, StorablePaymentCompositionOption, WorkflowExecutionResponse };
|
|
2244
|
+
export { AuthorizationFailureReasons, ElementType, INTEGRATION_TYPE, PAYMENT_METHOD_CODES, Payrails, PayrailsCollectContainer, PayrailsEnvironment, REVOLUT_PAY_DEFAULT_LABEL, REVOLUT_PAY_DEFAULT_THEME };
|
|
2245
|
+
export type { ApplePayButtonOptions, CardFormOptions, CardListOptions, CardPaymentButtonOptions, CollectContainerOptions, DropinOptions, ExecutionMeta, ExecutionMetaCustomer, ExecutionMetaKey, GenericRedirectButtonOptions, GooglePayButtonOptions, InitOptions, LeanButtonOptions, PaymentEvents, PaypalButtonOptions, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsSecureField, PayrailsSecureFieldEvent, ReturnInfo, RevolutPayButtonTheme, RevolutPayStyles, SaveInstrumentResponse, StorablePaymentCompositionOption, WorkflowExecutionResponse };
|