AI resources

Payment

Payment, part of Mercado Pago SDK Checkout, provides a payment method selector and processes orders in native Android and iOS applications. Buyers can use a saved card, enter a new card or generate Rapipago and Pago Fácil instructions, according to the order rules.

Your backend creates the order and confirms the financial status of the purchase. The SDK manages the selected method steps, including CVV, card form, installments, review and results when applicable. The card token used for processing remains inside the SDK.

Prepare the integration

Configure SDK Checkout in the development environment. Use a supported release and keep Checkout and Core Methods on the same version. Obtain application test credentials in Your integrations.

  • Android: enable Compose. Use the SDK BoM to align modules. The SDK requires Android 6.0 or later (minSdk 23) and Kotlin 2.0 or later.
  • iOS: add the MercadoPagoCheckout product through Swift Package Manager. The package declares iOS 13 as its minimum platform and Swift tools 6.0; use an Xcode version compatible with your chosen release.

Initialize the application with the Public KeyPublic credential that identifies the application in the SDK.. Keep the Access TokenPrivate credential used by your backend. Never include it in the mobile application. only in your backend. Use credentials from the same application and environment.

The examples were checked against Android 1.0.4 and iOS 1.3.0, which include Payment, review and Status Screen. These are verified versions for this guide; they do not establish the first release to include each feature.

Initialize the SDK

Initialize once at application startup, before opening checkout. Do not repeat initialization for every payment attempt.

import android.app.Application
import com.mercadopago.sdk.android.domain.model.CountryCode
import com.mercadopago.sdk.android.initializer.MercadoPagoSDK

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        MercadoPagoSDK.initialize(
            context = this,
            publicKey = "YOUR_TEST_PUBLIC_KEY",
            countryCode = CountryCode.ARG,
        )
    }
}

Register MyApplication as your manifest Application class.

Create the order in your backend

Create an online order through /v1/ordersPOST in manual mode (processing_mode: "manual"). Do not send a card or token transaction at this point: the SDK collects the selected method and completes processing. The amount, payer and payment rules belong to the order.

curl --request POST 'https://api.mercadopago.com/v1/orders' \
  --header "Authorization: Bearer $MP_ACCESS_TOKEN" \
  --header "X-Idempotency-Key: $MP_IDEMPOTENCY_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
    "type": "online",
    "processing_mode": "manual",
    "total_amount": "100.00",
    "external_reference": "purchase-1234",
    "payer": { "email": "test_payer@example.com" },
    "items": [
      { "title": "Product", "quantity": 1, "unit_price": "100.00" }
    ]
  }'

Define MP_ACCESS_TOKEN only in your backend. Generate MP_IDEMPOTENCY_KEY for the logical order creation. Replace illustrative data with your purchase and test-payer data; add the fields required by the Orders contract for your scenario. The response provides id and client_token: send them to the application as the orderId and clientToken of MPOrder. Do not log clientToken.

Integrate by platform

Confirm payment in your backend

Query the order in your backend and configure notifications to track later changes. If the response or connection is lost, reconcile the same order before starting another charge. Neither the SDK response nor screen closure authorizes fulfillment.

Continue to Visual customizations and Behavior and support to configure appearance, order rules and tests.