- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I've been trying to integrate the smart payments button to my website. The main problem that I have is that i'd like for the user to be able to select the shipping methods he likes inside the paypal checkout, and update the shipping cost accordingly. By exploring (a lot) the documentation I understand the solution is somewhere in between the "shipping_option" of the ORDERS API and the "onShippingChange", but I can't understand how... can someone help me? I'm pretty lost and online you can only find deprecated solutions...
Solved! Go to Solution.
- Labels:
-
Mobile SDKs
-
PayPal Here SDK
-
REST SDK
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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'
}
}
]
}
}]
});
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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'
}
}
]
}
}]
});
},

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Disable shipping address in Pay with Credit or Debit card button integration in SDKs
- Add to cart button is missing? in PayPal Payments Standard
- Integrating PayPal's smart button into Shopify without specifying the price or shipping rates. in PayPal Payments Standard
- Multiple subscription links not working in REST APIs
- I can't set Shipping Calculations for a Buy now Button - there's no option in my profile? in Braintree Client-side Integration (JS, iOS, Android SDKs)