Home
Documentation
Resources
Certifications
Community

Resources

Check for updates on our solutions and system performance, or request technical support.

Community

Get the latest news, ask others for help and share your knowledge.

Additional callbacks - Advanced features - Mercado Pago Developers

Intelligent search powered by OpenAI 

Additional callbacks

When initializing Brick it is possible to configure additional callbacks, which provide the integrator with more information during the Brick execution.

onBinChange

The onBinChange callback is used to get the bin of the card being inserted into the Brick. This callback is called on the fly whenever the card bin is updated.

          
const settings = {
   ...,
   callbacks: {
       ...
       onBinChange: (bin) => {
           // allback called whenever card bin is changed
           console.log(bin);
       },
   }
};

        
          
<Card
 ...,
 onBinChange={bin => {
   console.log(bin);
 }}
/>

        
Attention
The card bin returned by the onBinChange callback is the same as the one entered by the user in the card number field, that is, for each change the user makes in this field, a new event will be triggered by the callback. Therefore, only consider the bin valid and reliable to be used after the submit event is fired by the onSubmit callback.