Configure redirect URLs - Additional settings - Mercado Pago Developers

Configure redirect URLs


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.

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>'

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.

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).