Installations avec intérêt (MCI)
Sur cette page
Les paiements mensuels avec intérêts sont une option de paiement qui permet à vos clients de diviser le coût d'un achat en plusieurs versements mensuels, avec des intérêts appliqués au solde impayé.
Avec MCI, un client paie un taux d'intérêt supplémentaire pour diviser le coût d'achat en versements mensuels.
Lorsqu'un client choisit de payer par mensualités avec intérêts, le coût total de l'achat est divisé en versements mensuels et les taux d'intérêt sont appliqués au solde restant pour chaque période.
Comment fonctionne le MCI#
Voici comment fonctionne un flux MCI:
- Le magasin configure les différentes options de paiement mensuel par PSP dans l'Admin DEUNA.
- Il est tenu compte des éléments suivants:
- La franchise de carte de crédit à laquelle elle s'applique.
- Le montant minimum respectif pour chaque versement configuré.
- L'intérêt qui s'applique à chaque franchise.
- La commande en magasin indique la disponibilité du MCI lorsqu'un client entre dans le BIN d'une carte.
- Le client choisit le paiement mensuel dans une liste figurant dans la caisse.
- L'opération est envoyée au PSP pour être traitée.
Mettre en œuvre l'ICM#
Pour utiliser MSI ou MCI, configurer au moins une campagne d'acomptes.
Pour offrir des options de versements :
- Générer les options de campagne
installments_type.
curl --location --request POST 'https://apigw.getduna.com/merchants/{merchant_id}/installments/campaigns' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
"name": "new campaign",
"description": "testing campaign MCI",
"status": "active",
"processors": [
{
"id": {processor_id},
"name": {processor_name}
}
],
// display_label_template is optional; that configuration allows you to
// change the format of the field "display_label_amount" of each available
'// option when you generate an installment plan. If you don`t configurate this'
'// field, the template will be the default one.'
"display_label_template": {
"language": "es",
"MSI": "{installments} meses sin intereses de ${amount}",
"MCI": "{installments} meses de ${amount}"
},
"options": [
{
"installments": 3,
"installments_type": "MCI",
"currency": "MXN",
"card_branch": [
{
// minimum amount for installment amount in the plan, this option
// will be valid to generate installment plan only in that case;
// For example, with a total amount of $2100; in 3 installments the amount
// will be of $700, so $700 >= $500, then the option is valid to
// generate an installment plan of $2100 (you can offer 3 installments
// to pay $2100). In the case of having intallments_rate greater than 0,
// first the interest is applied to the amount and then it is compared with the min_amount.
"amount_min": 500,
// optional, the same example than amount_min but with the maximum value.
"amount_max": 2000,
"name": "visa",
// is the percentage applied to the amount in order to generate the options for the plan.
"installment_rate": 1.5,
// use the operators "amount", "rate" and "installments" when calculate the new amount;
// if it's not specified, the calculation is the default for interests: "amount+(amount*(rate/100))"
"installments_interest_formula": "amount+((amount*rate*installments)/100)"
}
]
},
{
"installments": 6,
"installments_type": "MCI",
"currency": "MXN",
"card_branch": [
{
"amount_min": 250,
"amount_max": 1000,
"name": "visa",
}
]
}
// you can offer more options, the installments quantity must be divisible by 3.
]
}'const response = await fetch("https://apigw.getduna.com/merchants/{merchant_id}/installments/campaigns", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer {merchant_auth_token}"
},
body: "{\n \"name\": \"new campaign\",\n \"description\": \"testing campaign MCI\",\n \"status\": \"active\",\n \"processors\": [\n {\n \"id\": {processor_id},\n \"name\": {processor_name}\n }\n ],\n\t\t// display_label_template is optional; that configuration allows you to \n\t\t// change the format of the field \"display_label_amount\" of each available \n \t//"
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();import requests
response = requests.request(
"POST",
"https://apigw.getduna.com/merchants/{merchant_id}/installments/campaigns",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer {merchant_auth_token}"
},
data="{\n \"name\": \"new campaign\",\n \"description\": \"testing campaign MCI\",\n \"status\": \"active\",\n \"processors\": [\n {\n \"id\": {processor_id},\n \"name\": {processor_name}\n }\n ],\n\t\t// display_label_template is optional; that configuration allows you to \n\t\t// change the format of the field \"display_label_amount\" of each available \n \t//",
)
response.raise_for_status()
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.getduna.com/merchants/{merchant_id}/installments/campaigns",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Authorization: Bearer {merchant_auth_token}"
],
CURLOPT_POSTFIELDS => "{\n \"name\": \"new campaign\",\n \"description\": \"testing campaign MCI\",\n \"status\": \"active\",\n \"processors\": [\n {\n \"id\": {processor_id},\n \"name\": {processor_name}\n }\n ],\n\t\t// display_label_template is optional; that configuration allows you to \n\t\t// change the format of the field \"display_label_amount\" of each available \n \t//"
]);
$response = curl_exec($curl);
curl_close($curl);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://apigw.getduna.com/merchants/{merchant_id}/installments/campaigns"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer {merchant_auth_token}")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"new campaign\",\n \"description\": \"testing campaign MCI\",\n \"status\": \"active\",\n \"processors\": [\n {\n \"id\": {processor_id},\n \"name\": {processor_name}\n }\n ],\n\t\t// display_label_template is optional; that configuration allows you to \n\t\t// change the format of the field \"display_label_amount\" of each available \n \t//"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
request, err := http.NewRequest("POST", "https://apigw.getduna.com/merchants/{merchant_id}/installments/campaigns", strings.NewReader("{\n \"name\": \"new campaign\",\n \"description\": \"testing campaign MCI\",\n \"status\": \"active\",\n \"processors\": [\n {\n \"id\": {processor_id},\n \"name\": {processor_name}\n }\n ],\n\t\t// display_label_template is optional; that configuration allows you to \n\t\t// change the format of the field \"display_label_amount\" of each available \n \t//"))
if err != nil { panic(err) }
request.Header.Set("Content-Type", "application/json")
request.Header.Set("Authorization", "Bearer {merchant_auth_token}")
response, err := http.DefaultClient.Do(request)
if err != nil { panic(err) }
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}- Activer les processeurs de paiement de votre magasin pour effectuer des transactions avec le drapeau
allow_installments: true. Le comportement du drapeau est le suivant:"MCI" or null: Le montant qui est versé au transformateur n'a pas d'intérêt appliqué et la transaction doit être mise à jour après avoir été traitée avec l'intérêt appliqué par le transformateur. Les champs qui sont mis à jour en fonction de la réponse du processeur sont:amountinstallments_amountinstallments_rate
"MSI": Une transaction sans intérêt est effectuée contre le processeur qui effectue la transaction. Le montant atteint le processeur avec des intérêts calculés. Le montant est mis à jour avant d'effectuer la transaction et envoyé au transformateur.
Exemple pour créer le processeur
curl --location --request POST 'https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
"name": {processor_name},
"payment_processor_id": {processor_id},
"enabled": true,
"currency_iso3": "MXN",
"external_merchant_id": "your merchant id in payment processor",
"public_api_key": "your public key in payment processor",
"private_api_key": "your private key in payment processor",
"allow_installments": true,
"mci_to_psp_as": "MCI"|"MSI"
}'curl --location --request POST 'https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
"name": {processor_name},
"payment_processor_id": {processor_id},
"enabled": true,
"currency_iso3": "MXN",
"external_merchant_id": "your merchant id in payment processor",
"public_api_key": "your public key in payment processor",
"private_api_key": "your private key in payment processor",
"allow_installments": true,
"mci_to_psp_as": "MCI"|"MSI"
}'import requests
response = requests.request(
"POST",
"https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer {merchant_auth_token}"
},
data="{\n \"name\": {processor_name},\n \"payment_processor_id\": {processor_id},\n \"enabled\": true,\n \"currency_iso3\": \"MXN\",\n \"external_merchant_id\": \"your merchant id in payment processor\",\n \"public_api_key\": \"your public key in payment processor\",\n\t\t\"private_api_key\": \"your private key in payment processor\",\n \"allow_installments\": true,\n\t\t\"mci_to_psp_as\": \"MCI\"|\"MSI\"\n}",
)
response.raise_for_status()
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Authorization: Bearer {merchant_auth_token}"
],
CURLOPT_POSTFIELDS => "{\n \"name\": {processor_name},\n \"payment_processor_id\": {processor_id},\n \"enabled\": true,\n \"currency_iso3\": \"MXN\",\n \"external_merchant_id\": \"your merchant id in payment processor\",\n \"public_api_key\": \"your public key in payment processor\",\n\t\t\"private_api_key\": \"your private key in payment processor\",\n \"allow_installments\": true,\n\t\t\"mci_to_psp_as\": \"MCI\"|\"MSI\"\n}"
]);
$response = curl_exec($curl);
curl_close($curl);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer {merchant_auth_token}")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": {processor_name},\n \"payment_processor_id\": {processor_id},\n \"enabled\": true,\n \"currency_iso3\": \"MXN\",\n \"external_merchant_id\": \"your merchant id in payment processor\",\n \"public_api_key\": \"your public key in payment processor\",\n\t\t\"private_api_key\": \"your private key in payment processor\",\n \"allow_installments\": true,\n\t\t\"mci_to_psp_as\": \"MCI\"|\"MSI\"\n}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
request, err := http.NewRequest("POST", "https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors", strings.NewReader("{\n \"name\": {processor_name},\n \"payment_processor_id\": {processor_id},\n \"enabled\": true,\n \"currency_iso3\": \"MXN\",\n \"external_merchant_id\": \"your merchant id in payment processor\",\n \"public_api_key\": \"your public key in payment processor\",\n\t\t\"private_api_key\": \"your private key in payment processor\",\n \"allow_installments\": true,\n\t\t\"mci_to_psp_as\": \"MCI\"|\"MSI\"\n}"))
if err != nil { panic(err) }
request.Header.Set("Content-Type", "application/json")
request.Header.Set("Authorization", "Bearer {merchant_auth_token}")
response, err := http.DefaultClient.Do(request)
if err != nil { panic(err) }
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}Exemple pour mettre à jour le processeur
curl --location --request PATCH 'https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors/{merchant_payment_processor_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
"allow_installments": true,
"mci_to_psp_as": "MCI"|"MSI"
}'curl --location --request PATCH 'https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors/{merchant_payment_processor_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
"allow_installments": true,
"mci_to_psp_as": "MCI"|"MSI"
}'import requests
response = requests.request(
"PATCH",
"https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors/{merchant_payment_processor_id}",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer {merchant_auth_token}"
},
data="{\n \"allow_installments\": true,\n\t\t\"mci_to_psp_as\": \"MCI\"|\"MSI\"\n}",
)
response.raise_for_status()
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors/{merchant_payment_processor_id}",
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Authorization: Bearer {merchant_auth_token}"
],
CURLOPT_POSTFIELDS => "{\n \"allow_installments\": true,\n\t\t\"mci_to_psp_as\": \"MCI\"|\"MSI\"\n}"
]);
$response = curl_exec($curl);
curl_close($curl);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors/{merchant_payment_processor_id}"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer {merchant_auth_token}")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"allow_installments\": true,\n\t\t\"mci_to_psp_as\": \"MCI\"|\"MSI\"\n}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
request, err := http.NewRequest("PATCH", "https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors/{merchant_payment_processor_id}", strings.NewReader("{\n \"allow_installments\": true,\n\t\t\"mci_to_psp_as\": \"MCI\"|\"MSI\"\n}"))
if err != nil { panic(err) }
request.Header.Set("Content-Type", "application/json")
request.Header.Set("Authorization", "Bearer {merchant_auth_token}")
response, err := http.DefaultClient.Do(request)
if err != nil { panic(err) }
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}- Vérifiez si le magasin peut utiliser les échéances préconfigurées fournies par VTEX.
- Si pris en charge, les échéances obtenues auprès de VTEX doivent correspondre aux options de campagne et doivent déjà inclure les intérêts applicables.
- Sinon, DEUNA construit le plan d'échéance MCI à partir de la configuration de la campagne. Le montant dépend de :
installments_rate: S'applique directement au montant si noninstallments_interest_formulaest défini.installments_interest_formula: Si elle est spécifiée, elle définit le calcul des intérêts en fonction de :amountrateinstallments
- Configurez le paramètre DEUNA en fonction des acomptes activés dans VTEX.
- Créer un paramètre externe, en précisant qu'il est pour MCI.
- Si vous ne configurez pas le paramètre, alors un paramètre par défaut est utilisé pour le cas.
curl --location 'https://apigw.getduna.com/merchants/{merchant_id}/external-endpoints' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
"url": "https://middleware.deuna.io/api/v1/merchants/{merchant_id}/transactions/{transaction_id}/installments/mci?bin={bin}&salesChannel=1&paymentProcessors=t1pagos",
"http_method": "GET",
"headers": [
{
"key": "vtex-key-header",
"value": "vtex-value-header"
}
],
"config_type": "MCI"
}'curl --location 'https://apigw.getduna.com/merchants/{merchant_id}/external-endpoints' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
"url": "https://middleware.deuna.io/api/v1/merchants/{merchant_id}/transactions/{transaction_id}/installments/mci?bin={bin}&salesChannel=1&paymentProcessors=t1pagos",
"http_method": "GET",
"headers": [
{
"key": "vtex-key-header",
"value": "vtex-value-header"
}
],
"config_type": "MCI"
}'import requests
response = requests.request(
"POST",
"https://apigw.getduna.com/merchants/{merchant_id}/external-endpoints",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer {merchant_auth_token}"
},
json={
"url": "https://middleware.deuna.io/api/v1/merchants/{merchant_id}/transactions/{transaction_id}/installments/mci?bin={bin}&salesChannel=1&paymentProcessors=t1pagos",
"http_method": "GET",
"headers": [
{
"key": "vtex-key-header",
"value": "vtex-value-header"
}
],
"config_type": "MCI"
},
)
response.raise_for_status()
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.getduna.com/merchants/{merchant_id}/external-endpoints",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Authorization: Bearer {merchant_auth_token}"
],
CURLOPT_POSTFIELDS => json_encode([
"url" => "https://middleware.deuna.io/api/v1/merchants/{merchant_id}/transactions/{transaction_id}/installments/mci?bin={bin}&salesChannel=1&paymentProcessors=t1pagos",
"http_method" => "GET",
"headers" => [
[
"key" => "vtex-key-header",
"value" => "vtex-value-header"
]
],
"config_type" => "MCI"
])
]);
$response = curl_exec($curl);
curl_close($curl);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://apigw.getduna.com/merchants/{merchant_id}/external-endpoints"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer {merchant_auth_token}")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"url\": \"https://middleware.deuna.io/api/v1/merchants/{merchant_id}/transactions/{transaction_id}/installments/mci?bin={bin}&salesChannel=1&paymentProcessors=t1pagos\",\n \"http_method\": \"GET\",\n \"headers\": [\n {\n \"key\": \"vtex-key-header\",\n \"value\": \"vtex-value-header\"\n }\n ],\n \"config_type\": \"MCI\"\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
request, err := http.NewRequest("POST", "https://apigw.getduna.com/merchants/{merchant_id}/external-endpoints", strings.NewReader("{\n \"url\": \"https://middleware.deuna.io/api/v1/merchants/{merchant_id}/transactions/{transaction_id}/installments/mci?bin={bin}&salesChannel=1&paymentProcessors=t1pagos\",\n \"http_method\": \"GET\",\n \"headers\": [\n {\n \"key\": \"vtex-key-header\",\n \"value\": \"vtex-value-header\"\n }\n ],\n \"config_type\": \"MCI\"\n }"))
if err != nil { panic(err) }
request.Header.Set("Content-Type", "application/json")
request.Header.Set("Authorization", "Bearer {merchant_auth_token}")
response, err := http.DefaultClient.Do(request)
if err != nil { panic(err) }
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}- Options de requête.
curl --location --request GET 'https://apigw.getduna.com/merchants/transactions/orders/{orden_token}/installments?bin={card_bin}'
--header 'x-api-key: {x_api_key}'
--header 'Authorization: Bearer {merchant_auth_token}'curl --location --request GET 'https://apigw.getduna.com/merchants/transactions/orders/{orden_token}/installments?bin={card_bin}'
--header 'x-api-key: {x_api_key}'
--header 'Authorization: Bearer {merchant_auth_token}'import requests
response = requests.request(
"GET",
"https://apigw.getduna.com/merchants/transactions/orders/{orden_token}/installments?bin={card_bin}",
headers={
"x-api-key": "{x_api_key}",
"Authorization": "Bearer {merchant_auth_token}"
},
)
response.raise_for_status()
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigw.getduna.com/merchants/transactions/orders/{orden_token}/installments?bin={card_bin}",
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"x-api-key: {x_api_key}",
"Authorization: Bearer {merchant_auth_token}"
]
]);
$response = curl_exec($curl);
curl_close($curl);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://apigw.getduna.com/merchants/transactions/orders/{orden_token}/installments?bin={card_bin}"))
.header("x-api-key", "{x_api_key}")
.header("Authorization", "Bearer {merchant_auth_token}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
)
func main() {
request, err := http.NewRequest("GET", "https://apigw.getduna.com/merchants/transactions/orders/{orden_token}/installments?bin={card_bin}", nil)
if err != nil { panic(err) }
request.Header.Set("x-api-key", "{x_api_key}")
request.Header.Set("Authorization", "Bearer {merchant_auth_token}")
response, err := http.DefaultClient.Do(request)
if err != nil { panic(err) }
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}- Sélectionnez une option d'acompte.
- Faites l'achat avec l'option de versement.
curl --location --request POST 'https://api.sandbox.deuna.io/v2/merchants/orders/purchase' \
--header 'x-api-key: {x_api_key}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {user_auth_token}' \
--data-raw '{
"order_token": "{order_token}",
"payer_info": {
"email": "test123@testuser.com"
},
"payment_source": {
"method_type": "credit_card",
"processor": "{processor_name}",
"card_info": {
"expiry_month": "11",
"expiry_year": "2028",
"card_holder": "DEUNA Developers",
"card_holder_dni": "185396924",
"card_number": "4111111111111111",
"card_cvv": "123",
"address1": "Vergara 548",
"zip": "001100",
"city": "Santiago",
"state": "RM",
"country": "CL",
"phone": "12345755",
"installment": {
"plan_option_id": "{plan_option_id}"
}
}
}
}'curl --location --request POST 'https://api.sandbox.deuna.io/v2/merchants/orders/purchase' \
--header 'x-api-key: {x_api_key}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {user_auth_token}' \
--data-raw '{
"order_token": "{order_token}",
"payer_info": {
"email": "test123@testuser.com"
},
"payment_source": {
"method_type": "credit_card",
"processor": "{processor_name}",
"card_info": {
"expiry_month": "11",
"expiry_year": "2028",
"card_holder": "DEUNA Developers",
"card_holder_dni": "185396924",
"card_number": "4111111111111111",
"card_cvv": "123",
"address1": "Vergara 548",
"zip": "001100",
"city": "Santiago",
"state": "RM",
"country": "CL",
"phone": "12345755",
"installment": {
"plan_option_id": "{plan_option_id}"
}
}
}
}'import requests
response = requests.request(
"POST",
"https://api.sandbox.deuna.io/v2/merchants/orders/purchase",
headers={
"x-api-key": "{x_api_key}",
"Content-Type": "application/json",
"Authorization": "Bearer {user_auth_token}"
},
json={
"order_token": "{order_token}",
"payer_info": {
"email": "test123@testuser.com"
},
"payment_source": {
"method_type": "credit_card",
"processor": "{processor_name}",
"card_info": {
"expiry_month": "11",
"expiry_year": "2028",
"card_holder": "DEUNA Developers",
"card_holder_dni": "185396924",
"card_number": "4111111111111111",
"card_cvv": "123",
"address1": "Vergara 548",
"zip": "001100",
"city": "Santiago",
"state": "RM",
"country": "CL",
"phone": "12345755",
"installment": {
"plan_option_id": "{plan_option_id}"
}
}
}
},
)
response.raise_for_status()
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.deuna.io/v2/merchants/orders/purchase",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"x-api-key: {x_api_key}",
"Content-Type: application/json",
"Authorization: Bearer {user_auth_token}"
],
CURLOPT_POSTFIELDS => json_encode([
"order_token" => "{order_token}",
"payer_info" => [
"email" => "test123@testuser.com"
],
"payment_source" => [
"method_type" => "credit_card",
"processor" => "{processor_name}",
"card_info" => [
"expiry_month" => "11",
"expiry_year" => "2028",
"card_holder" => "DEUNA Developers",
"card_holder_dni" => "185396924",
"card_number" => "4111111111111111",
"card_cvv" => "123",
"address1" => "Vergara 548",
"zip" => "001100",
"city" => "Santiago",
"state" => "RM",
"country" => "CL",
"phone" => "12345755",
"installment" => [
"plan_option_id" => "{plan_option_id}"
]
]
]
])
]);
$response = curl_exec($curl);
curl_close($curl);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sandbox.deuna.io/v2/merchants/orders/purchase"))
.header("x-api-key", "{x_api_key}")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer {user_auth_token}")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"order_token\": \"{order_token}\",\n \"payer_info\": {\n \"email\": \"test123@testuser.com\"\n },\n \"payment_source\": {\n \"method_type\": \"credit_card\",\n \"processor\": \"{processor_name}\",\n \"card_info\": {\n \"expiry_month\": \"11\",\n \"expiry_year\": \"2028\",\n \"card_holder\": \"DEUNA Developers\",\n \"card_holder_dni\": \"185396924\",\n \"card_number\": \"4111111111111111\",\n \"card_cvv\": \"123\",\n \"address1\": \"Vergara 548\",\n \"zip\": \"001100\",\n \"city\": \"Santiago\",\n \"state\": \"RM\",\n \"country\": \"CL\",\n \"phone\": \"12345755\",\n \"installment\": {\n \"plan_option_id\": \"{plan_option_id}\"\n }\n }\n }\n}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
request, err := http.NewRequest("POST", "https://api.sandbox.deuna.io/v2/merchants/orders/purchase", strings.NewReader("{\n \"order_token\": \"{order_token}\",\n \"payer_info\": {\n \"email\": \"test123@testuser.com\"\n },\n \"payment_source\": {\n \"method_type\": \"credit_card\",\n \"processor\": \"{processor_name}\",\n \"card_info\": {\n \"expiry_month\": \"11\",\n \"expiry_year\": \"2028\",\n \"card_holder\": \"DEUNA Developers\",\n \"card_holder_dni\": \"185396924\",\n \"card_number\": \"4111111111111111\",\n \"card_cvv\": \"123\",\n \"address1\": \"Vergara 548\",\n \"zip\": \"001100\",\n \"city\": \"Santiago\",\n \"state\": \"RM\",\n \"country\": \"CL\",\n \"phone\": \"12345755\",\n \"installment\": {\n \"plan_option_id\": \"{plan_option_id}\"\n }\n }\n }\n}"))
if err != nil { panic(err) }
request.Header.Set("x-api-key", "{x_api_key}")
request.Header.Set("Content-Type", "application/json")
request.Header.Set("Authorization", "Bearer {user_auth_token}")
response, err := http.DefaultClient.Do(request)
if err != nil { panic(err) }
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}Essai MCI#
Pour créer la campagne, il est nécessaire de :
- Soyez authentifié en tant que marchand.
- Configurez les processeurs qui offrent des acomptes.
- Les transformateurs doivent avoir l'identité et le nom de l'écosystème DEUNA.
Exemple
{
"processors": [
{
"id": 39,
"name": "mercadopago"
}
]
}La même campagne doit avoir ses options avec "installments_type": "MCI".
Exemple
{
"options": [
{
"installments": 3,
"installments_type": "MCI",
"currency": "MXN",
"card_branch": [
...
]
}
]
}Dans card_branch, les "name" peut être:
visamastercardamex
Codes de réponse attendus
- 201 : Création réussie de la campagne.
- 401 : Non autorisé à créer la campagne.
- 400: Demande non valable.
Pour créer des processeurs de paiement marchands, vous devez :
- Authentifier comme marchand.
- Avoir les pouvoirs nécessaires pour effectuer des transactions de versements.
Installation avec VTEX
Vérifiez la disponibilité de MCI pour le magasin VTEX requis auprès de votre représentant DEUNA avant de tester la récupération des échéances.
Le représentant DEUNA confirmera le magasin éligible, la campagne, les connexions de processeurs et si les valeurs d'échéance fournies par VTEX ou le calcul de la campagne DEUNA sont autoritaires.
Si vous avez besoin d'une configuration supplémentaire pour configurer un paramètre avec des références spécifiques pour VTEX, vous devez créer un paramètre externe.
Codes de réponse attendus
- 200: Création réussie d'un paramètre externe.
- 401 : Non autorisé à créer un paramètre externe.
- 400: Demande non valable.
Demandes de renseignements
Interrogez le plan d'acompte avec le BIN de la carte après avoir créé une commande.
Codes de réponse attendus
- 200 : Récupérer avec succès le plan des versements.
- 401 : Non autorisé à créer un processeur de paiement marchand.
- 400: Demande non valable.
- 404: Aucun processeur de paiement marchand configuré correctement.
Cartes de test
Fournir toutes les données de la carte de test du processeur.
En général, les données sont les suivantes:
"card_number""card_cvv""expiry_year""expiry_month""card_holder"
Codes de réponse attendus
- 200 : Opération réussie.
- 401 : L'utilisateur n'est pas autorisé à effectuer l'achat.
- 400: Demande non valide, telle que le marchand n'ayant pas permis aux transformateurs de paiement marchands.
- 422: La transaction ne pouvait pas être effectuée parce que le processeur l'avait refusée.