<?php
ini_set('log_errors', true);
ini_set('error_log', dirname(__FILE__).'/ipn_errors.log');
require_once "mercadopago.php";
$mp = new MP('xxxxxxxxxxxxxx', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
// Get the payment reported by the IPN. Glossary of attributes response in https://developers.mercadopago.com
$payment_info = $mp->get_payment_info($_GET["id"]);
// Show payment information
if ($payment_info["status"] == 200) {
error_log($payment_info["status"]);
}
error_log($payment_info["response"]["collection"]["status"]);
?>
Pergunta
rafaeldorazio
Todos os exemplos foram retirados do MERCADO PAGO.
Mas quando eu recebo no ipn.php os dados da compra, o status está vindo como R.
Caso eu teste o envio dos dados IPN do mercadopago https://www.mercadop...as/notificacoes funciona.
<?php require_once ('mercadopago/mercadopago.php'); $mp = new MP('xxxxxxxx', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx'); $preference = array( "items" => array( array( "title" => "sdk-php", "quantity" => 1, "currency_id" => "ARS", "unit_price" => 10.2 ) ) ); $mp->sandbox_mode(TRUE); $preferenceResult = $mp->create_preference($preference); ?> <!DOCTYPE html> <html> <head> <title>Pagar</title> </head> <body> <a href="<?php echo $preferenceResult['response']['sandbox_init_point']; ?>">Pagar</a> </body> </html>IPN
<?php ini_set('log_errors', true); ini_set('error_log', dirname(__FILE__).'/ipn_errors.log'); require_once "mercadopago.php"; $mp = new MP('xxxxxxxxxxxxxx', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); // Get the payment reported by the IPN. Glossary of attributes response in https://developers.mercadopago.com $payment_info = $mp->get_payment_info($_GET["id"]); // Show payment information if ($payment_info["status"] == 200) { error_log($payment_info["status"]); } error_log($payment_info["response"]["collection"]["status"]); ?>Link para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.