@payrails/web-sdk 5.35.0-RC.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.35.0-RC.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
@@ -1451,6 +1451,7 @@ interface GenericRedirectButtonOptions {
1451
1451
  events?: PaymentEvents;
1452
1452
  paymentMethod: BasePaymentMethodConfig;
1453
1453
  openInNewTab?: boolean;
1454
+ returnInfo?: ReturnInfo;
1454
1455
  }
1455
1456
  declare class GenericRedirectButton extends PayrailsElement {
1456
1457
  protected options: GenericRedirectButtonOptions;
@@ -1879,7 +1880,7 @@ declare class Payrails {
1879
1880
  getAvailablePaymentMethods(): PAYMENT_METHOD_CODES[];
1880
1881
  paymentButton(options: CardPaymentButtonOptions): CardPaymentButton;
1881
1882
  paypalButton(options?: PaypalButtonOptions): PaypalButton;
1882
- genericRedirectButton(options: GenericRedirectButtonOptions, returnInfo?: ReturnInfo): GenericRedirectButton;
1883
+ genericRedirectButton(options: GenericRedirectButtonOptions): GenericRedirectButton;
1883
1884
  dynamicElement(options: DynamicElementOptions): DynamicElementForm;
1884
1885
  getSavedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
1885
1886
  private logIntegrationMode;
@@ -1891,14 +1892,44 @@ interface ClientEvents {
1891
1892
  onClientInitialized?: (execution?: typeof WorkflowExecution) => void;
1892
1893
  onSessionExpired?: () => Promise<InitOptions>;
1893
1894
  }
1894
- 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
+ */
1895
1920
  onAuthorizeSuccess?: (e?: any) => void;
1921
+ /**
1922
+ * @deprecated Marked as deprecated and will be removed in future releases. Use `onFailed` instead.
1923
+ */
1896
1924
  onAuthorizeFailed?: (e?: any) => void;
1897
- 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
+ */
1898
1930
  onPaymentButtonClicked?: (e?: {
1899
1931
  bin?: string;
1900
1932
  }) => Promise<boolean>;
1901
- onAuthorizeRequestStart?: () => Promise<boolean>;
1902
1933
  onPaymentSessionExpired?: () => void;
1903
1934
  onThreeDSecureChallenge?: () => void;
1904
1935
  }