@payrails/web-sdk 5.34.0 → 5.35.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payrails/web-sdk",
3
- "version": "5.34.0",
3
+ "version": "5.35.0",
4
4
  "description": "SDK providing tokenization options on the client for merchants",
5
5
  "main": "index.js",
6
6
  "types": "payrails.d.ts",
package/payrails.d.ts CHANGED
@@ -94,7 +94,10 @@ declare enum PAYMENT_METHOD_CODES {
94
94
  'MERCADO_PAGO' = "mercadoPago",
95
95
  'PIX' = "pix",
96
96
  'BANK_ACCOUNT' = "bankAccount",
97
- 'IDEAL' = "iDeal"
97
+ 'IDEAL' = "iDeal",
98
+ 'YAPE' = "yape",
99
+ 'UPI' = "upi",
100
+ 'KLARNA' = "klarna"
98
101
  }
99
102
  declare enum PAYMENT_INSTRUMENT_STATUS {
100
103
  'ENABLED' = "enabled",
@@ -1448,6 +1451,7 @@ interface GenericRedirectButtonOptions {
1448
1451
  events?: PaymentEvents;
1449
1452
  paymentMethod: BasePaymentMethodConfig;
1450
1453
  openInNewTab?: boolean;
1454
+ returnInfo?: ReturnInfo;
1451
1455
  }
1452
1456
  declare class GenericRedirectButton extends PayrailsElement {
1453
1457
  protected options: GenericRedirectButtonOptions;
@@ -1581,6 +1585,7 @@ declare class Dropin extends PayrailsElement {
1581
1585
  private paypal;
1582
1586
  private loadingScreen;
1583
1587
  constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions);
1588
+ private get returnInfo();
1584
1589
  private isHppIntegration;
1585
1590
  private createStoredInstrumentElement;
1586
1591
  private createInstallmentsDropdown;
@@ -1887,14 +1892,44 @@ interface ClientEvents {
1887
1892
  onClientInitialized?: (execution?: typeof WorkflowExecution) => void;
1888
1893
  onSessionExpired?: () => Promise<InitOptions>;
1889
1894
  }
1890
- interface PaymentEvents {
1895
+ declare enum PayrailsElementAction {
1896
+ AUTHORIZE = "AUTHORIZE",
1897
+ TOKENIZE = "TOKENIZE"
1898
+ }
1899
+ interface GenericElementActionEvents {
1900
+ onPending?: (action: PayrailsElementAction, e?: any) => void;
1901
+ onRequestStart?: (action: PayrailsElementAction) => Promise<boolean>;
1902
+ onSuccess?: (action: PayrailsElementAction, e?: any) => void;
1903
+ onFailed?: (action: PayrailsElementAction, e?: any) => void;
1904
+ onButtonClicked?: (action: PayrailsElementAction, e?: {
1905
+ bin?: string;
1906
+ }) => Promise<boolean>;
1907
+ }
1908
+ interface PaymentAuthorizeEvents {
1909
+ /**
1910
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onPending` instead.
1911
+ */
1912
+ onAuthorizePending?: (e?: any) => void;
1913
+ /**
1914
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onRequestStart` instead.
1915
+ */
1916
+ onAuthorizeRequestStart?: () => Promise<boolean>;
1917
+ /**
1918
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onSuccess` instead.
1919
+ */
1891
1920
  onAuthorizeSuccess?: (e?: any) => void;
1921
+ /**
1922
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onFailed` instead.
1923
+ */
1892
1924
  onAuthorizeFailed?: (e?: any) => void;
1893
- onAuthorizePending?: (e?: any) => void;
1925
+ }
1926
+ interface PaymentEvents extends PaymentAuthorizeEvents, GenericElementActionEvents {
1927
+ /**
1928
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onButtonClicked` instead.
1929
+ */
1894
1930
  onPaymentButtonClicked?: (e?: {
1895
1931
  bin?: string;
1896
1932
  }) => Promise<boolean>;
1897
- onAuthorizeRequestStart?: () => Promise<boolean>;
1898
1933
  onPaymentSessionExpired?: () => void;
1899
1934
  onThreeDSecureChallenge?: () => void;
1900
1935
  }
@@ -1985,4 +2020,4 @@ declare class ApplePayButton extends PayrailsElementWithStoreInstrumentCheckbox
1985
2020
  }
1986
2021
 
1987
2022
  export { AuthorizationFailureReasons, ElementType, INTEGRATION_TYPE, PAYMENT_METHOD_CODES, Payrails, PayrailsEnvironment };
1988
- export type { ApplePayButtonOptions, CardFormOptions, CardListOptions, CardPaymentButtonOptions, DropinOptions, GooglePayButtonOptions, InitOptions, PaymentEvents, PaypalButtonOptions, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsSecureField, PayrailsSecureFieldEvent, SaveInstrumentResponse, WorkflowExecutionResponse };
2023
+ export type { ApplePayButtonOptions, CardFormOptions, CardListOptions, CardPaymentButtonOptions, DropinOptions, GenericRedirectButtonOptions, GooglePayButtonOptions, InitOptions, PaymentEvents, PaypalButtonOptions, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsSecureField, PayrailsSecureFieldEvent, ReturnInfo, SaveInstrumentResponse, WorkflowExecutionResponse };