# MD for: https://www.mercadopago.cl/developers/es/docs/checkout-api-orders/development-environment.md \# Configure development environment To start your integration with Mercado Pago's payment solutions, it is necessary to prepare your development environment with a series of basic configurations that will allow you to access Mercado Pago's functionalities from the frontend securely. The development environment can be configured for integrations on \*\*websites\*\* or \*\*mobile applications\*\*. Select the type of integration below and follow the specific instructions for each case. :::::TabsComponent ::::TabComponent{title="Websites"} For website integrations, configuring the environment consists of including the \*\*MercadoPago.js V2\*\* library on the pages where the payment will be processed and initializing it with your credentials. Follow the steps below to get the frontend ready to capture payment data. > CLIENT\_SIDE > > h3 > > Include the MercadoPago.js Library Use our official libraries to access Mercado Pago's functionalities from your frontend and securely capture the payment data. html htmlnode ``` ``` ``` npm install @mercadopago/sdk-js ``` \> CLIENT\_SIDE > > h3 > > Initialize Mercado Pago Library To initialize the Mercado Pago library, you will need to use your :toolTipComponent\[credentials\]{link="/developers/en/docs/checkout-api-orders/resources/credentials" linkText="Credentials" content="Access keys linked to an application that identify and authenticate a Mercado Pago integration."}, unique keys that identify an integration in your account. They are directly linked to the :toolTipComponent\[application\]{link="/developers/en/docs/checkout-api-orders/resources/application-details" linkText="Integration data" content="Entity registered in Mercado Pago that identifies an integration and stores its settings and credentials."} you created for that integration, and will allow you to develop your project with Mercado Pago's best security measures. At this stage, you should use your :toolTipComponent\[test Public Key\]{content="Public key linked to an application, used in the frontend to initialize and test the integration. You can find it in the application's Credentials section, within the test environment. It cannot process real payments."}. > NOTE > > If you are developing for someone else, you will be able to access the credentials of the applications you do not manage. Refer to \[Share credentials\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/resources/credentials#bookmark\_share\_credentials) for more information. Once you have located the :toolTipComponent\[test Public Key\]{content="Public key linked to an application, used in the frontend to initialize and test the integration. You can find it in the application's Credentials section, within the test environment. It cannot process real payments."}, copy it and include it in the frontend to access the necessary data to interact with our services, as well as encrypt sensitive data involved in the payments you will receive. html htmljavascript ``` ``` ``` import { loadMercadoPago } from "@mercadopago/sdk-js"; await loadMercadoPago(); const mp = new window.MercadoPago("{{YOUR_PUBLIC_KEY}}"); ``` With these configurations, your development environment is already ready to continue with the specific configurations of your integration. :::: ::::TabComponent{title="Mobile (iOS)"} Use the Mercado Pago native SDK (\*\*Mercado Pago SDK\*\*) to securely simplify the payment process in iOS applications. Follow the steps below to configure the development environment and start the payment flow. Choose \*\*Card Payment Brick\*\* for the managed visual flow or \*\*Core Methods\*\* to build your own experience. :::AccordionComponent{title="Card Payment"} The integration with \*\*Card Payment Brick\*\* uses the \*\*Checkout SDK\*\*, which speeds up the implementation of a payment checkout in native iOS apps, leveraging the technology, security, and components of the Mercado Pago ecosystem. In a few steps you display a ready-to-use checkout, tokenize credit/debit cards, customize the accepted payment methods, and apply your own theme through a token system. > WARNING > > The \*\*Checkout SDK\*\* (\*\*Card Payment\*\*) internally uses the \*\*Core Methods SDK\*\* (Core Methods) to communicate with the Mercado Pago API. When using both in the same app, control the versions to avoid conflicts. > CLIENT\_SIDE > > h3 > > Requirements To integrate the Checkout SDK into iOS applications, you must meet the requirements below. | Requirement | Minimum version | |---|---| | iOS | 13.0 | | Swift | 5.5 | | Xcode | 26.0 | > CLIENT\_SIDE > > h3 > > Install the SDK Add the SDK repository in Xcode through \*\*File > Add Package Dependencies\*\* and provide the URL: > NOTE > > If your application also uses the \*\*Core Methods SDK\*\* directly through the \[Core Methods integration\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/development-environment#bookmark\_install\_sdk), we recommend using the same package (\`Package.swift\`) whenever possible, validating the transitive dependencies in Xcode, and avoiding declaring divergent versions of the same product. \`\`\`url https://github.com/mercadopago/sdk-ios \`\`\` Or add it directly in \`Package.swift\`: \`\`\`swift dependencies: \[ .package(url: "https://github.com/mercadopago/sdk-ios", from: "x.x.x") \], targets: \[ .target( name: "YourTarget", dependencies: \[ .product(name: "CoreMethods", package: "MercadoPagoSDK"), .product(name: "MercadoPagoCheckout", package: "MercadoPagoSDK") \] ) \] \`\`\` > NOTE > > To find the most recent version of the iOS SDK, check the \[repository releases on GitHub\](https://github.com/mercadopago/sdk-ios/releases). > CLIENT\_SIDE > > h3 > > Initialize SDK After installing the SDK and adding the dependencies to your project, initialize the SDK at the beginning of the application lifecycle. This ensures that all essential configurations are defined before any payment operation. > WARNING > > The SDK must be initialized only once when the application opens and before using any other SDK functionality; otherwise, it will return an \`integrationError\`. For more information, see \[Possible mobile SDK errors\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/payment-management/integration-errors/sdk). To initialize the SDK, you will need to use your :toolTipComponent\[credentials\]{link="/developers/en/docs/checkout-api-orders/resources/credentials" linkText="Credentials" content="Access keys linked to an application that identify and authenticate a Mercado Pago integration."}, unique keys that identify your integration and are linked to the :toolTipComponent\[application\]{link="/developers/en/docs/checkout-api-orders/resources/application-details" linkText="Integration data" content="Entity registered in Mercado Pago that identifies an integration and stores its settings and credentials."} created for that integration, allowing you to develop your project with Mercado Pago's best security measures. At this stage, you should use your :toolTipComponent\[test Public Key\]{content="Public key linked to an application, used in the frontend to initialize and test the integration. You can find it in the application's Credentials section, within the test environment. It cannot process real payments."}. > NOTE > > If you are developing for someone else, you will be able to access the credentials of the applications you do not manage. In addition, the SDK does not have a specific flag for test environments (sandbox), meaning the environment is defined by the type of Public Key used at initialization. \> For more information, see \[Credentials\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/resources/credentials). According to the technology used, either UIKit or SwiftUI, initialize the SDK including the Public Key and the \`country\`, as in the example below: uikit uikitswiftui ``` import CoreMethods @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { let configuration = MercadoPagoSDK.Configuration( publicKey: "{{YOUR_PUBLIC_KEY}}", country: .BRA ) MercadoPagoSDK.shared.initialize(configuration) return true } } ``` ``` import CoreMethods @main struct YourApp: App { init() { let configuration = MercadoPagoSDK.Configuration( publicKey: "{{YOUR_PUBLIC_KEY}}", country: .BRA ) MercadoPagoSDK.shared.initialize(configuration) } var body: some Scene { WindowGroup { ContentView() } } } ``` | Parameter | Type | Description | Required | |---|---|---|---| | \`publicKey\` | String | :toolTipComponent\[Public Key\]{link="/developers/en/docs/checkout-api-orders/resources/credentials" linkText="Credentials" content="Public key used in the \_frontend\_ to initialize the integration and protect the data sent to Mercado Pago."} of the application. Use the test Public Key during development and testing, and the production one to \[start receiving real payments\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/go-to-production). | Required | | \`country\` | \`MercadoPagoSDK.Country\` | Operating country of the Mercado Pago account associated with the \`publicKey\`. Possible values: \`.ARG\`, \`.BOL\`, \`.BRA\`, \`.CHL\`, \`.COL\`, \`.CRI\`, \`.CUB\`, \`.DOM\`, \`.ECU\`, \`.GTM\`, \`.HND\`, \`.MEX\`, \`.NIC\`, \`.PAN\`, \`.PER\`, \`.PRY\`, \`.SLV\`, \`.URY\`, and \`.VEN\`. | Required | ::: :::AccordionComponent{title="Core Methods"} The integration with \*\*Core Methods\*\* uses the \*\*Core Methods SDK\*\*, which leaves it up to your application to define how the information needed to complete the payment will be captured in native iOS apps. Instead of displaying a ready-to-use checkout, you build your own interface and use the SDK's \*\*secure fields\*\* to collect the card data, running from them the main payment operations, such as tokenization and the query of issuers, card brands, and installments. > CLIENT\_SIDE > > h3 > > Install SDK See below the step by step to install the SDK in your Swift project. 1\. In Swift Package Manager, click \*\*File > Add packages\*\*. 2\. Paste the repository URL: \`https://github.com/mercadopago/sdk-ios\`. 3\. Select the desired SDK version. 4\. Click \*\*Add package\*\* to complete the installation. > NOTE > > To find the most recent version of the iOS SDK, check the \[repository releases on GitHub\](https://github.com/mercadopago/sdk-ios/releases). > CLIENT\_SIDE > > h3 > > Add dependencies Import the SDK dependencies into your project by running the following code: \`\`\` import CoreMethods \`\`\` > CLIENT\_SIDE > > h3 > > Initialize SDK After installing the SDK and adding the dependencies to your project, initialize the SDK at the beginning of the application lifecycle. This ensures that all essential configurations are defined before any payment operation. > WARNING > > The SDK must be initialized only once when the application opens and before using any other SDK functionality; otherwise, it will return an \`integrationError\`. For more information, see \[Possible mobile SDK errors\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/payment-management/integration-errors/sdk). To initialize the SDK, you will need to use your :toolTipComponent\[credentials\]{link="/developers/en/docs/checkout-api-orders/resources/credentials" linkText="Credentials" content="Access keys linked to an application that identify and authenticate a Mercado Pago integration."}, unique keys that identify your integration and are linked to the :toolTipComponent\[application\]{link="/developers/en/docs/checkout-api-orders/resources/application-details" linkText="Integration data" content="Entity registered in Mercado Pago that identifies an integration and stores its settings and credentials."} created for that integration, allowing you to develop your project with Mercado Pago's best security measures. At this stage, you should use your :toolTipComponent\[test Public Key\]{content="Public key linked to an application, used in the frontend to initialize and test the integration. You can find it in the application's Credentials section, within the test environment. It cannot process real payments."}. > NOTE > > If you are developing for someone else, you will be able to access the credentials of the applications you do not manage. In addition, the SDK does not have a specific flag for test environments (sandbox), meaning the environment is defined by the type of Public Key used at initialization. \> For more information, see \[Credentials\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/resources/credentials). According to the technology used, either UIKit or SwiftUI, initialize the SDK including the Public Key and the \`country\`, as in the example below: uikit uikitswiftui ``` import UIKit import CoreMethods @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { let configuration = MercadoPagoSDK.Configuration( publicKey: "{{YOUR_PUBLIC_KEY}}", country: .BRA ) MercadoPagoSDK.shared.initialize(configuration) return true } } ``` ``` import SwiftUI import CoreMethods @main struct YourApp: App { init() { let configuration = MercadoPagoSDK.Configuration( publicKey: "{{YOUR_PUBLIC_KEY}}", locale: "en-US", country: .BRA ) MercadoPagoSDK.shared.initialize(configuration) } var body: some Scene { WindowGroup { ContentView() } } } ``` The initialization parameters are listed in the table below. | Parameter | Type | Description | Required | |---|---|---|---| | \`publicKey\` | String | :toolTipComponent\[Public Key\]{link="/developers/en/docs/checkout-api-orders/resources/credentials" linkText="Credentials" content="Public key used in the \_frontend\_ to initialize the integration and protect the data sent to Mercado Pago."} of the application, used to initialize the SDK. Use the test Public Key during development and testing, and the production one to \[start receiving real payments\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/go-to-production). | Required | | \`country\` | \`MercadoPagoSDK.Country\` | Operating country of the Mercado Pago account associated with the \`publicKey\`. Possible values: \`.ARG\`, \`.BOL\`, \`.BRA\`, \`.CHL\`, \`.COL\`, \`.CRI\`, \`.CUB\`, \`.DOM\`, \`.ECU\`, \`.GTM\`, \`.HND\`, \`.MEX\`, \`.NIC\`, \`.PAN\`, \`.PER\`, \`.PRY\`, \`.SLV\`, \`.URY\`, and \`.VEN\`. | Required | | \`locale\` | String | Language and country used in the texts displayed by the SDK, such as \`en-US\`. When omitted, the SDK uses the system locale. | Optional | With these configurations, your development environment is already ready to continue with the specific configurations of your integration. ::: :::: ::::TabComponent{title="Mobile (Android)"} Use the Mercado Pago native SDK (\*\*Mercado Pago SDK\*\*) to securely simplify the payment process in Android applications. Follow the steps below to configure the development environment and start the payment flow. Choose \*\*Card Payment\*\* for the managed visual flow or \*\*Core Methods\*\* to build your own experience. :::AccordionComponent{title="Card Payment"} The integration with \*\*Card Payment Brick\*\* uses the \*\*Checkout SDK\*\*, which speeds up the implementation of a payment checkout in native Android apps, leveraging the technology, security, and components of the Mercado Pago ecosystem. In a few steps you display a ready-to-use checkout, tokenize credit/debit cards, customize the accepted payment methods, and apply your own theme through a token system. > NOTE > > The \*\*Checkout SDK\*\* (\*\*Card Payment\*\*) internally uses the \*\*Core Methods SDK\*\* (Core Methods) to communicate with the Mercado Pago API. When using both in the same app, control the versions to avoid conflicts. > CLIENT\_SIDE > > h3 > > Requirements To integrate the Checkout SDK, meet the requirements below. | Requirement | Minimum version | |---|---| | Android | 6.0 Marshmallow (\`minSdk = 23\`) | | Kotlin | 2.0 | | Jetpack Compose | No minimum version. Since the SDK uses Compose internally, the plugin must be enabled in the project. | > CLIENT\_SIDE > > h3 > > Configure repository Before adding the dependency, include the Mercado Pago repository in the project's \`settings.build.gradle\` file: \`\`\`kotlin pluginManagement { repositories { // Other dependencies... maven { url = uri("https://artifacts.mercadolibre.com/repository/android-releases") } } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL\_ON\_PROJECT\_REPOS) repositories { // Other dependencies... maven { url = uri("https://artifacts.mercadolibre.com/repository/android-releases") } } } \`\`\` > CLIENT\_SIDE > > h3 > > Install the SDK Add the dependencies in the \`build.gradle\` (Module) using the \`BOM\` to keep versions consistent: > NOTE > > If your application also uses the \*\*Core Methods SDK\*\* directly through the \[Core Methods integration\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/development-environment#bookmark\_install\_sdk), we recommend the same \`BOM\` whenever possible, validating the dependency tree with \`./gradlew app:dependencies\`, and avoiding declaring divergent versions of the same artifact. \`\`\`kotlin // build.gradle (Module) implementation(platform("com.mercadopago.android.sdk:sdk-android-bom:")) implementation("com.mercadopago.android.sdk:checkout") // The checkout version is aligned by the BOM — do not pin a version here \`\`\` > NOTE > > To find the most recent version, check the \[repository releases on GitHub\](https://github.com/mercadopago/sdk-android/releases). > CLIENT\_SIDE > > h3 > > Initialize SDK After configuring the repository and adding the dependencies to your project, initialize the SDK at the beginning of the application lifecycle by calling the \`initialize()\` class. This ensures that all essential configurations are defined before any payment operation. > WARNING > > The SDK must be initialized only once when the application opens and before using any other SDK functionality; otherwise, it will return an \`INTEGRATION\_ERROR\`. For more information, see \[Possible mobile SDK errors\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/payment-management/integration-errors/sdk). To initialize the SDK, you will need to use your :toolTipComponent\[credentials\]{link="/developers/en/docs/checkout-api-orders/resources/credentials" linkText="Credentials" content="Access keys linked to an application that identify and authenticate a Mercado Pago integration."}, which are linked to the :toolTipComponent\[application\]{link="/developers/en/docs/checkout-api-orders/resources/application-details" linkText="Integration data" content="Entity registered in Mercado Pago that identifies an integration and stores its settings and credentials."} you created. At this stage, you should use your :toolTipComponent\[test Public Key\]{content="Public key linked to an application, used in the frontend to initialize and test the integration. You can find it in the application's Credentials section, within the test environment. It cannot process real payments."}. > NOTE > > If you are developing for someone else, you will be able to access the credentials of the applications you do not manage. In addition, the SDK does not have a specific flag for test environments (sandbox), meaning the environment is defined by the type of Public Key used at initialization. \> For more information, see \[Credentials\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/resources/credentials). Initialize the SDK including the Public Key and the \`countryCode\`, as in the example below: \`\`\`kotlin class MainApplication : Application() { override fun onCreate() { super.onCreate() MercadoPagoSDK.initialize( context = this, publicKey = "{{YOUR\_PUBLIC\_KEY}}", countryCode = CountryCode.BRA ) } } \`\`\` | Parameter | Type | Description | Required | |---|---|---|---| | \`context\` | \`Context\` | Reference to your running application, provided by Android. It is through it that the SDK accesses system resources, such as storage and device information. Since initialization happens inside the \`Application\` class, the value to provide is \`this\`. | Required | | \`publicKey\` | String | :toolTipComponent\[Public Key\]{link="/developers/en/docs/checkout-api-orders/resources/credentials" linkText="Credentials" content="Public key used in the \_frontend\_ to initialize the integration and protect the data sent to Mercado Pago."} of the application. Use the test Public Key during development and testing, and the production one to \[start receiving real payments\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/go-to-production). | Required | | \`countryCode\` | \`CountryCode\` | Operating country of the Mercado Pago account associated with the \`publicKey\`. To find out the possible values that can be sent, check the \[GitHub Pages\](https://mercadopago.github.io/sdk-android/sdk-android/com.mercadopago.sdk.android.domain.model/-country-code/index.html). | Required | Finally, register the \`MainApplication\` class in the \*\*/app/src/main/AndroidManifest.xml\*\* file through the \`android:name\` attribute. Without this registration, Android uses the default \`Application\` class, \`onCreate\` is not executed, and the SDK is not initialized. \`\`\`xml ... \`\`\` ::: :::AccordionComponent{title="Core Methods"} The integration with \*\*Core Methods\*\* uses the \*\*Core Methods SDK\*\*, which leaves it up to your application to define how the information needed to complete the payment will be captured in native Android apps. Instead of displaying a ready-to-use checkout, you build your own interface and use the SDK's \*\*secure fields\*\* to collect the card data, running from them the main payment operations, such as tokenization and the query of issuers, card brands, and installments. > CLIENT\_SIDE > > h3 > > Configure repository Add the Mercado Pago repository to the \`settings.build.gradle\` file of your Kotlin project, as in the example below: \`\`\`kotlin pluginManagement { repositories { // Other dependencies... maven { url = uri("https://artifacts.mercadolibre.com/repository/android-releases") } } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL\_ON\_PROJECT\_REPOS) repositories { // Other dependencies... maven { url = uri("https://artifacts.mercadolibre.com/repository/android-releases") } } } \`\`\` > CLIENT\_SIDE > > h3 > > Add dependencies Include the SDK dependencies in the \`build.gradle\` (or \`build.gradle.kts\`) file of your application module: \`\`\`kotlin // Specify the SDK BOM with a version definition implementation(platform("com.mercadopago.android.sdk:sdk-android-bom:")) // Specify the SDK library dependencies without a version definition implementation("com.mercadopago.android.sdk:core-methods") \`\`\` > CLIENT\_SIDE > > h3 > > Initialize SDK After configuring the repository and adding the dependencies to your project, initialize the SDK at the beginning of the application lifecycle by calling the \`initialize()\` class. This ensures that all essential configurations are defined before any payment operation. > WARNING > > The SDK must be initialized only once when the application opens and before using any other SDK functionality; otherwise, it will return an \`integrationError\`. For more information, see \[Possible mobile SDK errors\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/payment-management/integration-errors/sdk). To initialize the SDK, you will need to use your :toolTipComponent\[credentials\]{link="/developers/en/docs/checkout-api-orders/resources/credentials" linkText="Credentials" content="Access keys linked to an application that identify and authenticate a Mercado Pago integration."}, which are linked to the :toolTipComponent\[application\]{link="/developers/en/docs/checkout-api-orders/resources/application-details" linkText="Integration data" content="Entity registered in Mercado Pago that identifies an integration and stores its settings and credentials."} you created. At this stage, you should use your :toolTipComponent\[test Public Key\]{content="Public key linked to an application, used in the frontend to initialize and test the integration. You can find it in the application's Credentials section, within the test environment. It cannot process real payments."}. > NOTE > > If you are developing for someone else, you will be able to access the credentials of the applications you do not manage. In addition, the SDK does not have a specific flag for test environments (sandbox), meaning the environment is defined by the type of Public Key used at initialization. \> For more information, see \[Credentials\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/resources/credentials). Initialize the SDK including the Public Key and the \`countryCode\`: \`\`\`kotlin import android.app.Application import com.mercadopago.sdk.android.initializer.MercadoPagoSDK class MainApplication : Application() { override fun onCreate() { super.onCreate() MercadoPagoSDK.initialize( context = this, publicKey = "{{YOUR\_PUBLIC\_KEY}}", countryCode = CountryCode.BRA ) } } \`\`\` The initialization parameters are listed in the table below. | Parameter | Type | Description | Required | |---|---|---|---| | \`context\` | \`Context\` | Reference to your running application, provided by Android. It is through it that the SDK accesses system resources, such as storage and device information. Since initialization happens inside the \`Application\` class, the value to provide is \`this\`. | Required | | \`publicKey\` | String | :toolTipComponent\[Public Key\]{link="/developers/en/docs/checkout-api-orders/resources/credentials" linkText="Credentials" content="Public key used in the \_frontend\_ to initialize the integration and protect the data sent to Mercado Pago."} of the application. Use the test Public Key during development and testing, and the production one to \[start receiving real payments\](https://www.mercadopago.cl/developers/en/docs/checkout-api-orders/go-to-production). | Required | | \`countryCode\` | \`CountryCode\` | Operating country of the Mercado Pago account associated with the \`publicKey\`. To find out the possible values that can be sent, check the \[GitHub Pages\](https://mercadopago.github.io/sdk-android/sdk-android/com.mercadopago.sdk.android.domain.model/-country-code/index.html). | Required | Finally, register the \`MainApplication\` class in the \*\*/app/src/main/AndroidManifest.xml\*\* file through the \`android:name\` attribute. Without this registration, Android uses the default \`Application\` class, \`onCreate\` is not executed, and the SDK is not initialized. \`\`\`xml ... \`\`\` With these configurations, your development environment is already ready to continue with the specific configurations of your integration. ::: :::: :::::