AI resources

Integrate with Flutter

To integrate Mercado Pago's Checkout Pro into a mobile application, you need to display the web payment flow within your app. For this, use Custom Tabs for Android and Safari View Controller for iOS.

In this documentation, you will find detailed instructions on how to perform this integration using Flutter and Custom Tabs. We will present the steps for installing the necessary libraries, configuring dependencies, and provide practical examples of how to open web pages using Custom Tabs.

Before integrating Checkout Pro for mobile applications, you need to create a payment order in your backend. If you haven't done so yet, refer to the documentation on how to Create and configure a payment order.

Next, select the operating system and follow the corresponding step-by-step guide.

In this step, you will install and configure the necessary dependencies to implement Custom Tabs in your Flutter project.

For the user to be able to return to your application after completing the payment, you will need to configure Deep Links. This allows the user to be automatically redirected to a specific screen in your application when finishing the payment flow or clicking a return button.

1. Configure return URLs in the payment order

When creating the payment order in your backend, configure the return URLs in the config.online object (success_url, failure_url, pending_url and auto_return). For more information, refer to the documentation on how to Create and configure a payment order.

json

"config": {
  "online": {
    "success_url": "tuapp://success",
    "failure_url": "tuapp://failure",
    "pending_url": "tuapp://pending",
    "auto_return": "approved"
  }
}
Do not use local domains in the return URLs (success_url, failure_url, pending_url), such as 'localhost/' or '127.0.0.1'. We recommend using a server with a named domain (DNS) or development IPs to be able to return to the site after payment.

Flutter allows you to manage Deep Links in both Android and iOS. For this, use packages such as uni_links or go_router to detect and manage internal navigation when the application is opened via Deep Link.

Deep Links configuration is a common procedure for all mobile technologies. Refer to the official Flutter documentation on Deep Links, as well as the App Links guide for Android or Universal Links for iOS, as applicable.