Good morning I have a bad request error in the PayPal SDK this is the json of the payment;
var create_payment_json = {
intent: "sale",
payer: {
payment_method: "paypal"
},
redirect_urls: {
return_url: "http://localhost:3000/success",
cancel_url: "http://localhost:3000/cancel"
},
transactions: [{
item_list: {
items: data
},
amount: {
currency: "MXN",
total: totalString,
},
description: "This is the payment description."
}]
};
the data variable is printed like this with a console log;
the variable that I use for the total is printed with the same data.price format, here it captures;
I really do not know the proper format, so if you could help me with this, it would be great.
The error is number 400 BAD REQUEST, I have tried several ways but all with the same result. Greetings