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.
- Recurring payments for cart with multiple individually subscribable items? in PayPal Payments Standard
- PayPal Buttons in PayPal Payments Standard
- Payment not automatically being captured, funds not transferred in Sandbox Environment
- Payee account is invalid issue in REST APIs
- How I could send inside the code the id reference to the company that would sell the items? in REST APIs