Home
Documentation
Resources
Certifications
Community
Configure redirect URLs - Advanced features - Mercado Pago Developers

Intelligent search powered by OpenAI 

Configure redirect URLs

Client-Side

With the Status Screen Brick, it is possible to redirect your user to another page of your site through the redirection buttons, so that user can make a new purchase or, in case of payment error, try to make a new payment. To configure the return URLs, you need to send the desired URLs in the Brick configuration.

Attention
Only URLs from the same domain as the page on which the Status Screen Brick is loaded will be accepted by the Brick. URLs belonging to other domains or subdomains will be ignored.
          
const settings = {
   initialization: {
       paymentId: 100, // payment id generated by Mercado Pago
   },
   callbacks: {
       onReady: () => {
           // callback called when Brick is ready
       },
       onError: (error) => {
           // callback called for all Brick error cases
       },
   },
   customization: {
       backUrls: {
           'error': '<http://<seu dominio>/error>',
           'return': '<http://<seu dominio>/homepage>'
       }
   }
};

        
          
const customization = {
 backUrls: {
   error: '<http://<your_domain>/error>',
   return: '<http://<your_domain>/homepage>',
 },
};

        

The address provided in the return property of the backUrls object will be displayed as a link to the user whenever the Status Screen Brick is displayed, while the address provided in the error property will be displayed as a link to the user when there is an error in payment processing.

Attention
It is possible to customize the texts of the buttons that contain the return URLs via Brick's text configuration. The keys for the button texts are: ctaGeneralErrorLabel (for payment errors), ctaCardErrorLabel (for errors in filling in card data) and ctaReturnLabel (for the return URL, which will be shown in all states).

configure-redirect-urls