How about, thanks for your time, I'm trying to integrate a very basic shopping cart with MercadoPago. But I receive the following error:
Fatal error: Uncaught exception 'MercadoPagoException' with message 'back_urls invalid. Wrong format'
I am using the library for PHP with the following code
$mp = new MP('xxxxxxxx','xxxxxxxxxxx');
$mp->sandbox_mode(true);
$preference_data = array(
"items" => array(
array(
"title" => "Multicolor kite",
"description" => "Multicolor kite - prueba",
"quantity" => 1,
"currency_id" => "ARS",
"unit_price" => 1.00
)
),
"payer" => array(
array(
"name" => "Pepe Argento",
"email" => "[email protected]"
)
),
"external_reference" => "230688",
"auto_return" => "approved",
"back_urls" => array(
array(
"success" => "http://cualquierpagina.com"
)
)
);
$preference = $mp->create_preference($preference_data);
echo $preference['response']['sandbox_init_point'];
then I take the string that returns in $ preference ['response'] ['sandbox_init_point']; and I put it on a button.
If I remove the back_url and the auto_return, it sends it perfect, it takes the data and it seems to work all right. But if you do not send me the error mentioned above, in my opinion it should be something of format, but no matter how you put the page, it continues to bounce.
What is wrong? Could someone give me a hand with the subject?
Somewhere I read that the sandbox did not work, and that everything had to be done in real mode with test users, the truth is that I read the documentation of how to make a test user and I did not understand where or how.
Thank you for your time and attention.