@payrails/web-sdk 5.27.0 → 5.28.1

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.27.0",
3
+ "version": "5.28.1",
4
4
  "description": "SDK providing tokenization options on the client for merchants",
5
5
  "main": "index.js",
6
6
  "types": "payrails.d.ts",
@@ -91,6 +91,7 @@
91
91
  overflow: hidden;
92
92
  border: 1px solid #888;
93
93
  border-radius: 4px;
94
+ position: relative;
94
95
  }
95
96
 
96
97
  #payrails-popup-background {
@@ -107,6 +108,41 @@
107
108
  align-content: center;
108
109
  }
109
110
 
111
+ #payrails-popup-cancel-button {
112
+ position: absolute;
113
+ top: 8px;
114
+ right: 8px;
115
+ width: 32px;
116
+ height: 32px;
117
+ background: none;
118
+ border: none;
119
+ cursor: pointer;
120
+ z-index: 1;
121
+ display: flex;
122
+ align-items: center;
123
+ justify-content: center;
124
+ border-radius: 50%;
125
+ transition: background-color 0.2s ease;
126
+ }
127
+
128
+ #payrails-popup-cancel-button::before,
129
+ #payrails-popup-cancel-button::after {
130
+ content: '';
131
+ position: absolute;
132
+ width: 14px;
133
+ height: 2px;
134
+ transition: background-color 0.2s ease;
135
+ background-color: #667da6;
136
+ }
137
+
138
+ #payrails-popup-cancel-button::before {
139
+ transform: rotate(45deg);
140
+ }
141
+
142
+ #payrails-popup-cancel-button::after {
143
+ transform: rotate(-45deg);
144
+ }
145
+
110
146
  #payrails-frame {
111
147
  border: 0;
112
148
  }
package/payrails.d.ts CHANGED
@@ -518,6 +518,7 @@ interface Mountable {
518
518
  }
519
519
  interface ElementOptions {
520
520
  id?: string;
521
+ dataTestId?: string;
521
522
  className?: string | string[];
522
523
  styles?: Partial<CSSStyleDeclaration>;
523
524
  }
@@ -525,8 +526,9 @@ declare class PayrailsElement implements Mountable {
525
526
  protected element: HTMLElement;
526
527
  protected subElements: Array<Mountable>;
527
528
  readonly id: string | undefined;
529
+ readonly dataTestId: string | undefined;
528
530
  protected eventBus: _payrails_iframe_event_bus.IframeEventBus;
529
- constructor(elementType: string, { id, className }?: ElementOptions);
531
+ constructor(elementType: string, { id, className, dataTestId }?: ElementOptions);
530
532
  get parentElement(): HTMLElement | null;
531
533
  get selector(): string;
532
534
  mount(location: string): void;
@@ -677,6 +679,7 @@ declare const regexes: {
677
679
  hipercard: RegExp;
678
680
  unionpay: RegExp;
679
681
  maestro: RegExp;
682
+ elo: RegExp;
680
683
  };
681
684
  type CardNetwork = keyof typeof regexes;
682
685
 
@@ -833,7 +836,7 @@ declare class CardForm extends PayrailsElementWithStoreInstrumentCheckbox {
833
836
  errors: string;
834
837
  }>;
835
838
  get isValid(): boolean;
836
- get cardNetwork(): "" | "visa" | "mastercard" | "amex" | "diners" | "discover" | "jcb" | "hipercard" | "unionpay" | "maestro";
839
+ get cardNetwork(): "" | "visa" | "mastercard" | "amex" | "diners" | "discover" | "jcb" | "hipercard" | "unionpay" | "maestro" | "elo";
837
840
  onChange(): void;
838
841
  private updateInstallments;
839
842
  private reset;
@@ -969,7 +972,8 @@ declare enum AuthorizationFailureReasons {
969
972
  VALIDATION_FAILED = "VALIDATION_FAILED",
970
973
  AUTHORIZATION_ERROR = "AUTHORIZATION_ERROR",
971
974
  AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
972
- UNKNOWN_ERROR = "UNKNOWN_ERROR"
975
+ UNKNOWN_ERROR = "UNKNOWN_ERROR",
976
+ USER_CANCELLED = "USER_CANCELLED"
973
977
  }
974
978
 
975
979
  interface AuthFailedMsgOptions {
@@ -1009,9 +1013,10 @@ interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
1009
1013
  }
1010
1014
  declare class GooglePayButton extends PayrailsElementWithStoreInstrumentCheckbox {
1011
1015
  protected options: GooglePayButtonOptions;
1012
- private static instance;
1013
1016
  private readonly paymentExecutor;
1014
1017
  private static googleSDKClient;
1018
+ private sdkLoadedCalled;
1019
+ private buttonElement;
1015
1020
  private static getSDKClient;
1016
1021
  static isGooglePayAvailable(allowedPaymentMethods: google.payments.api.IsReadyToPayPaymentMethodSpecification[], environment?: PayrailsEnvironment, merchantInfo?: google.payments.api.MerchantInfo): Promise<boolean>;
1017
1022
  constructor(options: GooglePayButtonOptions);
@@ -1227,6 +1232,7 @@ interface DropinOptions {
1227
1232
  [key: string]: any;
1228
1233
  mercadoPago?: GenericRedirectDropinOptions['config'];
1229
1234
  preselectFirstPaymentOption?: boolean;
1235
+ showPaymentMethodLogo?: boolean;
1230
1236
  cards?: {
1231
1237
  showCardHolderName?: boolean;
1232
1238
  showExistingCards?: boolean;