@payrails/web-sdk 5.1.0-RC.1 → 5.2.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.1.0-RC.1",
3
+ "version": "5.2.0",
4
4
  "description": "SDK providing tokenization options on the client for merchants",
5
5
  "main": "index.js",
6
6
  "types": "payrails.d.ts",
@@ -250,6 +250,11 @@
250
250
  align-items: center;
251
251
  }
252
252
 
253
+ .payrails-dropin-item .payrails-store-instrument-icon {
254
+ width: 24px;
255
+ margin-right: 7px;
256
+ }
257
+
253
258
  .payrails-dropin-item.payrails-store-instrument {
254
259
  display: block;
255
260
  margin-top: 20px !important;
package/payrails.d.ts CHANGED
@@ -167,6 +167,7 @@ interface StoredPaymentInstrument<T = CardMetadata | PayPalMetadata> {
167
167
  id: string;
168
168
  status: PAYMENT_INSTRUMENT_STATUS;
169
169
  paymentMethod: PAYMENT_METHOD_CODES;
170
+ displayName?: string;
170
171
  data?: T;
171
172
  }
172
173
  interface PayPalMetadata {
@@ -175,6 +176,7 @@ interface PayPalMetadata {
175
176
  interface CardMetadata {
176
177
  bin?: string;
177
178
  suffix?: string;
179
+ network?: string;
178
180
  }
179
181
 
180
182
  interface SaveInstrumentResponse {
@@ -723,12 +725,12 @@ declare class GooglePayButton extends PayrailsElementWithStoreInstrumentCheckbox
723
725
  constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: GooglePayButtonOptions);
724
726
  private sdkLoaded;
725
727
  private onLoadPaymentData;
726
- private onPaymentButtonClicked;
728
+ private authorize;
727
729
  mount(location: string): void;
728
730
  unmount(): void;
729
731
  }
730
732
 
731
- interface DropinElementEvents {
733
+ interface DropinElementEvents extends PaymentEvents {
732
734
  onActivate?: () => void;
733
735
  onDeactivate?: () => void;
734
736
  }
@@ -743,7 +745,7 @@ declare abstract class DropinElement extends PayrailsElement {
743
745
  protected isActive: boolean;
744
746
  input: HTMLInputElement;
745
747
  protected label: HTMLLabelElement;
746
- protected constructor(id: string, label: string, events?: DropinElementEvents | undefined, styles?: DropinElementStyles | undefined);
748
+ protected constructor(id: string, label: string, icon?: string, events?: DropinElementEvents | undefined, styles?: DropinElementStyles | undefined);
747
749
  get identifier(): string;
748
750
  deactivate(): void;
749
751
  protected applyBaseStyles(): void;
@@ -779,9 +781,9 @@ interface GenericRedirectDropinOptions {
779
781
  label?: string;
780
782
  button?: GenericRedirectButtonOptions['translations'];
781
783
  };
782
- events?: DropinElementEvents;
784
+ events?: DropinElementEvents & PaymentEvents;
783
785
  }
784
- declare class GenericRedirectDropin extends DropinElement {
786
+ declare class MercadoPagoDropin extends DropinElement {
785
787
  private sdkConfig;
786
788
  private execution;
787
789
  private readonly returnInfo?;
@@ -844,6 +846,7 @@ interface PaypalDropinOptions extends PaypalButtonOptions {
844
846
  };
845
847
  };
846
848
  styles?: PaypalButtonOptions['styles'] & DropinElementStyles;
849
+ events?: PaypalButtonOptions['events'] & DropinElementEvents;
847
850
  }
848
851
 
849
852
  declare class Dropin extends PayrailsElement {
@@ -858,10 +861,10 @@ declare class Dropin extends PayrailsElement {
858
861
  private applePay;
859
862
  private cardForm;
860
863
  private paypal;
861
- private genericRedirect;
864
+ private mercadoPago;
862
865
  constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions, execution: WorkflowExecution, sdkConfig: SdkConfiguration);
863
866
  private createStoredInstrumentElement;
864
- private createGenericRedirectButton;
867
+ private createMercadoPagoButton;
865
868
  private createCreditCardButton;
866
869
  private createGooglePayButton;
867
870
  private createPayPalButton;
@@ -869,6 +872,7 @@ declare class Dropin extends PayrailsElement {
869
872
  private createApplePayButton;
870
873
  private createCardPaymentButton;
871
874
  private onAuthorizeSuccess;
875
+ private getElementEvents;
872
876
  private onAuthorizeFailed;
873
877
  private isStoredInstrumentEnabled;
874
878
  private applyStyles;
@@ -901,7 +905,7 @@ interface DropinOptions {
901
905
  fail?: string;
902
906
  };
903
907
  paypalButton?: PaypalDropinOptions['translations'];
904
- genericRedirect?: GenericRedirectDropinOptions['translations'];
908
+ mercadoPago?: GenericRedirectDropinOptions['translations'];
905
909
  };
906
910
  styles?: {
907
911
  container?: {
@@ -913,7 +917,7 @@ interface DropinOptions {
913
917
  applePayButton?: ApplePayButtonOptions['styles'];
914
918
  cardForm?: CardFormOptions['styles'];
915
919
  cardPaymentButton?: CardPaymentButtonOptions['styles'];
916
- genericRedirect?: GenericRedirectDropin['styles'];
920
+ mercadoPago?: MercadoPagoDropin['styles'];
917
921
  };
918
922
  }
919
923