Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Update Android tools May 3, 2019
gradle/wrapper Adds sponsor_id demo Apr 17, 2017
.gitignore Adds sponsor_id demo Apr 17, 2017
README.MD Collector id param added May 3, 2019
build.gradle Update Android tools May 3, 2019 Initial Commit Jun 30, 2016
gradlew Initial Commit Jun 30, 2016
gradlew.bat Initial Commit Jun 30, 2016
settings.gradle Initial Commit Jun 30, 2016


MercadoPago Integration

The purpose of this app is to show the integration with MercadoPago. Download it or see some application screenshots directly from the Google Play

How to:

There are 2 kinds of integration Intent and Deep Linking.


For the Intent integration you have to create a implicit intent and start it with the method [startActivityForResult](', int)') as follows:

Intent i = new Intent();


Bundle bundle = new Bundle();

// AppId
bundle.putString(BundleCodes.APP_ID, appId);

// Secret
bundle.putString(BundleCodes.APP_SECRET, appSecret);

// App Fee
bundle.putDouble(BundleCodes.APP_FEE, appFee);

// Amount of transaction
bundle.putDouble(BundleCodes.AMOUNT, Double.valueOf(amount.getText().toString()));

// Description of transaction
bundle.putString(BundleCodes.DESCRIPTION, reference.getText().toString());

if (spinner.getSelectedItemPosition() == 0) {
    cc_selected = "credit_card";
} else {
    cc_selected = "debit_card";

// Payment type of transaction ( credit_card | debit_card  )
bundle.putString(BundleCodes.CARD_TYPE, cc_selected);

// # of installments
bundle.putInt(BundleCodes.INSTALLMENTS, Integer.valueOf(installments.getText().toString()));

// Kiosk Mode
bundle.putBoolean(BundleCodes.IS_KIOSK, true);

// Before we can start the intent, we should check if this phone handle the intent?
if (isAvailable(i)) {
    // start activity for result
    startActivityForResult(i, PAYMENT_REQUEST);
} else {
    // send to google play.
    try {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getPackageName())));
    } catch (ActivityNotFoundException e) {
        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("" + getPackageName())));

And them when the payment is done, point will notify a intent as follows:

in the calling activity:

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (requestCode == PAYMENT_REQUEST && data != null) {
       Intent intent = new Intent(this, Resultado.class);

the result activity that shows the results:

public class Resultado extends AppCompatActivity {

    TextView installments;
    TextView amount;
    TextView ccType;
    TextView paymentId;
    ImageView image;
    View layoutView;

    // it could be

    public final static String RESULT_PAYMENT_ID = "paymentId";

    public final static String RESULT_STATUS_OK = "OK";
    public final static String RESULT_STATUS_FAILED = "FAILED";

    protected void onCreate(Bundle savedInstanceState) {
        image = (ImageView) findViewById(;
        layoutView = findViewById(;
        paymentId = (TextView) findViewById(;
        installments = (TextView) findViewById(;
        amount = (TextView) findViewById(;
        ccType = (TextView) findViewById(;

        Intent launcherIntent = getIntent();
        Bundle data = launcherIntent.getExtras();
        if (data != null) {
            String result = data.getString(BundleCodes.RESULT_STATUS);

        Uri uri = launcherIntent.getData();
        if (uri != null) {
            String result = uri.getQueryParameter(BundleCodes.RESULT_STATUS);


    private void setStatus(String status) {
        if (RESULT_STATUS_OK.equals(status)) {
            if (android.os.Build.VERSION.SDK_INT >= 22) {
            } else {
            // Show the payment id
        if (RESULT_STATUS_FAILED.equals(status)) {
            if (android.os.Build.VERSION.SDK_INT >= 22) {
            } else {
            // Hide the payment id

Deep Linking:

With URL you call mercadopago by Deep Linking with the following URL :

Variable Required? Description
amount yes The amount to be charged
description yes The description of the charge.
card_type no The card type to use, only credit_card or debit_card are valid values
client_id no Specify your MercadoPago's Application id. Can be null
client_secret no 1. The client secret of the app.
application_fee no 2. The fee charged by the app.
success_url no The url to call when the payment has been done successfully, if none is provided we show the default point screen.
fail_url no The url to call when the payment has not been done successfully, if none is provided we show the default point screen.
collector_id no Specifies the collector id to be used. If sent it can't be null
  1. Its required if you provide a client_id
  2. If you provide application_fee , you must provide client_id & client_secret


These are the results you can get from Point appplication, ther are the same in both cases.

Variable / Query Description Notes
amount The amount charged
result_status The payment's status Values "OK" or "FAILED"
payment_id The payment's id only in sucessfull payments
card_type the card type Values "credit_card" or "debit_card"
installments the installments
error error reason Only in "FAILED" transactions
error_detail error details Only in "FAILED" transactions

Error detail response

Error result Description
USER_ABORTED When the user goes back at the first payment screen
NO_BT Device has not bluethooth (only android)
EXPIRED_CARD Expired card entered/swiped.
TRY_AGAIN In some payment rejected cases
WRONG_MCC Invalid Merchant Category Code selected
OWNERSHIP_ERROR Point device belongs to another account
LOW_BATTERY Point device with critically low battery
UNRECOGNIZED_DEVICE Can't recognize the point (bluethooth) device
VISA_BLACKLISTED Visa blacklisted entered/swiped card
USE_OTHER_CARD Payment rejected, use other card requested
INVALID_DATA_PROVIDED Invalid card type selected (credit/debit)
USER_CANCELLED_ERROR User cancelled payment (on the point device)
READER_DISABLED Point device blocked
CANCELLED_PAYMENT_ATTEMPT Intent integration: cancelled attempt (only android)
PAYMENT_REJECTED Payment rejected
INVALID_FINANCING_COST Invalid installments selected

Repo usage

Do not clone or push to master branch.

Create branch or fork from develop, then push or create pull requests (if you don't have access) to that branch.

mpmobile-android_seller uses this branching model:


In case you need to contact us, just send an email to and someone will answer you as soon as possible.

You can’t perform that action at this time.