New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mercadopago/sdk-react

Package Overview
Dependencies
Maintainers
11
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mercadopago/sdk-react - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

6

bricks/cardPayment/index.d.ts

@@ -1,2 +0,2 @@

/// <reference types="react" />
import React from 'react';
import { TCardPayment } from './type';

@@ -25,5 +25,5 @@ import { UpdateValues } from '../util/types/common';

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/card-payment-brick/introduction Card Payment Brick documentation} for more information.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/card-payment-brick/introduction Card Payment Brick documentation} for more information.
*/
declare const CardPayment: ({ onReady, onError, onSubmit, onBinChange, initialization, customization, locale, }: TCardPayment) => JSX.Element;
declare const CardPayment: ({ onReady, onError, onSubmit, onBinChange, initialization, customization, locale, }: TCardPayment) => React.JSX.Element;
declare const useCardPaymentBrick: () => {

@@ -30,0 +30,0 @@ update: (updateValues: UpdateValues) => void;

@@ -26,3 +26,3 @@ import React, { useEffect } from 'react';

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/card-payment-brick/introduction Card Payment Brick documentation} for more information.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/card-payment-brick/introduction Card Payment Brick documentation} for more information.
*/

@@ -29,0 +29,0 @@ const CardPayment = ({ onReady = onReadyDefault, onError = onErrorDefault, onSubmit = onSubmitDefault, onBinChange = onBinChangeDefault, initialization, customization, locale, }) => {

@@ -10,3 +10,3 @@ import { IBrickError, IPayerIdentification } from '../util/types/common';

/**
* Non-optional. Function. Receives function to send the payment to backend
* Required. Function. Receives function to send the payment to backend
*

@@ -39,11 +39,11 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/card-payment-brick/default-rendering Card Payment Brick # Default rendering} documentation.

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language General Customization # Select Language} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language General Customization # Select Language} documentation.
*/
locale?: 'es-AR' | 'es-CL' | 'es-CO' | 'es-MX' | 'es-VE' | 'es-UY' | 'es-PE' | 'pt-BR' | 'en-US';
/**
* Non-optional. Object. At minimun receive the amount atribute.
* Required. Object. At minimun receive the amount atribute.
*/
initialization: {
/**
* Non-optional. Number. Receives the value to be payed.
* Required. Number. Receives the value to be payed.
*/

@@ -171,2 +171,14 @@ amount: number;

bin: string;
/**
* Required. Last four digits of card entered by user.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
lastFourDigits: string;
/**
* Optional. Cardholder name of card entered by user.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
cardholderName?: string;
}

@@ -173,0 +185,0 @@ /**

@@ -1,2 +0,2 @@

/// <reference types="react" />
import React from 'react';
import { TPaymentType } from './type';

@@ -25,5 +25,5 @@ import { UpdateValues } from '../util/types/common';

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/introduction Payment Brick documentation} for more information.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/introduction Payment Brick documentation} for more information.
*/
declare const Payment: ({ onReady, onError, onSubmit, onBinChange, initialization, customization, locale, }: TPaymentType) => JSX.Element;
declare const Payment: ({ onReady, onError, onSubmit, onBinChange, onClickEditShippingData, onClickEditBillingData, onRenderNextStep, onRenderPreviousStep, initialization, customization, locale, }: TPaymentType) => React.JSX.Element;
declare const usePaymentBrick: () => {

@@ -30,0 +30,0 @@ update: (updateValues: UpdateValues) => void;

import React, { useEffect } from 'react';
import { DEBOUNCE_TIME_RENDER } from '../util/constants';
import { onBinChangeDefault, onErrorDefault, onReadyDefault, onSubmitDefault, } from '../util/initial';
import { onBinChangeDefault, onClickEditBillingDataDefault, onClickEditShippingDataDefault, onErrorDefault, onReadyDefault, onRenderNextStepDefault, onRenderPreviousStepDefault, onSubmitDefault, } from '../util/initial';
import { initBrick } from '../util/renderBrick';

@@ -26,5 +26,5 @@ /**

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/introduction Payment Brick documentation} for more information.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/introduction Payment Brick documentation} for more information.
*/
const Payment = ({ onReady = onReadyDefault, onError = onErrorDefault, onSubmit = onSubmitDefault, onBinChange = onBinChangeDefault, initialization, customization, locale, }) => {
const Payment = ({ onReady = onReadyDefault, onError = onErrorDefault, onSubmit = onSubmitDefault, onBinChange = onBinChangeDefault, onClickEditShippingData = onClickEditShippingDataDefault, onClickEditBillingData = onClickEditBillingDataDefault, onRenderNextStep = onRenderNextStepDefault, onRenderPreviousStep = onRenderPreviousStepDefault, initialization, customization, locale, }) => {
useEffect(() => {

@@ -43,2 +43,6 @@ // Payment uses a debounce to prevent unnecessary reRenders.

onBinChange,
onClickEditShippingData,
onClickEditBillingData,
onRenderNextStep,
onRenderPreviousStep,
},

@@ -45,0 +49,0 @@ },

@@ -10,8 +10,12 @@ import { ICardPaymentBrickPayer, ICardPaymentBrickVisual, ICardPaymentFormData } from '../cardPayment/type';

export type TPaymentType = {
onSubmit: (param: IPaymentFormData, param2?: IAdditionalData) => Promise<unknown>;
onSubmit: (param: IPaymentFormData, param2?: IAdditionalCardFormData | null) => Promise<unknown>;
onReady?: () => void;
onError?: (param: IBrickError) => void;
onBinChange?: (param: string) => void;
onClickEditShippingData?: () => void;
onClickEditBillingData?: () => void;
onRenderNextStep?: (currentStep: string) => void;
onRenderPreviousStep?: (currentStep: string) => void;
/**
* Non-optional. Object containing initialization options.
* Required. Object containing initialization options.
*

@@ -22,3 +26,3 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/default-rendering Payment Brick # Default rendering} documentation.

/**
* Non-optional. Total amount to be paid by all means of payment with exception of Mercado Pago Wallet, which has its processing value determined in backend through the "preferenceId".
* Required. Total amount to be paid by all means of payment with exception of Mercado Pago Wallet, which has its processing value determined in backend through the "preferenceId".
*

@@ -37,8 +41,38 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/default-rendering Payment Brick # Default rendering} documentation.

*
* @tutorial {@link https://www.mercadopago.com/developers/en/reference/preferences/_checkout_preferences/post Create preference} documentation.
* @see {@link https://www.mercadopago.com/developers/en/reference/preferences/_checkout_preferences/post Create preference} documentation.
*/
preferenceId?: string;
/**
* Optional. Required only for review step. Defines the ordered items.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization} documentation.
*/
items?: IReviewConfirmItems;
/**
* Optional. Defines shipping data for review step.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization} documentation.
*/
shipping?: IReviewConfirmShipping;
/**
* Optional. Defines billing data for review step.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization} documentation.
*/
billing?: IReviewConfirmBilling;
/**
* Optional. Defines applied discounts data for review step.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization} documentation.
*/
discounts?: IReviewConfirmDiscounts;
/**
* Optional. This parameter enables the use of Wallet Brick in Marketplace mode
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/payment-submission/wallet-credits Mercado Pago Wallet and Installments without card} documentation.
*/
marketplace?: boolean;
};
/**
* Non-optional. An object containing customization brick options.
* Required. An object containing customization brick options.
*

@@ -52,10 +86,190 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/default-rendering Payment Brick # Default rendering} documentation.

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language General Customizations # Select Language} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language General Customizations # Select Language} documentation.
*/
locale?: string;
};
interface IPaymentFormData {
export interface IReviewConfirmItems {
/**
* Non-optional. Payment type returned at onSubmit.
* Required. Sum of the values of all ordered items.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization} documentation.
*/
totalItemsAmount: number;
/**
* Required. Array with the ordered items.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization} documentation.
*/
itemsList: IListItems[];
}
export interface IListItems {
/**
* Required. Quantity of a given item.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Items} documentation.
*/
units: number;
/**
* Required. Value per a given item.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Items} documentation.
*/
value: number;
/**
* Required. Item name.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Items} documentation.
*/
name: string;
/**
* Optional. Item description.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Items} documentation.
*/
description?: string;
/**
* Optional. Item image.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Items} documentation.
*/
imageURL?: string;
}
export interface IReviewConfirmShipping {
/**
* Optional. The shipping cost.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Shipping} documentation.
*/
costs?: number;
/**
* Required. The type of shipping.
*
* @example shippingMode: 'Express'
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Shipping} documentation.
*/
shippingMode: string;
/**
* Optional. Shipping description.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Shipping} documentation.
*/
description?: string;
/**
* Required. Shipping address.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Shipping} documentation.
*/
receiverAddress: IDefaultAddress;
}
export interface IDefaultAddress {
/**
* Required. Payer street name that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
streetName: string;
/**
* Required. Payer street number that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
streetNumber: string;
/**
* Optional. Payer neighborhood that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
neighborhood?: string;
/**
* Optional. Payer city that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
city?: string;
/**
* Optional. Payer state address that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
federalUnit?: string;
/**
* Required. Payer zip code that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
zipCode: string;
}
export interface IReviewConfirmBilling {
/**
* Optional. The first name under which the payment should be issued.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Billing} documentation.
*/
firstName?: string;
/**
* Optional. The last name under which the payment should be issued.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Billing} documentation.
*/
lastName?: string;
/**
* Optional. The tax regime.
*
* @example taxRegime?: 'Simplified Trust Regime'
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Billing} documentation.
*/
taxRegime?: string;
/**
* Required. The tax identification number.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Billing} documentation.
*/
taxIdentificationNumber: string;
/**
* Optional. Defines payer identification.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Billing} documentation.
*/
identification?: IPayerIdentification;
/**
* Optional. The payer's address under which the payment should be issued.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Billing} documentation.
*/
billingAddress?: IDefaultAddress;
}
export interface IReviewConfirmDiscounts {
/**
* Required. Sum of the values of all applied discounts .
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Discounts} documentation.
*/
totalDiscountsAmount: number;
/**
* Required. The payer's address under which the payment should be issued.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Discounts} documentation.
*/
discountsList: IDiscountsList[];
}
export interface IDiscountsList {
/**
* Required. Discount name.
*
* @example name: 'BLACKFRIDAY10'
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Discounts} documentation.
*/
name: string;
/**
* Required. Discount value.
*
* @example value: 10
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#initialization Initialization Discounts} documentation.
*/
value: number;
}
export interface IPaymentFormData {
/**
* Required. Payment type returned at onSubmit.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/payment-submission/other-payment-methods/brasil Returned data} documentation.

@@ -65,3 +279,3 @@ */

/**
* Non-optional. Selected payment method returned at onSubmit.
* Required. Selected payment method returned at onSubmit.
*

@@ -72,7 +286,7 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/payment-submission/other-payment-methods/brasil Returned data} documentation.

/**
* Non-optional. Information returned at onSubmit.
* Required. Information returned at onSubmit.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/payment-submission/other-payment-methods/brasil Returned data} documentation.
*/
formData: ICardPaymentFormData<ICardPaymentBrickPayer> & ICardPaymentFormData<ISavedCardPayer> & TicketFormData;
formData: ICardPaymentFormData<ICardPaymentBrickPayer> & ICardPaymentFormData<ISavedCardPayer> & TicketFormData & IFormDataAdditionalInfo;
/**

@@ -83,7 +297,7 @@ * Optional. Bin of the card entered by the user.

*/
additionalData?: IAdditionalData;
additionalData?: IAdditionalData | IAdditionalCardFormData;
}
interface ISavedCardPayer {
export interface ISavedCardPayer {
/**
* Non-optional. Saved cards type.
* Required. Saved cards type.
*

@@ -94,3 +308,3 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/customers-cards Payment Brick # Additional Settings # Include Saved Cards} documentation.

/**
* Non-optional. Saved cards id.
* Required. Saved cards id.
*

@@ -101,7 +315,9 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/customers-cards Payment Brick # Additional Settings # Include Saved Cards} documentation.

}
interface TransactionDetails {
/** Non-option. Financial institution */
export interface TransactionDetails {
/**
* Required. Financial institution.
*/
financial_institution: string;
}
interface Metadata {
export interface Metadata {
/**

@@ -116,5 +332,5 @@ * Optional. Payment point is useful to show the buyer where to pay.

}
interface TicketFormData {
export interface TicketFormData {
/**
* Non-optional. Ticket transaction amount.
* Required. Ticket transaction amount.
*

@@ -125,3 +341,3 @@ * @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/payment.md Data customization} documentation.

/**
* Non-optional. Ticket payment method id.
* Required. Ticket payment method id.
*

@@ -132,3 +348,3 @@ * @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/payment.md Data customization} documentation.

/**
* Non-optional. Ticket payer data.
* Required. Ticket payer data.
*

@@ -149,4 +365,96 @@ * @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/payment.md Data customization} documentation.

}
interface IPaymentBrickCustomization {
export type IFormDataAdditionalInfo = {
/**
* Optional. Additional information returned at onSubmit.
*
*/
additional_info?: IAdditionalInfo;
};
export interface IAdditionalInfo {
/**
* Optional. Items information returned at onSubmit.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
items?: IAdditionalInfoItems[];
/**
* Optional. Shipments information returned at onSubmit.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
shipments?: IAdditionalInfoShipments;
}
export interface IAdditionalInfoItems {
/**
* Required. Item price returned at onSubmit.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
unit_price: number;
/**
* Required. Item quantity returned at onSubmit.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
quantity: number;
/**
* Required. Item title returned at onSubmit.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
title: string;
/**
* Optional. Item description returned at onSubmit.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
description?: string;
/**
* Optional. Item url image returned at onSubmit.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
picture_url?: string;
}
export interface IAdditionalInfoShipments {
/**
* Required. Receiver address returned at onSubmit.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#callbacks Callbacks} documentation.
*/
receiver_address: {
/**
* Required. Zip code returned at onSubmit.
*
*/
zip_code?: string;
/**
* Optional. State name returned at onSubmit.
*
*/
state_name?: string;
/**
* Optional. City name returned at onSubmit.
*
*/
city_name?: string;
/**
* Required. Street name returned at onSubmit.
*
*/
street_name?: string;
/**
* Required. Street number returned at onSubmit.
*
*/
street_number?: number;
/**
* Optional. Apartment returned at onSubmit.
*
*/
apartment?: string;
};
}
export interface IPaymentBrickCustomization {
/**
* Optional. Control visual aspects of brick.

@@ -158,3 +466,3 @@ *

/**
* Non-optional. Object that allow payment methods configuration.
* Required. Object that allow payment methods configuration.
*

@@ -164,8 +472,15 @@ * @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/payment.md Data customization} documentation.

paymentMethods: TPaymentBrickPaymentMethods;
/**
* Optional. Enable review and confirm feature.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#full-example-with-review-and-confirmation-steps} documentation.
*/
enableReviewStep?: boolean;
/**
* Optional. Object that organizes review and confirm visual elements.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/paymentReview.md#full-example-with-review-and-confirmation-steps} documentation.
*/
reviewCardsOrder?: string[];
}
/**
* Non-optional. Control the visual aspects of the brick.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/payment.md Data customization} documentation.
*/
type TPaymentBrickVisual = IPaymentBrickBaseVisual & IPaymentBrickVisual;

@@ -177,5 +492,5 @@ /**

*/
interface IPaymentBrickBaseVisual extends IBrickVisual<IPaymentBrickCustomizableTexts, IPaymentBrickStyle>, ICardPaymentBrickVisual {
export interface IPaymentBrickBaseVisual extends IBrickVisual<IPaymentBrickCustomizableTexts, IPaymentBrickStyle>, ICardPaymentBrickVisual {
}
interface IPaymentBrickVisual {
export interface IPaymentBrickVisual {
/**

@@ -243,3 +558,3 @@ * Optional. Hide redirection form.

/**
* Non-optional. Configuration of which payment methods will be accepted
* Required. Configuration of which payment methods will be accepted
*

@@ -262,3 +577,3 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/manage-payment-methods Payment # Additional Settings # Manage Payment Methods} documentation.

type AllOrArray = 'all' | string[];
interface IPaymentBrickPaymentMethods {
export interface IPaymentBrickPaymentMethods {
/**

@@ -296,3 +611,3 @@ * Optional. Customizable maximum number of installments to be offered to the user.

}
interface ILabelPlaceholder {
export interface ILabelPlaceholder {
/**

@@ -311,3 +626,3 @@ * Optional. Define custom label text.

}
interface IPaymentBrickCustomizableTexts {
export interface IPaymentBrickCustomizableTexts {
/**

@@ -372,5 +687,5 @@ * Optional. Custom payer label or placeholder first name.

}
interface IPaymentBrickStyle extends IBrickStyle<IPaymentBrickCustomVariables> {
export interface IPaymentBrickStyle extends IBrickStyle<IPaymentBrickCustomVariables> {
}
interface IPaymentBrickCustomVariables extends IBrickCustomVariables {
export interface IPaymentBrickCustomVariables extends IBrickCustomVariables {
/**

@@ -382,5 +697,11 @@ * Optional. Custom variable

secondaryColor?: string;
/**
* Optional. Custom variable
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/payment.md Text customization} documentation.
*/
secondaryColorListItem?: string;
}
type EntityType = 'individual' | 'association';
interface IPaymentBrickPayer extends ICardPaymentBrickPayer {
export interface IPaymentBrickPayer extends ICardPaymentBrickPayer {
/**

@@ -423,40 +744,4 @@ * Optional. Payer first name that can start already filled in.

}
interface IAddress {
export interface IAddress extends Partial<IDefaultAddress> {
/**
* Optional. Payer zip code that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
zipCode?: string;
/**
* Optional. Payer state address that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
federalUnit?: string;
/**
* Optional. Payer city that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
city?: string;
/**
* Optional. Payer neighborhood that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
neighborhood?: string;
/**
* Optional. Payer street name that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
streetName?: string;
/**
* Optional. Payer street number that can start already filled in.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
streetNumber?: number;
/**
* Optional. Payer complement that can start already filled in.

@@ -469,3 +754,3 @@ *

/**
* Non-optional. Payment types.
* Required. Payment types.
*

@@ -478,5 +763,5 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/payment-submission/cards Cards type documentation}

type TPaymentBrickPaymentType = 'atm' | 'ticket' | 'bank_transfer' | 'creditCard' | 'debitCard' | 'wallet_purchase' | 'onboarding_credits';
interface IPayerAPI {
export interface IPayerAPI {
/**
* Non-optional. Email of associated payer.
* Required. Email of associated payer.
*

@@ -487,3 +772,3 @@ * @see {@link https://www.mercadopago.com/developers/en/reference/payments/_payments/post Payer data} documentation.

/**
* Non-optional. Personal identification of associated payer. Contains keys type and number.
* Required. Personal identification of associated payer. Contains keys type and number.
*

@@ -494,3 +779,3 @@ * @see {@link https://www.mercadopago.com/developers/en/reference/payments/_payments/post Payer data} documentation.

/**
* Non-optional. First name of associated payer.
* Required. First name of associated payer.
*

@@ -501,3 +786,3 @@ * @see {@link https://www.mercadopago.com/developers/en/reference/payments/_payments/post Payer data} documentation.

/**
* Non-optional. Last name of associated payer.
* Required. Last name of associated payer.
*

@@ -508,3 +793,3 @@ * @see {@link https://www.mercadopago.com/developers/en/reference/payments/_payments/post Payer data} documentation.

/**
* Non-optional. Address of associated payer.
* Required. Address of associated payer.
*

@@ -521,5 +806,5 @@ * @see {@link https://www.mercadopago.com/developers/en/reference/payments/_payments/post Payer data} documentation.

}
interface IPayerAddressAPI {
export interface IPayerAddressAPI {
/**
* Non-optional. Zip code of associated payer.
* Required. Zip code of associated payer.
*

@@ -530,3 +815,3 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.

/**
* Non-optional. Federal unit of associated payer.
* Required. Federal unit of associated payer.
*

@@ -537,3 +822,3 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.

/**
* Non-optional. City of associated payer.
* Required. City of associated payer.
*

@@ -544,3 +829,3 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.

/**
* Non-optional. Neighborhood code of associated payer.
* Required. Neighborhood code of associated payer.
*

@@ -551,3 +836,3 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.

/**
* Non-optional. Street name code of associated payer.
* Required. Street name code of associated payer.
*

@@ -558,11 +843,11 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.

/**
* Non-optional. Street number code of associated payer.
* Required. Street number code of associated payer.
*
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/initialize-data-on-the-bricks Payer data} documentation.
*/
street_number: number;
street_number: string;
}
interface IAdditionalData {
export interface IAdditionalData {
/**
* Non-optional. Bin of card entered by user.
* Required. Bin of card entered by user.
*

@@ -572,3 +857,17 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/payment-brick/additional-customization/additional-data Data customization} documentation.

bin: string;
/**
* Required. Last four digits of card entered by user.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/payment.md#callbacks Callbacks} documentation.
*/
lastFourDigits: string;
}
export interface IAdditionalCardFormData extends IAdditionalData {
/**
* Optional. Cardholder name of card entered by user.
*
* @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/payment.md#callbacks Callbacks} documentation.
*/
cardholderName?: string;
}
export {};

@@ -1,4 +0,4 @@

/// <reference types="react" />
import React from 'react';
import { IStatusScreenBrickSettings } from './types';
declare const StatusScreen: ({ onReady, onError, customization, initialization, locale, }: IStatusScreenBrickSettings) => JSX.Element;
declare const StatusScreen: ({ onReady, onError, customization, initialization, locale, }: IStatusScreenBrickSettings) => React.JSX.Element;
export default StatusScreen;

@@ -27,3 +27,3 @@ import React, { useEffect } from 'react';

// *
// * @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/status-screen-brick/introduction Status Screen Brick documentation} for more information.
// * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/status-screen-brick/introduction Status Screen Brick documentation} for more information.
// */

@@ -30,0 +30,0 @@ const StatusScreen = ({ onReady = onReadyDefault, onError = onErrorDefault, customization, initialization, locale, }) => {

@@ -6,3 +6,3 @@ import { IBrickCallbacks, IBrickVisual, IBrickStyle, IBrickCustomVariables, IBrickError } from './../util/types/common';

/**
* Non-optional. Object containing initialization options.
* Required. Object containing initialization options.
*

@@ -22,9 +22,9 @@ * @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/status-screen-brick/default-rendering Status Screen Brick # Default rendering} documentation.

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language General Customization # Select Language} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language General Customization # Select Language} documentation.
*/
locale?: 'es-AR' | 'es-CL' | 'es-CO' | 'es-MX' | 'es-VE' | 'es-UY' | 'es-PE' | 'pt-BR' | 'en-US';
}
interface IStatusScreenBrickInitialization {
export interface IStatusScreenBrickInitialization {
/**
* Non-optional. The ID of the payment generated via Mercado Pago.
* Required. The ID of the payment generated via Mercado Pago.
*

@@ -41,5 +41,4 @@ * @see {@link https://github.com/mercadopago/sdk-js/blob/main/API/bricks/status-screen.md#initialization Data initialization} documentation.

}
interface IStatusScreenBrickCallbacks extends IBrickCallbacks {
}
interface IStatusScreenBrickCustomization {
type IStatusScreenBrickCallbacks = IBrickCallbacks;
export interface IStatusScreenBrickCustomization {
/**

@@ -58,3 +57,3 @@ * Optional. Controls whether the brick will show the user a button to navigate back to the seller's website. The url must be in the same domain and subdomain that the Brick is loaded on, urls in another domain will be ignored.

}
interface IStatusScreenBrickBackUrls {
export interface IStatusScreenBrickBackUrls {
/**

@@ -74,5 +73,4 @@ * Optional. Defines the url that will be shown to the user in case of error in the payment.

type TStatusScreenBrickVisual = IStatusScreenBrickBaseVisual & IStatusScreenBrickVisual;
interface IStatusScreenBrickBaseVisual extends IBrickVisual<IStatusScreenBrickCustomizableTexts, IStatusScreenBrickStyle> {
}
interface IStatusScreenBrickVisual {
type IStatusScreenBrickBaseVisual = IBrickVisual<IStatusScreenBrickCustomizableTexts, IStatusScreenBrickStyle>;
export interface IStatusScreenBrickVisual {
/**

@@ -97,3 +95,3 @@ * Optional. Shows the external_reference field from the Payments API.

}
interface IStatusScreenBrickCustomizableTexts {
export interface IStatusScreenBrickCustomizableTexts {
/**

@@ -118,5 +116,4 @@ * Custom general error label text.

}
interface IStatusScreenBrickStyle extends IBrickStyle<IStatusScreenBrickCustomVariables> {
}
interface IStatusScreenBrickCustomVariables extends IBrickCustomVariables {
type IStatusScreenBrickStyle = IBrickStyle<IStatusScreenBrickCustomVariables>;
export interface IStatusScreenBrickCustomVariables extends IBrickCustomVariables {
/**

@@ -135,11 +132,11 @@ * Optional. Bricks custom variables.

}
interface IStatusScreenBrickAdditionalInfo {
export interface IStatusScreenBrickAdditionalInfo {
/**
* Optional. The External Resource URL sent by MercadoPago to the iFrame Challenge.
* Required. The External Resource URL sent by MercadoPago to the iFrame Challenge.
*
* @see {@link Additional Info} documentation.
*/
externalResourceUrl: string;
externalResourceURL: string;
/**
* Optional. The Challenge Request Identificator sent by MercadoPago.
* Required. The Challenge Request Identificator sent by MercadoPago.
*

@@ -146,0 +143,0 @@ * @see {@link Additional Info} documentation.

@@ -6,2 +6,6 @@ import { IBrickError } from '../types/common';

declare const onBinChangeDefault: (bin: string) => void;
export { onErrorDefault, onReadyDefault, onSubmitDefault, onBinChangeDefault };
declare const onClickEditShippingDataDefault: () => void;
declare const onClickEditBillingDataDefault: () => void;
declare const onRenderNextStepDefault: (currentStep: string) => void;
declare const onRenderPreviousStepDefault: (currentStep: string) => void;
export { onErrorDefault, onReadyDefault, onSubmitDefault, onBinChangeDefault, onClickEditShippingDataDefault, onClickEditBillingDataDefault, onRenderNextStepDefault, onRenderPreviousStepDefault, };

@@ -20,2 +20,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
export { onErrorDefault, onReadyDefault, onSubmitDefault, onBinChangeDefault };
const onClickEditShippingDataDefault = () => {
console.log('onClickEditShippingData default implementation');
};
const onClickEditBillingDataDefault = () => {
console.log('onClickEditShippingData default implementation');
};
const onRenderNextStepDefault = (currentStep) => {
console.log(currentStep);
};
const onRenderPreviousStepDefault = (currentStep) => {
console.log(currentStep);
};
export { onErrorDefault, onReadyDefault, onSubmitDefault, onBinChangeDefault, onClickEditShippingDataDefault, onClickEditBillingDataDefault, onRenderNextStepDefault, onRenderPreviousStepDefault, };

@@ -45,3 +45,3 @@ export interface IPayerIdentification {

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/possible-errors Possible errors} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/possible-errors Possible errors} documentation.
*/

@@ -48,0 +48,0 @@ onError?: (error: IBrickError) => void;

@@ -1,2 +0,2 @@

/// <reference types="react" />
import React from 'react';
import { TWallet } from './types';

@@ -21,5 +21,5 @@ /**

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/introduction Wallet Brick documentation} for more information.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/introduction Wallet Brick documentation} for more information.
*/
declare const Wallet: ({ onReady, onError, onSubmit, customization, initialization, locale, }: TWallet) => JSX.Element;
declare const Wallet: ({ onReady, onError, onSubmit, customization, initialization, locale, }: TWallet) => React.JSX.Element;
export default Wallet;

@@ -23,3 +23,3 @@ import React, { useEffect } from 'react';

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/introduction Wallet Brick documentation} for more information.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/introduction Wallet Brick documentation} for more information.
*/

@@ -26,0 +26,0 @@ const Wallet = ({ onReady = onReadyDefault, onError = onErrorDefault, onSubmit = onSubmitDefault, customization, initialization, locale, }) => {

@@ -67,3 +67,3 @@ import { IBrickSettings } from '../util/types/common';

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/additional-customization/change-texts Wallet Brick# Additional Settings # Change Texts} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/additional-customization/change-texts Wallet Brick# Additional Settings # Change Texts} documentation.
*/

@@ -75,3 +75,3 @@ texts?: IWalletBrickTexts;

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/additional-customization/change-appearance Wallet Brick# Additional Settings # Change appearance} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/additional-customization/change-appearance Wallet Brick# Additional Settings # Change appearance} documentation.
*/

@@ -90,3 +90,3 @@ visual?: IWalletBrickVisual;

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-pro/checkout-customization/user-interface/color-style Checkout Theme customization} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-pro/checkout-customization/user-interface/color-style Checkout Theme customization} documentation.
*/

@@ -106,3 +106,3 @@ theme?: {

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/additional-customization/opening-mode#editor_2 Redirect Mode} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/additional-customization/opening-mode#editor_2 Redirect Mode} documentation.
* */

@@ -120,3 +120,3 @@ redirectMode?: 'modal' | 'blank' | 'self';

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language Bricks language customization} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language Bricks language customization} documentation.
*/

@@ -127,9 +127,9 @@ locale?: 'es-AR' | 'es-CL' | 'es-CO' | 'es-MX' | 'es-VE' | 'es-UY' | 'es-PE' | 'pt-BR' | 'en-US';

/**
* Non-optional. An object containing initialization options.
* Required. An object containing initialization options.
*/
initialization: {
/**
* Non-optional. Autogenerated unique ID that identifies the preference. For example 036151801-2484cd71-7140-4c51-985a-d4cfcf133baf
* Required. Autogenerated unique ID that identifies the preference. For example 036151801-2484cd71-7140-4c51-985a-d4cfcf133baf
*
* @tutorial {@link https://www.mercadopago.com/developers/en/reference/preferences/_checkout_preferences/post Create preference} documentation.
* @see {@link https://www.mercadopago.com/developers/en/reference/preferences/_checkout_preferences/post Create preference} documentation.
* */

@@ -140,5 +140,10 @@ preferenceId: string;

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/additional-customization/opening-mode#editor_2 Redirect Mode} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/wallet-brick/additional-customization/opening-mode#editor_2 Redirect Mode} documentation.
* */
redirectMode?: 'modal' | 'blank' | 'self';
/**
* Optional. This parameter enables the use of Wallet Brick in Marketplace mode
*
* */
marketplace?: boolean;
};

@@ -154,3 +159,3 @@ /**

*
* @tutorial {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language Bricks language customization} documentation.
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language Bricks language customization} documentation.
*/

@@ -157,0 +162,0 @@ locale?: 'es-AR' | 'es-CL' | 'es-CO' | 'es-MX' | 'es-VE' | 'es-UY' | 'es-PE' | 'pt-BR' | 'en-US';

{
"name": "@mercadopago/sdk-react",
"version": "0.0.14",
"version": "0.0.15",
"description": "Mercado Pago SDK React",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,4 +0,4 @@

/// <reference types="react" />
import React from 'react';
import type { CardNumberParams } from './types';
declare const CardNumber: (params: CardNumberParams) => JSX.Element;
declare const CardNumber: (params: CardNumberParams) => React.JSX.Element;
export default CardNumber;

@@ -1,4 +0,4 @@

/// <reference types="react" />
import React from 'react';
import type { ExpirationDateParams } from "./types";
declare const ExpirationDate: (params: ExpirationDateParams) => JSX.Element;
declare const ExpirationDate: (params: ExpirationDateParams) => React.JSX.Element;
export default ExpirationDate;

@@ -1,4 +0,4 @@

/// <reference types="react" />
import React from 'react';
import type { ExpirationMonthParams } from "./types";
declare const ExpirationMonth: (params: ExpirationMonthParams) => JSX.Element;
declare const ExpirationMonth: (params: ExpirationMonthParams) => React.JSX.Element;
export default ExpirationMonth;

@@ -1,4 +0,4 @@

/// <reference types="react" />
import React from 'react';
import { ExpirationYearParams } from "./types";
declare const ExpirationYear: (params: ExpirationYearParams) => JSX.Element;
declare const ExpirationYear: (params: ExpirationYearParams) => React.JSX.Element;
export default ExpirationYear;

@@ -1,4 +0,4 @@

/// <reference types="react" />
import React from 'react';
import type { SecurityCodeParams } from './types';
declare const SecurityCode: (params: SecurityCodeParams) => JSX.Element;
declare const SecurityCode: (params: SecurityCodeParams) => React.JSX.Element;
export default SecurityCode;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc