Estoy intentando recibir las notificaciones IPN de mercado pago, pero no las recibo, para empezar estoy intentando enviarme un email (tengo perfectamente configurado mi localhost para poder hacerlo) al notificar que el pago se realizo con éxito.
Estoy usando usuarios de prueba que, según la documentación, es perfectamente factible usarlos y enviar notificaciones ipn.
Entiendo que este tipo de notificaciones se comunican con mi página php y ejecutan el script estando yo fuera de línea, quizás me confundo...
Usé el ejemplo que tiene mercado pago en su documentación, en mi página notificacion.php
integre el ejemplo:
<?phprequire_once "mercadopago.php";$mp = new MP("usuario de prueba id", "usuario de prueba SECRET");if (!isset($_GET["id"], $_GET["topic"]) || !ctype_digit($_GET["id"])) {http_response_code(400);return;}// Get the payment and the corresponding merchant_order reported by the IPN.if($_GET["topic"] == 'payment'){$payment_info = $mp->get("/collections/notifications/" . $_GET["id"]);$merchant_order_info = $mp->get("/merchant_orders/" . $payment_info["response"]["collection"]["merchant_order_id"]);// Get the merchant_order reported by the IPN.} else if($_GET["topic"] == 'merchant_order'){$merchant_order_info = $mp->get("/merchant_orders/" . $_GET["id"]);}if ($merchant_order_info["status"] == 200) {// If the payment's transaction amount is equal (or bigger) than the merchant_order's amount you can release your items $paid_amount = 0;//AQUI ENVIO EL MAIL !!!mail("mcd77.1990@gmail.com", "prueba notificacion", "hola mundo");foreach ($merchant_order_info["response"]["payments"] as $payment) { if ($payment['status'] == 'approved'){ $paid_amount += $payment['transaction_amount']; } }if($paid_amount >= $merchant_order_info["response"]["total_amount"]){ if(count($merchant_order_info["response"]["shipments"]) > 0) { // The merchant_order has shipments if($merchant_order_info["response"]["shipments"][0]["status"] == "ready_to_ship"){ print_r("Totally paid. Print the label and release your item."); } } else { // The merchant_order don't has any shipments print_r("Totally paid. Release your item."); }} else { print_r("Not paid yet. Do not release your item.");}}?>