I am trying to start with the integration of MercadoPago in a new project, but it turns out that after doing it with Nuget (without error), then every example code that I paste marks me with error, even doing a MercadoPago import; What can be my mistake?
However, in PHP I have not had any problems.
I would like to know if, apart from this, someone can help me to replicate the following PHP code but in asp.net c #
<?php
require_once ('lib/mercadopago.php');
$mp = new MP('xxxxx', 'xxxxxxx');
$item_descripcion = $_POST['descripcion'];
$item_precio = $_POST['precio'];
$item_cantidad = $_POST['cantidad'];
$preference_data = array(
"items" => array(
array(
"title" => $item_descripcion,
"quantity" => $item_cantidad,
"currency_id" => "ARS", // Available currencies at: https://api.mercadopago.com/currencies
"unit_price" => $item_precio
)
)
);
$preference = $mp->create_preference($preference_data);
?>
<!DOCTYPE html>
<html>
<head>
<title>Pay</title>
</head>
<body>
<a href="<?php echo $preference['response']['init_point']; ?>">Pagar</a>
</body>
</html>
From already thank you very much. Greetings to all!