- 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.
- Shipping options are not appearing in my cart through link or button. in PayPal Payments Standard
- Show all billing address fields when hiding shipping address fields in PayPal Payments Standard
- Seller "Buy now" button - unable to edit a button in PayPal Payments Standard
- What happened to PayPal Buttons?! in PayPal Payments Standard
- Error: "Unable to change shipping method. Please try again." in PayPal popup in REST APIs