patch items in Smart Payment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am stuck with the following problem: I am trying to patch a Smart Payment Button order. Not only the total price, but also the items.
My actions.order.create:
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [
{
"amount":{
"value":"13.85",
"currency_code":"EUR",
"breakdown":{
"item_total":{
"value":"13.85",
"currency_code":"EUR"
}
}
},
"invoice_id":"123456",
"items":[
{
"name":"Shampoo",
"unit_amount":{
"value":"7.9",
"currency_code":"EUR"
},
"quantity":"1",
"sku":"132"
},
{
"name":"Frachtkosten | Shipping costs",
"unit_amount":{
"value":"5.95",
"currency_code":"EUR"
},
"quantity":"1"
}
]
}
]
});
},
My actions.order.patch:
return actions.order.patch([
{
op: "replace",
path: "/purchase_units/@reference_id=='default'",
value: {
amount: {
currency_code: "EUR",
value: "31.64",
breakdown: {
item_total: {
currency_code: "EUR",
value: "31.64"
}
}
},
invoice_id : "123456",
items: [
{
name: " Shampoo",
unit_amount: {
currency_code: "EUR",
value: "6.64"
},
quantity:"1",
"sku":"132"
},
{
name: "Frachtkosten | Shipping costs",
unit_amount: {
currency_code: "EUR",
value: "25.00"
},
quantity:"1"
}
]
}
}
]);//ende return actions.order.patch
When patching, unfortunately only the total price is updated, not the items (item price).
Is it possible to update the articles as well? And if so, what am I doing wrong?
- Labels:
-
Payments REST APIs
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Add Others data in SDKs
- Need help to integrate Advanced Checkout (PPCP) With WHMCS in PayPal Upgrade Community
- Shipping options are not appearing in my cart through link or button. in PayPal Payments Standard
- Need help to integrate PayPal Checkout Advanced (PPCP) with WooCommerce in PayPal Upgrade Community
- My webhook stopped working 2 weeks ago in REST APIs