I have this code on my page: <script type="text/javascript">paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
items: [ {
name: 'Conan Exiles - 15 slots',
unit_amount: { value: '15.73', currency_code: 'USD' },
quantity: '1', }
],
amount: {
value: '15.73',
breakdown: { item_total: { value: '15.73'} },
}
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name);
});
},
onError: function(err) {
alert("ERROR: " + err.errorMessage);
}
}).render('#paypalbtn');</script> The button shows up, but I get the error code 400. Upon checking this with reference docs, it indicates a malformed/syntatically bad request. I've checked the code against a JavaScript code validator, and it shows that the syntax is valid. Any suggestions would be appreciated. (PS: Doing this in sandbox mode)
... View more