Skip to content

Commit

Permalink
Merge pull request #2552 from mercadopago/feature/qr-interoperable
Browse files Browse the repository at this point in the history
feature/qr-interoperable
  • Loading branch information
hgaldino authored Feb 7, 2025
2 parents fb1f760 + 00e9008 commit 5001ac7
Show file tree
Hide file tree
Showing 22 changed files with 1,286 additions and 0 deletions.
118 changes: 118 additions & 0 deletions guides/qr-code/interoperable-accepting-flow-configuration.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Configure environment

Follow the steps below to configure the environment that will allow you to operate with Mercado Pago QR codes in acceptor flow.

## 1. Create business account and application in Mercado Pago

To start the configuration process, it is necessary to have a business account in Mercado Pago, which will allow you to create an application in [Mercado Pago Developers](https://www.mercadopago.com.ar/developers/en).

To create your business account, visit our [registration page](https://www.mercadopago.com.ar/hub/registration/landing) and fill out the requested information with the details of the digital wallet you represent.

Then, go to [Mercado Pago Developers](https://www.mercadopago.com.ar/developers/en), log in with the business account corresponding to the wallet, and access [Your Integrations](/developers/panel/app) in the upper right corner of the screen.

![Home Mercado Pago Developers](/images/qr/developers-your-integrations-es.png)

On the next screen, click on the **Create Application** button.

![Create Application](/images/dashboard/dashboard-es.png)

This will redirect you to the Basic Settings screen, where you need to fill out the requested information as indicated below:
* **Application Name**: choose a name for the application, associated with the wallet for which you are creating it. You have a limit of 50 characters.
* As a **payment solution** to integrate, select **In-person payments**.
* When selecting the **product to integrate**, choose **QR Code**.
* **It is not** necessary to select the **integration model**.

![Application for QR Code](/images/qr/application-qr-es.png)

Finally, check the box to authorize the use of your personal data according to the [Privacy Statement](https://www.mercadopago.com.ar/privacidad) and certify that your account uses Mercado Pago tools in accordance with the [Terms and Conditions](/developers/en/docs/resources/legal/terms-and-conditions), as well as the **I am not a robot** checkbox, and click **Create Application**.

This will automatically generate a card in [Your Integrations](/developers/panel/app) with the name and number of the application, allowing you to access its details when necessary.


## 2. Request registration and incorporation of the wallet

To continue with the configuration of the interoperable QR, it is necessary for the digital wallet to request registration and its incorporation into Mercado Pago.

To do this, you must contact our [Help Center](https://www.mercadopago.com.ar/ayuda/chat/v2?hasCreditRestriction=false) and request that you require support for the configuration of the interoperable QR acceptor flow, providing the following information.

| Field | Description |
|---|---|
| `identifier` | Commercial name of the digital wallet, as it is known in the market. |
| `application_id` | This is the identifier of the application created for the digital wallet. You can find it as **Application Number** within [Application Details](https://www.mercadopago.com.ar/developers/panel/app). |
| `user_business_id` | Identifier of the user who created the application for the digital wallet. You can find it as **User ID** within [Application Details](https://www.mercadopago.com.ar/developers/panel/app). |

With this information, our Support team will manage the incorporation of the wallet and will subsequently confirm its registration.

## 3. Obtain Credentials

To use Mercado Pago APIs, it is necessary to obtain credentials through the [OAuth](/developers/en/docs/qr-code/additional-content/security/oauth/introduction) flow. This way, you can create an Access Token that will allow you to securely access the resources of the application created.

To obtain it, follow the steps below.
1. Within [Your Integrations](https://www.mercadopago.com.ar/developers/panel/app), select the application created for the digital wallet.
2. In the menu displayed on the left side of the screen, select the **Production Credentials** option.
3. Locate the [Client ID and Client Secret](/developers/en/docs/qr-code/additional-content/your-integrations/credentials#:~:text=solution%20being%20integrated.-,Client%20ID%20and%20Client%20Secret,-The%20Client%20ID), which you will use to generate the Access Token via the OAuth flow, as shown in the following image.

![Client ID and Client Secret](/images/qr/interoperable-credentials-es.png)

> WARNING
>
> Important
>
> **Do not** use the Public Key and Access Token credentials shown in the Panel, as they do not correspond to integrations that use the OAuth protocol.
4. Send a **POST** request to the endpoint [/oauth/token](/developers/en/reference/oauth/_oauth_token/post) with the required parameters described below to generate your Access Token.

```curl
curl --location 'https://api.mercadopago.com/oauth/token' \
--header 'Content-Type: application/json' \
--data '{
"client_id": "{CLIENT_ID}",
"client_secret": "{CLIENT_SECRET}",
"grant_type": "client_credentials"
}'
````
| Field | Description |
|---|---|
| `client_id` | Copy and paste the value assigned to the Client ID in the **Credentials** section within "Your Integrations." |
| `client_secret` | Copy and paste the value assigned to the Client Secret in the **Credentials** section within "Your Integrations." |
| `grant_type` | The OAuth protocol allows obtaining an Access Token through different [access flows (grant types)](/developers/en/docs/qr-code/additional-content/security/oauth/introduction#accessflowsgranttypes). In this case, you must fill the field with the value `client_credentials`, which allows you to obtain it to access your own resources. More information about this flow can be found in [Get Access Token](/developers/en/docs/qr-code/additional-content/security/oauth/creation#bookmark_client_credentials). |
In the response to your request, you will receive, among other parameters, your **Access Token**, which you should use in the calls to Mercado Pago APIs once you have the registration of the wallet granted by our Support team.
```json
{
"access_token": "{ACCESS_TOKEN}",
"token_type": "Bearer",
"expires_in": 21600,
"scope": "offline_access read write",
"user_id": {USER_ID},
"live_mode": true
}
```

> WARNING
>
> Important
>
> The Access Token generated through the Client Credentials flow will expire in **6 hours (21600 seconds)** after being created. Renew it before expiration by sending a new request to the endpoint [/oauth/token](/developers/en/reference/oauth/_oauth_token/post) to avoid failures in your transactions.
## 4. Configure Webhook Notifications (exclusive for credit card payments)

When configuring the interoperability of Mercado Pago QR Codes, it is also possible to set up [Webhook notifications](/developers/en/docs/qr-code/additional-content/your-integrations/notifications/webhooks) for credit cards payments.

> WARNING
>
> Important
>
> The configuration of notifications for credit card interoperability will only be possible if the incorporation of the digital wallet into the Mercado Pago system has already been completed. If you have not yet received confirmation from our Support team, you must wait.
To do this, follow the steps below.
1. Access [Your Integrations](https://www.mercadopago.com.ar/developers/panel/app) and select the application created for the digital wallet.
2. In the menu displayed on the left side of the screen, select the option **Notifications > Webhooks**.
3. In the **Production Mode** tab, provide the URL that will be used to receive notifications.
4. In **Events**, choose the option **Payments (credit card interoperability)**.

![Webhook Configuration](/images/dashboard/webhooks-es.png)

5. Click on **Save** and confirm it on the next screen.
118 changes: 118 additions & 0 deletions guides/qr-code/interoperable-accepting-flow-configuration.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Configurar entorno

Sigue los pasos a continuación para configurar el entorno que te permitirá operar con códigos QR de Mercado Pago de flujo aceptador.

## 1. Crear cuenta empresa y aplicación en Mercado Pago

Para iniciar el proceso de configuración, es necesario tener una cuenta empresa en Mercado Pago, que te permitirá crear una aplicación en [Mercado Pago Developers](https://www.mercadopago.com.ar/developers/es).

Para crear tu cuenta empresa, ingresa a nuestra [página de registro](https://www.mercadopago.com.ar/hub/registration/landing) y completa los datos solicitados con la información de la billetera digital que representas.

Luego, ingresa a [Mercado Pago Developers](https://www.mercadopago.com.ar/developers/es), inicia sesión con la cuenta empresa correspondiente a la billetera, y accede a [Tus integraciones](/developers/panel/app) en la esquina superior derecha de la pantalla.

![Home Mercado Pago Developers](/images/qr/developers-your-integrations-es.png)

En la pantalla siguiente, haz clic en el botón **Crear aplicación**.

![crear aplicación](/images/dashboard/dashboard-es.png)

Esto te redireccionará a la pantalla Configuraciones básicas, donde deberás completar la información solicitada tal como señalamos a continuación:
* **Nombre de la aplicación**: elige un nombre para la aplicación, asociado con la billetera para la que la estás creando. Tienes un límite de 50 caracteres.
* Como **solución de pago** a integrar, elige la opción **Pagos presenciales**.
* En la pregunta por el **producto a integrar**, selecciona la opción **CódigoQR**.
* **No** es necesario que selecciones el **modelo de integración**.

![aplicación para Código QR](/images/qr/application-qr-es.png)

Por último, marca la casilla para autorizar el uso de tus datos personales de acuerdo con la [Declaración de Privacidad](https://www.mercadopago.com.ar/privacidad) y certificar que tu cuenta utiliza las herramientas de Mercado Pago de acuerdo con los [Términos y Condiciones](/developers/es/docs/resources/legal/terms-and-conditions), así como la casilla de selección **No soy un robot**, y haz clic en **Crear aplicación**.

Esto generará automáticamente una tarjeta en [Tus integraciones](/developers/panel/app) con el nombre y el número de la aplicación, que te permitirá acceder a sus detalles cuando sea necesario.


## 2. Solicitar alta e incorporación de la billetera

Para continuar con la configuración del QR interoperable, es necesario que la billetera digital solicite el alta y su incorporación a Mercado Pago.

Para ello, debes comunicarte con nuestro [Centro de ayuda](https://www.mercadopago.com.ar/ayuda/chat/v2?hasCreditRestriction=false) y solicitar que requieres apoyo para la configuración del flujo aceptador de QR interoperable, proporcionando la siguiente información.

| Dato | Descripción |
|---|---|
| `identifier` | Nombre comercial de la billetera digital, como es conocida en el mercado. |
| `application_id` | Es el identificador de la aplicación creada para la billetera digital. Puedes encontrarlo como **Número de aplicación** dentro de [Detalles de la Aplicación](https://www.mercadopago.com.ar/developers/panel/app). |
| `user_business_id` | Identificador del usuario creador de la aplicación para la billetera digital. Puedes encontrarlo como **User ID** dentro de [Detalles de la Aplicación](https://www.mercadopago.com.ar/developers/panel/app). |

Con estos datos, nuestro equipo de Soporte gestionará la incorporación de la billetera y confirmará posteriormente su alta.

## 3. Obtener credenciales

Para poder utilizar las APIs de Mercado Pago, es necesario obtener las credenciales a través del flujo [OAuth](/developers/es/docs/qr-code/additional-content/security/oauth/introduction). De esta manera, podrás crear un Access Token que te permitirá acceder a los recursos de la aplicación creada de manera segura.

Para obtenerlo, sigue los pasos a continuación.
1. Dentro de [Tus integraciones](https://www.mercadopago.com.ar/developers/panel/app), selecciona la aplicación creada para la billetera digital.
2. En el menú desplegado a la izquierda de la pantalla, selecciona la opción **Credenciales de producción**.
3. Localiza las credenciales [Client ID y Client Secret](/developers/es/docs/qr-code/additional-content/your-integrations/credentials#:~:text=se%20est%C3%A1%20integrando.-,Client%20ID%20y%20Client%20Secret,-El%20Client%20ID), que deberás utilizar para generar el Access Token mediante el flujo OAuth, tal como se muestra en la siguiente imagen.

![client ID y client secret](/images/qr/interoperable-credentials-es.png)

> WARNING
>
> Importante
>
> **No** debes utilizar las credenciales Public Key y Access Token que se muestran en el Panel, ya que no corresponden a integraciones que utilizan el protocolo OAuth.
4. Envía un **POST** al endpoint [/oauth/token](/developers/es/reference/oauth/_oauth_token/post) con los parámetros obligatorios descritos a continuación para generar tu Access Token.

```curl
curl --location 'https://api.mercadopago.com/oauth/token' \
--header 'Content-Type: application/json' \
--data '{
"client_id": "{CLIENT_ID}",
"client_secret": "{CLIENT_SECRET}",
"grant_type": "client_credentials"
}'
```

| Campo | Descripción |
|---|---|
| `client_id` | Copia y pega el valor asignado al Client ID en la sección **Credenciales** dentro de “Tus integraciones". |
| `client_secret` | Copia y pega el valor asignado al Client Secret en la sección **Credenciales** dentro de “Tus integraciones”. |
| `grant_type` | El protocolo OAuth permite obtener un Access Token a través de distintos [flujos de acceso (*grant types*)](/developers/es/docs/qr-code/additional-content/security/oauth/introduction#flujosdeaccesogranttypes). En este caso, debes completar el campo con el valor `client_credentials`, que permite obtenerlo para acceder a tus propios recursos. Consulta más información sobre este flujo en [Obtener Access Token](/developers/es/docs/qr-code/additional-content/security/oauth/creation#bookmark_client_credentials). |

En la respuesta a la solicitud obtendrás, entre otros parámetros, tu **Access Token**, que deberás utilizar en los llamados a las APIs de Mercado Pago que realices una vez que cuentes con el alta de la billetera, otorgada por nuestro equipo de Soporte.

```json
{
"access_token": "{ACCESS_TOKEN}",
"token_type": "Bearer",
"expires_in": 21600,
"scope": "offline_access read write",
"user_id": {USER_ID},
"live_mode": true
}
```

> WARNING
>
> Importante
>
> El Access Token generado por medio del flujo Client Credentials caducará a las **6 horas (21600 segundos)** de haber sido creado. Renuévalo previo a su expiración mediante un nuevo llamado al endpoint [/oauth/token](/developers/es/reference/oauth/_oauth_token/post) y evita fallos en tus transacciones.
## 4. Configurar notificaciones Webhooks (exclusivo para pagos con tarjeta de crédito)

Al configurar la interoperabilidad de los Códigos QR de Mercado Pago, es posible también configurar la recepción de [notificaciones Webhooks](/developers/es/docs/qr-code/additional-content/your-integrations/notifications/webhooks) para los pagos realizados con tarjeta de crédito.

> WARNING
>
> Importante
>
> La configuración de notificaciones para interoperabilidad de tarjetas de crédito sólo será posible si ya fue realizada la incorporación de la billetera digital en el sistema de Mercado Pago. Si todavía no has recibido la confirmación de nuestro equipo de Soporte, debes aguardar.
Para hacerlo, sigue los pasos a continuación.
1. Accede a [Tus integraciones](https://www.mercadopago.com.ar/developers/panel/app) y selecciona la aplicación creada para la billetera digital.
2. En el menú desplegado a la izquierda de la pantalla, selecciona la opción **Notificaciones > Webhooks**.
3. En la pestaña **Modo producción**, proporciona la URL que será utilizada para recibir las notificaciones.
4. En **Eventos**, elige la opción **Pagos (interoperabilidad de tarjetas de crédito)**.

![configuración de Webhooks](/images/dashboard/webhooks-es.png)

5. Haz clic en **Guardar** y confírmalo en la pantalla siguiente.
Loading

0 comments on commit 5001ac7

Please sign in to comment.