@payrails/web-sdk 5.45.0-RC.5 → 5.46.0-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payrails/web-sdk",
3
- "version": "5.45.0-RC.5",
3
+ "version": "5.46.0-RC.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
@@ -2079,6 +2079,30 @@ interface PayPalScriptConfig {
2079
2079
  locale?: string;
2080
2080
  }
2081
2081
 
2082
+ interface PaymentAttemptContext {
2083
+ readonly executionId: string;
2084
+ readonly paymentMethodCode: PaymentMethodCode;
2085
+ }
2086
+ declare enum ACTION_REQUIRED_KIND {
2087
+ GENERIC_REDIRECT = "genericRedirect",
2088
+ THREE_DS = "3ds"
2089
+ }
2090
+ type ActionRequiredKind = `${ACTION_REQUIRED_KIND}`;
2091
+ interface ActionRequiredEvent extends PaymentAttemptContext {
2092
+ readonly url: string;
2093
+ readonly kind: ActionRequiredKind;
2094
+ /**
2095
+ * Call to take over the action. The SDK will not perform its default
2096
+ * behavior (navigate, mount the 3DS popup).
2097
+ */
2098
+ preventDefault(): void;
2099
+ }
2100
+ type PayrailsEvents = {
2101
+ actionRequired: ActionRequiredEvent;
2102
+ };
2103
+ type PayrailsEventName = keyof PayrailsEvents;
2104
+ type PayrailsEventHandler<K extends PayrailsEventName> = (event: PayrailsEvents[K]) => void | Promise<void>;
2105
+
2082
2106
  interface QueryDefinition<T> {
2083
2107
  path: string[];
2084
2108
  returnType: T;
@@ -2147,6 +2171,8 @@ declare class Payrails {
2147
2171
  private logIntegrationMode;
2148
2172
  private constructor();
2149
2173
  private getContainerLayout;
2174
+ on<K extends PayrailsEventName>(name: K, handler: PayrailsEventHandler<K>): () => void;
2175
+ off<K extends PayrailsEventName>(name: K, handler: PayrailsEventHandler<K>): void;
2150
2176
  binLookup(): Promise<any>;
2151
2177
  }
2152
2178
  interface ClientEvents {
@@ -2272,5 +2298,5 @@ interface PayrailsClientOptions {
2272
2298
  };
2273
2299
  }
2274
2300
 
2275
- export { AuthorizationFailureReasons, ElementType, INTEGRATION_TYPE, PAYMENT_METHOD_CODES, Payrails, PayrailsCollectContainer, PayrailsEnvironment, REVOLUT_PAY_DEFAULT_LABEL, REVOLUT_PAY_DEFAULT_THEME };
2276
- 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 };
2301
+ export { ACTION_REQUIRED_KIND, AuthorizationFailureReasons, ElementType, INTEGRATION_TYPE, PAYMENT_METHOD_CODES, Payrails, PayrailsCollectContainer, PayrailsEnvironment, REVOLUT_PAY_DEFAULT_LABEL, REVOLUT_PAY_DEFAULT_THEME };
2302
+ export type { ActionRequiredEvent, ActionRequiredKind, ApplePayButtonOptions, CardFormOptions, CardListOptions, CardPaymentButtonOptions, CollectContainerOptions, DropinOptions, ExecutionMeta, ExecutionMetaCustomer, ExecutionMetaKey, GenericRedirectButtonOptions, GooglePayButtonOptions, InitOptions, LeanButtonOptions, PaymentAttemptContext, PaymentEvents, PaypalButtonOptions, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsEventHandler, PayrailsEventName, PayrailsEvents, PayrailsSecureField, PayrailsSecureFieldEvent, ReturnInfo, RevolutPayButtonTheme, RevolutPayStyles, SaveInstrumentResponse, StorablePaymentCompositionOption, WorkflowExecutionResponse };