Guest User

Untitled

a guest
Dec 13th, 2017
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. <?php
  2.  
  3. require_once "mercadopago.php";
  4. $mp = new MP ("xxx", "xxx");
  5. $mp->sandbox_mode(TRUE);
  6. $params = ["access_token" => $mp->get_access_token()];
  7.  
  8. $id=617913514;
  9.  
  10. try
  11. {
  12.  
  13. //$payment_info = $mp->get("/collections/notifications/".$id); <-- Esto no funciona
  14. $merchant_order_info = $mp->get("/merchant_orders/$id", $params, false);
  15.  
  16. }
  17. catch(Exception $e)
  18. {
  19. $merchant_order_info = $e->getMessage();
  20. }
  21.  
  22.  
  23. print_r($merchant_order_info);
  24.  
  25. Array
  26. (
  27. [status] => 200
  28. [response] => Array
  29. (
  30. [id] => 617913514
  31. [preference_id] => 141702-78ec13ca-b59d-4de1-a164-a1dab835051e
  32. [date_created] => 2017-12-11T19:38:17.000-04:00
  33. [last_updated] => 2017-12-11T19:38:17.000-04:00
  34. [application_id] =>
  35. [status] => opened
  36. [site_id] => MLA
  37. [payer] =>
  38. [collector] => Array
  39. (
  40. [id] => xxxxx
  41. [email] => miemail@gmail.com
  42. [nickname] => DIEGO2K
  43. )
  44.  
  45. [sponsor_id] =>
  46. [payments] => Array
  47. (
  48. )
  49.  
  50. [paid_amount] => 0
  51. [refunded_amount] => 0
  52. [shipping_cost] => 0
  53. [cancelled] =>
  54. [items] => Array
  55. (
  56. [0] => Array
  57. (
  58. [category_id] => video_games
  59. [currency_id] => ARS
  60. [description] =>
  61. [id] => 5a2ed97fbb61d
  62. [picture_url] =>
  63. [quantity] => 1
  64. [unit_price] => 1046
  65. [title] => ORDEN DE COMPRA #5a2ed97fbb61d
  66. )
  67.  
  68. )
  69.  
  70. [marketplace] => NONE
  71. [shipments] => Array
  72. (
  73. )
  74.  
  75. [external_reference] => 5a2ed97fbb61d
  76. [additional_info] =>
  77. [notification_url] => http://mipagina.com/ipn
  78. [total_amount] => 1046
  79. )
  80.  
  81. )
Add Comment
Please, Sign In to add comment