# MD for: https://www.mercadopago.com.co/developers/es/docs/checkout-pro/how-tos/improve-payment-approval/recommendations.md \# How to improve payment approval > RED\_MESSAGE > > This documentation is intended for integrators. If you are a buyer and your payment was rejected when using Mercado Pago, please check \[this article\](https://www.mercadopago.com.co/ayuda/26516) in our Help Center for guidance on how to proceed. To \*\*prevent a legitimate payment from being rejected\*\* due to not meeting security validations, you need to include as much information as possible when performing the operation and ensure that your checkout has an optimized interface. Below are our \*\*recommendations to improve your approval rate\*\*. :::::AccordionComponent{title="Get and send the Device ID"} The \*\*Device ID\*\* is important information to ensure better security and, consequently, a better payment approval rate. It is a \*\*unique identifier for each buyer's device\*\* at the time of purchase. If a frequent buyer makes a purchase from a different device than usual, this may be seen as atypical behavior. Although it may not necessarily be fraud, the device ID helps us refine the assessment and prevents us from rejecting legitimate payments. ::::TabsComponent :::TabComponent{title="Device ID in web applications"} To use the Device ID on the web and prevent potential fraudulent purchases, follow these steps: #### 1\. Add the Mercado Pago security script > WARNING > > If you are already using the \[Mercado Pago JS SDK\](https://www.mercadopago.com.co/developers/en/docs/sdks-library/client-side/mp-js-v2), you \*\*do not\*\* need to add the security code because the Device ID is obtained by default. In this case, proceed directly to the \[Device ID usage\](https://www.mercadopago.com.co/developers/en/docs/checkout-pro/how-tos/improve-payment-approval/recommendations#editor\_4#bookmark\_3.\_use\_the\_device\_id) step. To implement Device ID generation on your site, add this code to your checkout page: \`\`\`html \`\`\` #### 2\. Get the Device ID Once you have added the Mercado Pago security code to your site, a global \_Javascript\_ variable named \`MP\_DEVICE\_SESSION\_ID\` is automatically created, which contains the Device ID. If you prefer to use another variable, you can specify the name by adding the \`output\` attribute to the security \_script\_, like this: \`\`\`html \`\`\` You can also \*\*create your own variable\*\*. Just add an \`html\` tag to your site with the identifier \`id="deviceID"\`, like this: \`\`\`html \`\`\` #### 3\. Use the Device ID Once you have the Device ID value, you need to \*\*send it to our servers\*\* when creating a payment. You must add this \`header\` to your request and replace \`device\_id\` with the name of the variable where you stored your Device ID value. \`\`\`html X-meli-session-id: device\_id \`\`\` ::: :::TabComponent{title="Device ID in mobile applications"} If you have a native mobile application, you can capture the device information with our SDK and send it when creating the \_token\_. Follow these steps: #### 1\. Add the dependency According to your mobile application's operating system, add this dependency: * [android ](#editor%5F2) * [ios ](#editor%5F1) ios android Add this code to the **Podfile**. ``` use_frameworks! pod 'MercadoPagoDevicesSDK' ``` Copiar Add the repository and dependency to the **build.gradle** file. ``` repositories { maven { url "https://artifacts.mercadolibre.com/repository/android-releases" } } dependencies { implementation 'com.mercadolibre.android.device:sdk:4.0.1' } ``` Copiar \#### 2\. Initialize the module After adding the dependency, initialize the module using one of these languages: * [java ](#editor%5F5) * [objective-c ](#editor%5F4) * [swift ](#editor%5F3) swift objective-c java We recommend initializing the **AppDelegate** in the **didFinishLaunchingWithOptions** event. ``` import MercadoPagoDevicesSDK ... func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { ... MercadoPagoDevicesSDK.shared.execute() ... } ``` Copiar We recommend initializing the **AppDelegate** in the **didFinishLaunchingWithOptions** event. ``` @import 'MercadoPagoDevicesSDK'; ... - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... [[MercadoPagoDevicesSDK shared] execute]; ... } ``` Copiar We recommend initializing in the **MainApplication** class. ``` import com.mercadolibre.android.device.sdk.DeviceSDK; DeviceSDK.getInstance().execute(this); ``` Copiar \#### 3\. Capture the information Use any of these functions to get the information in the format you need: * [java ](#editor%5F8) * [objective-c ](#editor%5F7) * [swift ](#editor%5F6) swift objective-c java ``` MercadoPagoDevicesSDK.shared.getInfo() // Returns a Device object that is Encodable MercadoPagoDevicesSDK.shared.getInfoAsJson() // Returns a JSON object MercadoPagoDevicesSDK.shared.getInfoAsJsonString() // Returns the JSON as a String MercadoPagoDevicesSDK.shared.getInfoAsDictionary() // Returns a Dictionary object ``` Copiar ``` [[[MercadoPagoDevicesSDK] shared] getInfoAsJson] // Returns a JSON object [[[MercadoPagoDevicesSDK] shared] getInfoAsJsonString] // Returns the JSON as a String [[[MercadoPagoDevicesSDK] shared] getInfoAsDictionary] // Returns a Dictionary object ``` Copiar ``` Device device = DeviceSDK.getInstance().getInfo() // Returns a Device object, which is serializable Map deviceMap = DeviceSDK.getInstance().getInfoAsMap() // Returns a Map String jsonString = DeviceSDK.getInstance().getInfoAsJsonString() // Returns a String in JSON format ``` Copiar \#### 4\. Send the information Finally, send the information you obtained in the \`device\` field when creating the \`card\_token\`. \`\`\` { ... "device": { "fingerprint": { "os": "iOS", "system\_version": "8.3", "ram": 18446744071562067968, "disk\_space": 498876809216, "model": "MacBookPro9,2", "free\_disk\_space": 328918237184, "vendor\_ids": \[ { "name": "vendor\_id", "value": "C2508642-79CF-44E4-A205-284A4F4DE04C" }, { "name": "uuid", "value": "AB28738B-8DC2-4EC2-B514-3ACF330482B6" } \], "vendor\_specific\_attributes": { "feature\_flash": false, "can\_make\_phone\_calls": false, "can\_send\_sms": false, "video\_camera\_available": true, "cpu\_count": 4, "simulator": true, "device\_language": "en", "device\_idiom": "Phone", "platform": "x86\_64", "device\_name": "iPhone Simulator", "device\_family": 4, "retina\_display\_capable": true, "feature\_camera": false, "device\_model": "iPhone Simulator", "feature\_front\_camera": false }, "resolution": "375x667" } } } \`\`\` ::: :::: ::::: :::::AccordionComponent{title="Include all payment data"} To optimize payment security validation and improve approvals, it's important to \*\*send as much data as possible about the buyer and the product\*\*. Pay attention to all the attributes you can send to the :TagComponent{tag="API" text="Create preferences" href="/developers/en/reference/online-payments/checkout-pro/preferences/create-preference/post"}, especially in the additional information (\`additional\_info\`), such as \*\*buyer data\*\*, \*\*product details\*\*, and \*\*shipping information\*\*. To improve the efficiency of our fraud engine, we recommend submitting the \*\*industry data\*\* that corresponds to your business segment. You can find more details about each sector and the data we recommend including in the \[Industry Data\](https://www.mercadopago.com.co/developers/en/docs/checkout-pro/how-tos/improve-payment-approval/industry-data) documentation. ::::: :::::AccordionComponent{title="Improve your integration quality"} Before deploying your integration to a production environment, it's necessary to \*\*verify its quality\*\*, either manually or automatically. This will ensure that the integration meets Mercado Pago's quality and security standards and will provide actions to improve the approval rate. To measure quality, you need to perform an integration certification process. Check the \[How to measure integration quality\](https://www.mercadopago.com.co/developers/en/docs/checkout-pro/how-tos/integration-quality) documentation. ::::: :::::AccordionComponent{title="Increase your store's security"} Ensuring that your online store complies with the main security protocols for online transactions is necessary not only to improve payment approval rates but also to increase consumer confidence. Check out some recommended configurations to strengthen this confidence and protect your customers' sensitive information during the payment process: \* \*\*SSL Certificate:\*\* The Secure Sockets Layer ensures the encryption of personal and financial information during transactions, ensuring that all data exchanged between the server and client is protected and prevents leaks. \* \*\*HTTPS:\*\* The HyperText Transfer Protocol Secure is a security indicator for all your customers and ensures that all communication with the Mercado Pago API is done securely. \* \*\*Mercado Pago Wallet:\*\* Enabling payment through Mercado Pago’s wallet brings a range of benefits for both user experience and risk management. Since only logged-in users can use this option, we have access to more detailed information about the payer and the transaction context, allowing for even more efficient fraud prevention analysis thanks to the greater number of available variables. Additionally, payments made with account balance have significantly higher approval rates, as they are internal operations within the Mercado Pago ecosystem and are not subject to chargebacks. ::::: :::::AccordionComponent{title="Improve user experience"} In the event of a declined payment, notifying the user of the reason and highlighting the available alternatives is essential. In Checkout Pro, the experience is even more seamless, as the system offers additional payment attempts, allowing the customer to choose another way to complete the purchase. This approach not only helps to resolve the issue, but also demonstrates attentiveness and proximity in customer service. ::::: :::::AccordionComponent{title="Offer support to your customers"} Providing customers with an optimized store will contribute to the success of operations. For this, it's important to ensure that your team has a deep understanding of the system and its configurations. This knowledge will enable quick problem resolution and better service to different customer needs. This includes \*\*providing accessible and efficient support channels\*\* to help users who face difficulties during the payment process. This can be done through live chat, email, or phone. ::::: :::::AccordionComponent{title="Implement an identity verification mechanism"} It is recommended to implement advanced security mechanisms to protect online transactions. 3DS 2.0 authentication, for example, adds an extra layer of protection by allowing the user to validate their identity at the time of payment, significantly reducing the risk of fraud. For more details on how to integrate or activate 3DS 2.0 in Checkout Pro, please contact the commercial team. :::::