Discussions
When Posting a Cart with Voluntary Contributions inside of it, values get reset to default after posting
I am attempting to post a cart with a Voluntary Contribution inside of the cart. The user enters a value and that value is added to the payload that I am posting. It is successful on post, but as soon as I go to the cart to view the items, the value gets overwritten to the default value for that voluntary contribution
"$type": "Asi.Soa.Commerce.DataContracts.OrderLineData, Asi.Contracts",
"OrderLineId": "",
"ChildOrderLines": {
"$type": "Asi.Soa.Commerce.DataContracts.OrderLineDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Commerce.DataContracts.OrderLineData, Asi.Contracts",
"OrderLineId": "",
...(payloadType === "VOL" && {
"ExtendedAmount": {
"$type": "System.Nullable`1[[Asi.Soa.Core.DataContracts.MonetaryAmountData, Asi.Contracts]], mscorlib",
"Amount": donation,
"Currency": {
"$type": "Asi.Soa.Core.DataContracts.CurrencyData, Asi.Contracts",
"CurrencyCode": "USD",
"DecimalPositions": 2
},
"IsAmountDefined": true
}
}),
The donation value in the "Amount" field is populated by the user entering a value. There are default values stored in the system for each voluntary contribution: Voluntary Contribution to the Foundation: 0.00, PAC Contribution: 20.00, Scholarship Fund Contribution: 30.00. When I post the cart, the cart is posted with the value that the user entered, but as soon as I go to view the cart, the value has been overwritten.
Where/How are the default values stored and is there a way to bypass the default values