Hide element - Additional settings - Mercado Pago Developers

Hide title and flags

Client-Side

BrickCard Payment Form
Customization momentWhen rendering the Brick
Propertycustomization.hideFormTitle
TypeBoolean
CommentsWhen true, hides the title line and accepted flags.

javascript

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

Hide payment button

Client-Side

BrickCard Payment Form
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.cardPaymentBrickController.getFormData()
        .then((cardFormData) => {
            console.log('cardFormData received, creating payment...');
            fetch("/process_payment", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json",
                },
                body: JSON.stringify(cardFormData),
            })
        })
        .catch((error) => {
            // error handling when calling getFormData()
        });
};
Important
In case you need to customize the Brick’s visual style beyond the available themes and custom variables, avoid using the CSS ids and classes values that are bundled with the Bricks as reference, because they are automatically generated during the application’s build process and their names change regularly. Instead, use HTML inheritance to access the elements you need to customize.