Configure development environment
To integrate your SmartApp with Point Smart, it is necessary to prepare the Point terminal environment so that the payment flow between your application and Mercado Pago works correctly.
Below, you will find the necessary configurations to make your SmartApp available.
Before starting your integration, update the debug terminal received with the kit with the sandbox version provided by the team responsible for your integration. After this update, the team will perform some internal configurations so that the terminal can operate correctly in the sandbox environment.
This is a simulation application designed to replicate and test the key functionalities of our SDK. This application allows you to simulate fundamental processes such as logging in with user and password credentials, as well as complete payment processing flows.
The installation process can be performed using adb (Android Debug Bridge) using the following command and replacing <APK_path> with the full path of the downloaded APK file.
bash
adb install <APK_path>
APK installation. This will ensure proper functioning of the simulation application and avoid possible conflicts.To use the simulation functionality, you need to install the APK with the sandbox flavor. This APK is available in the integration kit, from which you can download it. Once downloaded, you should install it on the terminal.
The development kit contains the necessary resources to integrate the payment flow using the Mercado Pago SDK.
With your application base developed and after the authorizations performed on the terminal, follow these steps:
- Add the Development Kit library to the
app/libsdirectory. - Install the demo version of the SmartApp to serve as a base for your integration. If you prefer, you can directly install your own SmartApp.
- Then, in the
.gradlefile of the module where you will use the SDK, include the dependency for the added library:
gradle
dependencies { .... implementation files("libs/nativesdk-0.1.0.aar") ... }
After defining which SmartApp will be integrated with the Point terminal, indicate in the AndroidManifest.xml file the main activity that will be set as the application's launcher.
Main Apps
Main Apps are business management applications that you can integrate with Point Smart and that will become the main interface of the terminal. In other words, the entire terminal operating system will have the Main Apps interface and you will be able to use the available functionalities (such as Bluetooth, scanner camera, etc.) to process payments.
To do this, add the following intent-filter in the XML file:
xml
<intent-filter> ... <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter>
Example of Manifest configuration.
xml
<application android:label="@string/app_name" android:icon="@mipmap/ic_launcher"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.HOME" /> </intent-filter> </activity> </application>
The metadata configuration in the AndroidManifest.xml file is fundamental to ensure the complete integration of the Mercado Pago SDK in your application.
This metadata is responsible for defining mandatory and customized configurations so that the SDK operates properly and, thus, ensures that your application better leverages payment functionalities and offers a consistent and optimized shopping experience.
Below you will see how to configure the mandatory and optional metadata in the AndroidManifest.xml.
The CLIENT_ID field is used to identify integrator transactions and must contain the value assigned to the application created in Mercado Pago. This field must be defined in the AndroidManifest.xml file according to the following example:
xml
<application ...> <meta-data android:name="com.mercadolibre.android.sdk.CLIENT_ID" android:value="CLIENT_ID_VALUE" /> <!-- Other application settings --> </application>
| Field | Description |
android:name | The metadata name must be exactly com.mercadolibre.android.sdk.CLIENT_ID. Any variation in the name will prevent its recognition by the SDK. |
android:value | The value must be the client_id assigned to the application and must mandatorily contain the letter L at the end of the number, indicating that it is of type Long. |
The OAUTH_ENABLED field activates the OAuth security protocol, necessary when terminals use accounts different from the application developer's main account. This field is optional for your own terminal integrationMercado Pago Point integrations to your system for your own use and configured using your application's production credentials. For more information, access the link below.Access credentials and required for a third-part integrationMercado Pago Point integrations to your system on behalf of a seller and configured using credentials obtained through the OAuth security protocol. For more information, access the link below.Access credentials. If not included a value, the default will be false.
xml
<application ...> <meta-data android:name="com.mercadolibre.android.sdk.OAUTH_ENABLED" android:value="true" /> <!-- Other application settings --> </application>
| Field | Description |
android:name | The metadata name must be exactly com.mercadolibre.android.sdk.OAUTH_ENABLED. Any variation in the name will prevent its recognition by the SDK. |
android:value | The value must be true or false, indicating whether the OAuth model is enabled or not. |
The PLATFORM_ID field is a unique code for each integration that identifies your application in our ecosystem, which facilitates detailed analysis and traceability of the payment flow. This field is optional if your integration does not fall under the concept of platforms, and mandatory if it does. If it is not mandatory, leaving this field blank will not affect the SDK’s functionality.
PLATFORM_ID, contact the team responsible for your integration.xml
<application ...> <meta-data android:name="com.mercadolibre.android.sdk.PLATFORM_ID" android:value="platform_id_value" /> <!-- Other application settings --> </application>
| Field | Description |
android:name | The metadata name must be exactly com.mercadolibre.android.sdk.PLATFORM_ID. Any variation in the name will prevent its recognition by the SDK. |
android:value | The value must contain the unique identifier of your integration in Mercado Pago. |
After running the development kit, including the SmartApp on the Point terminal and configuring the AndroidManifest file, configure the SDK responsible for the payment flow received in the application. To do this, create a class, inherited from the Application class, and include the SDK configuration as in the following example.
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
val config = MPConfigBuilder(this, "123456789")
.withBluetoothConfig()
.withBluetoothUIConfig()
.build()
MPManager.initialize(this, config)
}
}
public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
MPConfig config = new MPConfigBuilder(this, "CLIENT_ID")
.withBluetoothConfig()
.withBluetoothUIConfig()
.build();
MPManager.INSTANCE.initialize(this, config);
}
}
With the SDK configured, you can integrate the payment flow.