I am using the sample that is on the MP page, but when I try to finish the final step of the checkout (in sandbox), I get a javascript error.
var MP = require ("mercadopago"),
exports.run = function (req, res) {
var mp = new MP ("CLIENT_ID", "CLIENT_SECRET"); // Nota: tengo el CLIENT_ID y el CLIENT_SECRET y funcionan correctamente.
var preference = {
"items": [
{
"title": "Multicolor kite",
"quantity": 1,
"currency_id": "UYU", // Available currencies at: https://api.mercadopago.com/currencies
"unit_price": 1000.0
}
]
};
mp.createPreference (preference, function (err, data){
if (err) {
res.send (err);
} else {
res.render ("button", {"preference": data});
}
});
};
/* view button.jade
!!! 5
html
head
Pay
body
(href=preference.response.sandbox_init_point) Pay
*/
When I give it to him to pay, I skip the error of JS as it is seen in the image:
Uncaught TypeError: Cannot read property 'replace' of undefined
at getNumberValue (formStepBundle.js.825f915608de.gz:formatted:435)
at callJsonp (formStepBundle.js.825f915608de.gz:formatted:1007)
at d.<anonymous> (formStepBundle.js.825f915608de.gz:formatted:852)
at d.b.emit (chico.min.js:1)
at d.validate (chico.min.js:1)
at HTMLFormElement.<anonymous> (chico.min.js:1)
at HTMLFormElement.dispatch (jquery-1.10.2.min.js:5)
at HTMLFormElement.v.handle (jquery-1.10.2.min.js:5)
Any help is appreciated.