Skip to content
Mercado Pago's Official Android checkout library
Branch: master
Clone or download
Latest commit cef14f7 May 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github [Enhacenment] Adding new pull request template (#960) Apr 20, 2018
docs updated javadocs (#1381) Nov 8, 2018
example added session id interceptor Apr 1, 2019
gradle update gradle wrapper and tools Feb 12, 2019
px-checkout Merge pull request #1714 from mercadopago/release/4.12.4 May 21, 2019
px-services Merge pull request #1714 from mercadopago/release/4.12.4 May 21, 2019
px-testlib [Feature] CNPJ updates for regression (#1653) Apr 3, 2019
scripts Fix release check on build script Jan 10, 2019
testlib [feature] Express checkout v2 (#1299) Nov 8, 2018
.gitignore
.travis.yml [enhancement] added java8 support with buildtools 28.0.3 (#1530) Jan 29, 2019
CHANGELOG-v2.md [release] 4.2.0 (#1317) Oct 25, 2018
CHANGELOG-v3.md [Feature] Summary component (#896) Mar 13, 2018
CHANGELOG.md * Changelog May 20, 2019
LICENSE Create LICENSE Oct 18, 2017
README.md [enhancement] add payer info into preference's curl (#1561) Feb 12, 2019
build.gradle update gradle wrapper and tools Feb 12, 2019
business.png Add files via upload May 12, 2019
business_2.png Add files via upload May 12, 2019
gradle.properties * Version bump and changelog May 20, 2019
gradlew [enhancement] v4 signature (#1145) Aug 30, 2018
gradlew.bat [enhancement] v4 signature (#1145) Aug 30, 2018
screenshot.png first commit Jan 14, 2016
settings.gradle [enhancement] v4 signature (#1145) Aug 30, 2018

README.md

Build Status Codecov branch Bintray GitHub tag GitHub top language

Screenshot MercadoPago

The MercadoPago Android Payment Experience makes it easy to collect your user's credit card details inside your android app. By creating tokens, MercadoPago handles the bulk of PCI compliance by preventing sensitive card data from hitting your server.

🌟 Features

  • Easy to install

  • Easy to integrate

  • PCI compliance

  • Basic color customization

  • Advanced color customization

  • Lazy loading initialization support

  • Custom Fragments support in certain screens

  • Support to build your own Payment Processor

  • Support to create your own custom Payment Method

Installation

Android Studio

Add this line to your app's build.gradle inside the dependencies section:

implementation 'com.mercadopago.android.px:checkout:4.+'

🐒 How to use?

Only 3 steps needed to create a basic checkout using MercadoPagoCheckout:

  1. Import into your project
import com.mercadopago.android.px.core.MercadoPagoCheckout.Builder;
  1. Set your PublicKey and PreferenceId
final MercadoPagoCheckout checkout = new MercadoPagoCheckout.Builder("public_key", "checkout_preference_id")
    .build();
  1. Start
checkout.startPayment(activityOrContext, requestCode);

One line integration

new MercadoPagoCheckout.Builder("public_key", "checkout_preference_id")
    .build()
    .startPayment(activityOrContext, requestCode);

Credentials

Get your Credentials

Screenshot Credentials

Create your preference id

curl -X POST \
     'https://api.mercadopago.com/checkout/preferences?access_token=ACCESS_TOKEN' \
     -H 'Content-Type: application/json' \
     -d '{
           "items": [
               {
               "title": "Dummy Item",
               "description": "Multicolor Item",
               "quantity": 1,
               "currency_id": "ARS",
               "unit_price": 10.0
               }
           ],
           "payer": {
               "email": "payer@email.com"
           }
     }'
  • payer email has to be different from the one of credentials.

Advanced integration

Check our official code reference, especially MercadoPagoCheckoutBuilder object to explore all available functionalities.

🔮 Project Example

This project include an example project using MercadoPago PX. In case you need support contact the MercadoPago Developers Site.

Documentation

Feedback

You can join the MercadoPago Developers Community on MercadoPago Developers Site:

🌈 Basic color customization

    <!-- Main color -->
    <color name="ui_components_android_color_primary">@color/your_color</color>

    <!-- Toolbar's text color -->
    <!-- Default: @color/ui_components_white_color -->
    <color name="px_toolbar_text">@color/your_color</color>

    <!-- Status Bar color -->
    <color name="ui_components_android_color_primary_dark">@color/your_color</color>

    <!-- Spinner primary color -->
    <!-- Default: @color/ui_components_android_color_primary -->
    <color name="ui_components_spinner_primary_color">@color/your_color</color>

    <!-- Spinner secondary color -->
    <!-- Default: @color/ui_components_android_color_primary -->
    <color name="ui_components_spinner_secondary_color">@color/your_color</color>

    <!-- Spinner background color -->
    <!-- Default: @color/ui_components_white_color -->
    <color name="px_background_loading">@color/your_color</color>

    <!-- Payment method icon color -->
    <!-- Default: @color/ui_components_android_color_primary -->
    <color name="px_paymentMethodTint">@color/your_color</color>

    <!-- Inputs color -->
    <!-- Default: @color/ui_components_android_color_primary -->
    <color name="px_input">@color/your_color</color>

Looking for something else? check here:

🌈 Fonts customization

Our checkout uses REGULAR and LIGHT fonts declared here:

Meli UI

Fonts.setFonts(yourFontsPathsByType)

👨🏻‍💻 Author

Mercado Pago / Mercado Libre

👮🏻 License

MIT License

Copyright (c) 2018 - Mercado Pago / Mercado Libre

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You can’t perform that action at this time.