Hide element - Additional settings - Mercado Pago Developers

Hide title

Client-Side

-Brick
Customization momentWhen rendering the brick
Propertycustomization.hideFormTitle
TypeBoolean
CommentsWhen true, hides the title line.

javascript

const settings = {
   ...,
   customization: {
       visual: {
           hideFormTitle: true
       }
   }
}

Hide payment button

Client-Side

-Brick
Customization momentWhen rendering the brick
Propertycustomization.visual.hidePaymentButton
TypeBoolean
CommentsWhen true, the form submit button is not displayed and it becomes necessary to use the getFormData function to get the form data (see example below).

javascript

const settings = {
    ...,
    callbacks: {
        onReady: () => {
            // callback chamado quando o Brick estiver pronto
        },
        onError: (error) => { 
            // callback chamado para todos os casos de erro do Brick
        },
    },
    customization: {
        visual: {
            hidePaymentButton: true
        }
    }
}

html

<button type="button" onclick="createPayment();">Custom Payment Button</button>

javascript

function createPayment(){
    window.paymentBrickController.getFormData()
        .then(({ paymentType, formData }) => {
            console.log('formData received, creating payment...');
            if (paymentType === 'credit_card' || paymentType === 'debit_card') {
                fetch("/process_payment", {
                    method: "POST",
                    headers: {
                        "Content-Type": "application/json",
                    },
                    body: JSON.stringify(formData),
                })
            }
        })
        .catch((error) => {
            // error handling when calling getFormData()
        });
};

Hide Mercado Pago Wallet panel

Client-Side

-Brick
Customization momentWhen rendering the brick
Propertycustomization.visual.hideRedirectionPanel
TypeBoolean
CommentsWhen true, hides within the payment option with the Mercado Pago Wallet, the redirection panel to the Mercado Pago website.

javascript

const settings = {
   ...,
   customization: {
       visual: {
           hideRedirectionPanel: true
       }
   }
}