I'm doing a page in Python 3.4 and Django 1.7, using MercadoPago's basic checkout, but I want to send more info from the buyer than what the basic proposes, but I get the error that is not serializable. I need to send the following information:
preference = {
"items": [
{
"title": "Título del art.",
"quantity": 1,
"currency_id": "ARS", # Available currencies at: https://api.mercadopago.com/currencies
"unit_price": 1800
}
],
"payers": [
{
"name": nombre,
"surname": apellido,
"email": email,
"phone.number": telefono,
"identification":
{
"type": tipo_documento,
"number": num_doc,
}, # identification
"address":
{
"zip_code": cp,
"street_name": calle,
"street_number": num_calle,
} # address
},
],
"back_urls": [
{
"success": redirect('venta_exitosa_r'),
"failure": redirect('venta_fallida_r'),
"pending": redirect('venta_pendiente_r')
},
]
}
mp = mercadopago.MP(settings.CLIENT_ID, settings.CLIENT_SECRET)
preferenceresult = mp.create_preference(preference)
url = preferenceresult["response"]["init_point"]
return url
Thank you very much!