@payrails/web-sdk 5.8.2 → 5.8.3

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.8.2",
3
+ "version": "5.8.3",
4
4
  "description": "SDK providing tokenization options on the client for merchants",
5
5
  "main": "index.js",
6
6
  "types": "payrails.d.ts",
@@ -172,6 +172,7 @@
172
172
  #payrails-dropin-component {
173
173
  border-radius: 0;
174
174
  box-shadow: none;
175
+ box-sizing: border-box;
175
176
  background-color: rgba(246, 247, 248, 1);
176
177
 
177
178
  display: flex;
@@ -189,6 +190,7 @@
189
190
  transition: border 500ms ease-out;
190
191
  width: 100%;
191
192
  border: 1px solid rgb(223, 224, 225);
193
+ box-sizing: border-box;
192
194
  }
193
195
 
194
196
  .payrails-dropin-item:hover {
package/payrails.d.ts CHANGED
@@ -132,14 +132,19 @@ interface WorkflowExecutionResponse {
132
132
  version: number;
133
133
  };
134
134
  }
135
- interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C = undefined | ApplePayConfig | PayPalConfig | GooglePayConfig> {
136
- paymentMethodCode?: PAYMENT_METHOD_CODES;
137
- description: string;
135
+ interface BasePaymentMethodConfig {
136
+ paymentMethodCode: PAYMENT_METHOD_CODES;
137
+ }
138
+ interface StorablePaymentCompositionOption<I = CardMetadata | PayPalMetadata, C = undefined | ApplePayConfig | PayPalConfig | GooglePayConfig> extends BasePaymentMethodConfig {
138
139
  id: string;
140
+ description?: string;
139
141
  status: PAYMENT_INSTRUMENT_STATUS;
142
+ integrationType: INTEGRATION_TYPE;
140
143
  config: C;
144
+ clientConfig?: {
145
+ flow?: PAYMENT_CLIENT_FLOW;
146
+ };
141
147
  paymentInstruments?: Array<StoredPaymentInstrument<I>>;
142
- integrationType: string;
143
148
  }
144
149
  interface GooglePayConfig {
145
150
  parameters: {
@@ -177,6 +182,14 @@ interface CardMetadata {
177
182
  bin?: string;
178
183
  suffix?: string;
179
184
  network?: string;
185
+ }
186
+ declare enum PAYMENT_CLIENT_FLOW {
187
+ 'REDIRECT' = "redirect",
188
+ 'DIRECT' = "direct"
189
+ }
190
+ declare enum INTEGRATION_TYPE {
191
+ API = "api",
192
+ HPP = "hpp"
180
193
  }
181
194
 
182
195
  interface SaveInstrumentResponse {
@@ -662,21 +675,6 @@ declare enum AuthorizationFailureReasons {
662
675
  UNKNOWN_ERROR = "UNKNOWN_ERROR"
663
676
  }
664
677
 
665
- interface ButtonOptions {
666
- id: string;
667
- events?: PayrailsSDKEvents & {
668
- onClick?: () => Promise<void>;
669
- };
670
- translations: {
671
- label: string;
672
- };
673
- styles?: {
674
- base?: Partial<CSSStyleDeclaration>;
675
- loading?: Partial<CSSStyleDeclaration>;
676
- hover?: Partial<CSSStyleDeclaration>;
677
- };
678
- }
679
-
680
678
  interface GooglePayButtonOptions extends StoreInstrumentElementOptions {
681
679
  environment?: PayrailsEnvironment;
682
680
  merchantInfo?: google.payments.api.MerchantInfo;
@@ -717,15 +715,32 @@ interface DropinElementStyles {
717
715
  active?: Partial<CSSStyleDeclaration>;
718
716
  }
719
717
 
718
+ interface ButtonOptions {
719
+ id: string;
720
+ events?: PayrailsSDKEvents & {
721
+ onClick?: () => Promise<void>;
722
+ };
723
+ translations: {
724
+ label: string;
725
+ };
726
+ styles?: {
727
+ base?: Partial<CSSStyleDeclaration>;
728
+ loading?: Partial<CSSStyleDeclaration>;
729
+ hover?: Partial<CSSStyleDeclaration>;
730
+ };
731
+ }
732
+
720
733
  interface GenericRedirectButtonOptions {
721
734
  styles?: ButtonOptions['styles'];
722
735
  translations?: {
723
736
  label?: string;
724
737
  };
725
738
  events?: PaymentEvents;
739
+ paymentMethod: BasePaymentMethodConfig;
726
740
  }
727
741
  declare class GenericRedirectButton extends PayrailsElement {
728
742
  private sdkConfig;
743
+ private execution;
729
744
  protected options: GenericRedirectButtonOptions;
730
745
  private readonly returnInfo?;
731
746
  constructor(sdkConfig: SdkConfiguration, execution: WorkflowExecution, options: GenericRedirectButtonOptions, returnInfo?: ReturnInfo | undefined);
@@ -735,9 +750,10 @@ declare class GenericRedirectButton extends PayrailsElement {
735
750
  }
736
751
 
737
752
  interface GenericRedirectDropinOptions {
753
+ paymentMethod: StorablePaymentCompositionOption;
738
754
  styles?: {
739
755
  element?: DropinElementStyles;
740
- mercadoPago?: ButtonOptions['styles'];
756
+ button: ButtonOptions['styles'];
741
757
  };
742
758
  translations?: {
743
759
  label?: string;
@@ -816,10 +832,10 @@ declare class Dropin extends PayrailsElement {
816
832
  private applePay;
817
833
  private cardForm;
818
834
  private paypal;
819
- private mercadoPago;
820
835
  constructor(collectContainer: PayrailsCollectContainer, clientConfig: PayrailsClientOptions, dropinConfig: DropinOptions, execution: WorkflowExecution, sdkConfig: SdkConfiguration);
836
+ private isHppIntegration;
821
837
  private createStoredInstrumentElement;
822
- private createMercadoPagoButton;
838
+ private createHppIntegrationElement;
823
839
  private get totalPaymentOptions();
824
840
  private createCreditCardButton;
825
841
  private createGooglePayButton;
@@ -854,6 +870,7 @@ interface DropinOptions {
854
870
  returnInfo?: ReturnInfo;
855
871
  events?: PayrailsSDKEvents;
856
872
  translations?: {
873
+ [key: string]: any;
857
874
  googlePayButton?: GooglePayDropinOptions['translations'];
858
875
  cardPaymentButton?: CardPaymentButtonOptions['translations'];
859
876
  cardForm?: CardFormOptions['translations'];
@@ -865,19 +882,21 @@ interface DropinOptions {
865
882
  mercadoPago?: GenericRedirectDropinOptions['translations'];
866
883
  };
867
884
  styles?: {
868
- container?: {
869
- styles?: Partial<CSSStyleDeclaration>;
870
- };
885
+ [key: string]: any;
886
+ container?: ContainerStyles;
871
887
  element?: DropinElementStyles;
872
888
  googlePayButton?: GooglePayButtonOptions['styles'];
873
889
  paypalButton?: PaypalDropinOptions['styles'];
874
890
  applePayButton?: ApplePayButtonOptions['styles'];
875
891
  cardForm?: CardFormOptions['styles'];
876
892
  cardPaymentButton?: CardPaymentButtonOptions['styles'];
877
- mercadoPago?: ButtonOptions['styles'];
878
893
  authSuccess?: Partial<CSSStyleDeclaration>;
879
894
  authFailed?: Partial<CSSStyleDeclaration>;
895
+ mercadoPago?: GenericRedirectDropinOptions['styles'];
880
896
  };
897
+ }
898
+ interface ContainerStyles {
899
+ styles?: Partial<CSSStyleDeclaration>;
881
900
  }
882
901
 
883
902
  declare class SdkLoader {
@@ -961,7 +980,7 @@ declare class Payrails {
961
980
  getAvailablePaymentMethods(): PAYMENT_METHOD_CODES[];
962
981
  paymentButton(options: CardPaymentButtonOptions): CardPaymentButton;
963
982
  paypalButton(options?: PaypalButtonOptions): PaypalButton;
964
- genericRedirectButton(options?: GenericRedirectButtonOptions): GenericRedirectButton;
983
+ genericRedirectButton(options: GenericRedirectButtonOptions): GenericRedirectButton;
965
984
  getSavedPaypalAccounts(): StoredPaymentInstrument<PayPalMetadata>[];
966
985
  fraudNet(pageId: FraudNetPageId): FraudNet;
967
986
  private get safeExecution();
@@ -1103,4 +1122,4 @@ interface TokenizeOptions {
1103
1122
  storeInstrument?: boolean;
1104
1123
  }
1105
1124
 
1106
- export { ApplePayButtonOptions, AuthorizationFailureReasons, CardFormOptions, CardListOptions, CardPaymentButtonOptions, DropinOptions, ElementType, GooglePayButtonOptions, InitOptions, PaymentEvents, PaypalButtonOptions, Payrails, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsEnvironment, PayrailsSecureField, PayrailsSecureFieldEvent, SaveInstrumentResponse, WorkflowExecutionResponse };
1125
+ export { ApplePayButtonOptions, AuthorizationFailureReasons, CardFormOptions, CardListOptions, CardPaymentButtonOptions, DropinOptions, ElementType, GooglePayButtonOptions, INTEGRATION_TYPE, InitOptions, PAYMENT_METHOD_CODES, PaymentEvents, PaypalButtonOptions, Payrails, PayrailsAmount, PayrailsClientOptions, PayrailsContainerType, PayrailsEnvironment, PayrailsSecureField, PayrailsSecureFieldEvent, SaveInstrumentResponse, WorkflowExecutionResponse };