@payrails/web-sdk 5.25.3-RC.1 → 5.26.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.25.3-RC.1",
3
+ "version": "5.26.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
@@ -439,6 +439,7 @@ declare class CollectContainer extends Container {
439
439
  create: (input: CollectElementInput$1, options?: any) => CollectElement;
440
440
  validate: () => Promise<unknown>;
441
441
  collect: (options?: ICollectOptions$1) => Promise<unknown>;
442
+ reset(): void;
442
443
  unmount: () => void;
443
444
  }
444
445
 
@@ -480,6 +481,7 @@ declare class ComposableContainer extends Container {
480
481
  unmount: () => void;
481
482
  validate: () => Promise<unknown>;
482
483
  collect: (options?: ICollectOptions) => Promise<unknown>;
484
+ reset(): void;
483
485
  }
484
486
 
485
487
  declare enum ContainerType {
@@ -606,6 +608,7 @@ declare class PayrailsCollectContainer implements Mountable {
606
608
  unmount(): void;
607
609
  validate(): Promise<ValidateCardFormResult>;
608
610
  collect(): Promise<EncryptedCollectResult>;
611
+ reset(): void;
609
612
  private collectPayrailsData;
610
613
  tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
611
614
  private constructSaveInstrumentBody;
@@ -817,7 +820,9 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
817
820
  tokenize(opts: TokenizeOptions): Promise<SaveInstrumentResponse>;
818
821
  private createAddressSelector;
819
822
  show(): void;
820
- hide(): void;
823
+ hide(options?: {
824
+ reset?: boolean;
825
+ }): void;
821
826
  private triggerOnReady;
822
827
  private prepareLabelStyles;
823
828
  private prepareInputStyles;
@@ -829,6 +834,7 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
829
834
  get cardNetwork(): "" | "visa" | "mastercard" | "amex" | "diners" | "discover" | "jcb" | "hipercard" | "unionpay" | "maestro";
830
835
  onChange(): void;
831
836
  private updateInstallments;
837
+ private reset;
832
838
  collectValues(): Promise<{
833
839
  cardData: EncryptedCollectResult;
834
840
  storeInstrument: boolean;
@@ -889,6 +895,7 @@ declare global {
889
895
  };
890
896
  }
891
897
  }
898
+ type ERROR_RESULT = 'Unknown' | 'UnexpectedProviderResponse' | 'ProviderUnknownError' | 'ProviderConnectionError' | 'Timeout' | 'ProviderTimeout' | 'GenericRejection' | 'DuplicateOperation' | 'OperationNotAllowed' | 'NetworkTransactionReferenceRejected' | 'PayerCanceled' | 'LimitExceeded' | 'InstrumentNotAllowed' | 'InvalidInstrument' | 'InsufficientBalance' | 'BlockedInstrument' | 'ExpiredInstrument' | 'ValidationError' | 'ParamsError' | 'ProviderConfigError' | 'InvalidSignature' | 'InternalServerError' | 'AuthenticationError' | 'PaymentMethodNotSupported' | 'PayerAuthenticationRequired' | 'PayerAuthenticationFailed' | 'FraudRisk';
892
899
 
893
900
  interface CardPaymentButtonOptions {
894
901
  events?: PayrailsSDKEvents & {
@@ -1175,6 +1182,7 @@ declare class Dropin extends PayrailsElement {
1175
1182
  private onAuthorizeSuccess;
1176
1183
  private getElementEvents;
1177
1184
  private onAuthorizePending;
1185
+ private getErrorMessage;
1178
1186
  private onAuthorizeFailed;
1179
1187
  private isStoredInstrumentEnabled;
1180
1188
  private applyStyles;
@@ -1222,6 +1230,9 @@ interface DropinOptions {
1222
1230
  mercadoPago?: GenericRedirectDropinOptions['translations'];
1223
1231
  addressSelector?: AddressSelectorElementOptions['translations'];
1224
1232
  applePayButton?: ApplePayDropinOptions['translations'];
1233
+ errorMessages?: {
1234
+ [key in ERROR_RESULT]?: string;
1235
+ };
1225
1236
  };
1226
1237
  styles?: {
1227
1238
  [key: string]: any;