I eventually resolved my problem like this: paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
currency_code: "EUR",
value: "y", //y=x+10
breakdown: {
item_total: {
currency_code: "EUR",
value: "x" //x = value
},
shipping: {
currency_code: "EUR",
value: "x"
}
}
},
items: [
// items details
],
shipping: {
options: [
{
id: 'STANDARD',
label: 'Spedizione Standard',
type: 'SHIPPING',
selected: true,
amount: {
value: '10.00',
currency_code: 'EUR'
}
},
{
id: 'CONSEGNA_A_MANO',
label: 'Consegna a mano - Solo Milano',
type: 'SHIPPING',
selected: false,
amount: {
value: '0.00',
currency_code: 'EUR'
}
},
{
id: 'RITIRO_A_MANO',
label: 'Ritiro a mano - Solo Milano',
type: 'PICKUP',
selected: false,
amount: {
value: '3.00',
currency_code: 'EUR'
}
}
]
}
}]
});
},
... View more