@payrails/web-sdk 5.39.1 → 5.39.2-RC.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/index.js +4 -4
- package/package.json +1 -1
- package/payrails.d.ts +114 -2
- package/payrails.js +4 -4
package/package.json
CHANGED
package/payrails.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ declare enum PAYMENT_METHOD_CODES {
|
|
|
89
89
|
'PAYPAL' = "payPal",
|
|
90
90
|
'APPLE_PAY' = "applePay",
|
|
91
91
|
'GENERIC_REDIRECT' = "genericRedirect",
|
|
92
|
+
'LEAN' = "lean",
|
|
92
93
|
'MERCADO_PAGO' = "mercadoPago",
|
|
93
94
|
'PIX' = "pix",
|
|
94
95
|
'BANK_ACCOUNT' = "bankAccount",
|
|
@@ -344,6 +345,12 @@ interface WorkflowExecutionResponse {
|
|
|
344
345
|
orderId?: string;
|
|
345
346
|
tokenId?: string;
|
|
346
347
|
};
|
|
348
|
+
paymentId?: string;
|
|
349
|
+
sdkToken?: string;
|
|
350
|
+
app_token?: string;
|
|
351
|
+
successUrl?: string;
|
|
352
|
+
failureUrl?: string;
|
|
353
|
+
sandbox?: boolean;
|
|
347
354
|
};
|
|
348
355
|
};
|
|
349
356
|
redirect?: string;
|
|
@@ -1364,6 +1371,7 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
|
|
|
1364
1371
|
update(options: Partial<Pick<CardFormOptions, 'styles' | 'translations' | 'events'>>): void;
|
|
1365
1372
|
updateInstallmentConfig(installmentConfig?: InstallmentUpdateConfig): void;
|
|
1366
1373
|
private createFormField;
|
|
1374
|
+
private isFieldRequired;
|
|
1367
1375
|
private initializeCustomLayout;
|
|
1368
1376
|
private hasFieldBeenUsed;
|
|
1369
1377
|
private initializeDefaultLayout;
|
|
@@ -1543,6 +1551,92 @@ declare class GooglePayButton extends PayrailsElementWithStoreInstrumentCheckbox
|
|
|
1543
1551
|
unmount(): void;
|
|
1544
1552
|
}
|
|
1545
1553
|
|
|
1554
|
+
interface LeanButtonOptions {
|
|
1555
|
+
id?: string;
|
|
1556
|
+
events?: PaymentEvents;
|
|
1557
|
+
translations?: {
|
|
1558
|
+
label?: string;
|
|
1559
|
+
};
|
|
1560
|
+
styles?: {
|
|
1561
|
+
button?: {
|
|
1562
|
+
base?: Partial<CSSStyleDeclaration>;
|
|
1563
|
+
loading?: Partial<CSSStyleDeclaration>;
|
|
1564
|
+
hover?: Partial<CSSStyleDeclaration>;
|
|
1565
|
+
};
|
|
1566
|
+
dialog?: LeanCustomization;
|
|
1567
|
+
};
|
|
1568
|
+
returnInfo?: ReturnInfo;
|
|
1569
|
+
}
|
|
1570
|
+
type LeanCallbackResponse = {
|
|
1571
|
+
status?: string;
|
|
1572
|
+
message?: string;
|
|
1573
|
+
last_api_response?: string;
|
|
1574
|
+
exit_point?: string;
|
|
1575
|
+
secondary_status?: string;
|
|
1576
|
+
bank?: {
|
|
1577
|
+
bank_identifier?: string;
|
|
1578
|
+
is_supported?: boolean;
|
|
1579
|
+
};
|
|
1580
|
+
};
|
|
1581
|
+
type LeanCheckoutPayload = {
|
|
1582
|
+
app_token: string;
|
|
1583
|
+
access_token: string;
|
|
1584
|
+
payment_intent_id: string;
|
|
1585
|
+
success_redirect_url: string;
|
|
1586
|
+
fail_redirect_url: string;
|
|
1587
|
+
sandbox?: boolean;
|
|
1588
|
+
bank_identifier?: string;
|
|
1589
|
+
customization?: LeanCustomizationPayload;
|
|
1590
|
+
callback: (response: LeanCallbackResponse) => void;
|
|
1591
|
+
};
|
|
1592
|
+
type LeanCustomization = {
|
|
1593
|
+
themeColor?: string;
|
|
1594
|
+
buttonTextColor?: string;
|
|
1595
|
+
buttonBorderRadius?: string;
|
|
1596
|
+
linkColor?: string;
|
|
1597
|
+
overlayColor?: string;
|
|
1598
|
+
};
|
|
1599
|
+
type LeanCustomizationPayload = {
|
|
1600
|
+
theme_color?: string;
|
|
1601
|
+
button_text_color?: string;
|
|
1602
|
+
button_border_radius?: string;
|
|
1603
|
+
link_color?: string;
|
|
1604
|
+
overlay_color?: string;
|
|
1605
|
+
};
|
|
1606
|
+
declare global {
|
|
1607
|
+
interface Window {
|
|
1608
|
+
Lean?: {
|
|
1609
|
+
checkout: (payload: LeanCheckoutPayload) => void;
|
|
1610
|
+
};
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
declare class LeanButton extends PayrailsElement {
|
|
1614
|
+
private static leanSdkClient;
|
|
1615
|
+
private readonly options;
|
|
1616
|
+
private isLoading;
|
|
1617
|
+
private readonly paymentExecutor;
|
|
1618
|
+
private readonly handleClick;
|
|
1619
|
+
private readonly handleMouseEnter;
|
|
1620
|
+
private readonly handleMouseLeave;
|
|
1621
|
+
private readonly handleSessionExpired;
|
|
1622
|
+
constructor(options: LeanButtonOptions);
|
|
1623
|
+
mount(location: string): void;
|
|
1624
|
+
unmount(): void;
|
|
1625
|
+
private static getLeanSDK;
|
|
1626
|
+
static resetLeanSDK(): void;
|
|
1627
|
+
private bindEvents;
|
|
1628
|
+
private unbindEvents;
|
|
1629
|
+
private setStyles;
|
|
1630
|
+
private removeStyles;
|
|
1631
|
+
private triggerLoading;
|
|
1632
|
+
private renderLoadingMarkup;
|
|
1633
|
+
private getConfirmActionParameters;
|
|
1634
|
+
private startLeanCheckout;
|
|
1635
|
+
private handleLeanCheckoutResponse;
|
|
1636
|
+
private toLeanCustomizationPayload;
|
|
1637
|
+
private onClick;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1546
1640
|
interface DropinElementEvents extends PaymentEvents {
|
|
1547
1641
|
onActivate?: () => void;
|
|
1548
1642
|
onDeactivate?: () => void;
|
|
@@ -1657,6 +1751,15 @@ interface GooglePayDropinOptions extends GooglePayButtonOptions {
|
|
|
1657
1751
|
events?: GooglePayButtonOptions['events'] & DropinElementEvents;
|
|
1658
1752
|
}
|
|
1659
1753
|
|
|
1754
|
+
interface LeanDropinOptions extends Omit<LeanButtonOptions, 'styles'> {
|
|
1755
|
+
paymentMethod: StorablePaymentCompositionOption;
|
|
1756
|
+
translations?: LeanButtonOptions['translations'];
|
|
1757
|
+
events?: LeanButtonOptions['events'] & DropinElementEvents;
|
|
1758
|
+
styles?: LeanButtonOptions['styles'];
|
|
1759
|
+
elementStyles?: DropinElementStyles;
|
|
1760
|
+
returnInfo?: ReturnInfo;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1660
1763
|
interface PaypalButtonOptions extends StoreInstrumentElementOptions {
|
|
1661
1764
|
events?: PaymentEvents & UIEvents & {
|
|
1662
1765
|
onPaypalAvailable?: () => void;
|
|
@@ -1732,6 +1835,7 @@ declare class Dropin extends PayrailsElement {
|
|
|
1732
1835
|
private applePay;
|
|
1733
1836
|
private cardForm;
|
|
1734
1837
|
private paypal;
|
|
1838
|
+
private lean;
|
|
1735
1839
|
private loadingScreen;
|
|
1736
1840
|
constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions);
|
|
1737
1841
|
private get returnInfo();
|
|
@@ -1745,6 +1849,7 @@ declare class Dropin extends PayrailsElement {
|
|
|
1745
1849
|
private createCreditCardButton;
|
|
1746
1850
|
private createGooglePayButton;
|
|
1747
1851
|
private createPayPalButton;
|
|
1852
|
+
private createLeanButton;
|
|
1748
1853
|
private createCardForm;
|
|
1749
1854
|
private createApplePayButton;
|
|
1750
1855
|
private createCardPaymentButton;
|
|
@@ -1763,6 +1868,7 @@ interface StorablePaymentMethodConfiguration extends StoreInstrumentElementOptio
|
|
|
1763
1868
|
showStoredInstruments?: boolean;
|
|
1764
1869
|
showPaymentMethodLogo?: boolean;
|
|
1765
1870
|
}
|
|
1871
|
+
type LeanPaymentMethodConfiguration = Omit<StorablePaymentMethodConfiguration, 'showPaymentMethodLogo'>;
|
|
1766
1872
|
interface DropinOptions {
|
|
1767
1873
|
paymentMethodsConfiguration?: {
|
|
1768
1874
|
[key: string]: any;
|
|
@@ -1784,6 +1890,7 @@ interface DropinOptions {
|
|
|
1784
1890
|
applePay?: {
|
|
1785
1891
|
clientDomain?: string;
|
|
1786
1892
|
} & StorablePaymentMethodConfiguration;
|
|
1893
|
+
lean?: LeanPaymentMethodConfiguration;
|
|
1787
1894
|
};
|
|
1788
1895
|
returnInfo?: ReturnInfo;
|
|
1789
1896
|
events?: PayrailsSDKEvents;
|
|
@@ -1801,6 +1908,7 @@ interface DropinOptions {
|
|
|
1801
1908
|
mercadoPago?: GenericRedirectDropinOptions['translations'];
|
|
1802
1909
|
addressSelector?: AddressSelectorElementOptions['translations'];
|
|
1803
1910
|
applePayButton?: ApplePayDropinOptions['translations'];
|
|
1911
|
+
leanButton?: LeanDropinOptions['translations'];
|
|
1804
1912
|
errorMessages?: {
|
|
1805
1913
|
[key in ERROR_RESULT]?: string;
|
|
1806
1914
|
};
|
|
@@ -1812,6 +1920,7 @@ interface DropinOptions {
|
|
|
1812
1920
|
googlePayButton?: GooglePayButtonOptions['styles'];
|
|
1813
1921
|
paypalButton?: PaypalDropinOptions['styles'];
|
|
1814
1922
|
applePayButton?: ApplePayButtonOptions['styles'];
|
|
1923
|
+
leanButton?: LeanButtonOptions['styles'];
|
|
1815
1924
|
cardForm?: CardFormOptions['styles'];
|
|
1816
1925
|
cardPaymentButton?: CardPaymentButtonOptions['styles'];
|
|
1817
1926
|
authSuccess?: Partial<CSSStyleDeclaration>;
|
|
@@ -1955,7 +2064,8 @@ interface PayPalScriptConfig {
|
|
|
1955
2064
|
declare enum ThirdPartySDK {
|
|
1956
2065
|
ApplePay = "https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",
|
|
1957
2066
|
GooglePay = "https://pay.google.com/gp/p/js/pay.js",
|
|
1958
|
-
PayPal = "paypal-sdk"
|
|
2067
|
+
PayPal = "paypal-sdk",
|
|
2068
|
+
Lean = "https://cdn.leantech.me/link/loader/prod/ae/latest/lean-link-loader.min.js"
|
|
1959
2069
|
}
|
|
1960
2070
|
|
|
1961
2071
|
interface QueryDefinition<T> {
|
|
@@ -1991,6 +2101,7 @@ declare class Payrails {
|
|
|
1991
2101
|
private __cardList;
|
|
1992
2102
|
private __cardPaymentButton;
|
|
1993
2103
|
private __paypalButton;
|
|
2104
|
+
private __leanButton;
|
|
1994
2105
|
private __genericRedirectButton;
|
|
1995
2106
|
private __dynamicElementForm;
|
|
1996
2107
|
private __dropin;
|
|
@@ -2018,6 +2129,7 @@ declare class Payrails {
|
|
|
2018
2129
|
getAvailablePaymentMethods(): PaymentMethodCode[];
|
|
2019
2130
|
paymentButton(options: CardPaymentButtonOptions): CardPaymentButton;
|
|
2020
2131
|
paypalButton(options?: PaypalButtonOptions): PaypalButton;
|
|
2132
|
+
leanButton(options: LeanButtonOptions): LeanButton;
|
|
2021
2133
|
genericRedirectButton(options: GenericRedirectButtonOptions): GenericRedirectButton;
|
|
2022
2134
|
dynamicElement(options: DynamicElementOptions): DynamicElementForm;
|
|
2023
2135
|
getSavedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
|
|
@@ -2133,4 +2245,4 @@ interface PayrailsClientOptions {
|
|
|
2133
2245
|
}
|
|
2134
2246
|
|
|
2135
2247
|
export { AuthorizationFailureReasons, ElementType, INTEGRATION_TYPE, PAYMENT_METHOD_CODES, Payrails, PayrailsCollectContainer, PayrailsEnvironment };
|
|
2136
|
-
export type { ApplePayButtonOptions, CardFormOptions, CardListOptions, CardPaymentButtonOptions, CollectContainerOptions, DropinOptions, ExecutionMeta, ExecutionMetaCustomer, ExecutionMetaKey, GenericRedirectButtonOptions, GooglePayButtonOptions, InitOptions, PaymentEvents, PaypalButtonOptions, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsSecureField, PayrailsSecureFieldEvent, ReturnInfo, SaveInstrumentResponse, WorkflowExecutionResponse };
|
|
2248
|
+
export type { ApplePayButtonOptions, CardFormOptions, CardListOptions, CardPaymentButtonOptions, CollectContainerOptions, DropinOptions, ExecutionMeta, ExecutionMetaCustomer, ExecutionMetaKey, GenericRedirectButtonOptions, GooglePayButtonOptions, InitOptions, LeanButtonOptions, PaymentEvents, PaypalButtonOptions, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsSecureField, PayrailsSecureFieldEvent, ReturnInfo, SaveInstrumentResponse, WorkflowExecutionResponse };
|