HotcakesCommerce / hotcakes-commerce-core

The core of the e-commerce part of the overall solution. This is an ecommerce shopping cart solution built on top of the DNN (DotNetNuke) CMS. Anyone can do commerce online now!
https://mmmcommerce.com
MIT License
68 stars 55 forks source link

SI: REST API Missing the ShippingCharge Property as a DataMember #426

Closed mtrutledge closed 1 year ago

mtrutledge commented 1 year ago

Describe the bug

When using the REST API to update the order via a JSON request the LineItemDTO.ShippingCharge field is not marked as a DataMember of the DataContract. When the JSON is deserialized to the C# object the default value of ChargeShippingAndHandling that is set in the constructor is always set.

Software Versions

To Reproduce

Steps to reproduce the behavior:

  1. Create a Order object where each line item has a different shipping charge. ChargeShipping, ChargeHandling, etc.
  2. Convert the Order to a OrderDTO object
  3. Serialize the OrderDTO object to JSON
  4. Deserialize the OrderDTO JSON back to a OrderDTO object.
  5. Inspect each line item and see the ShippingCharge property is ChargeShippingAndHandling

Expected behavior

That the original ShippingCharge provided is kept

Actual behavior

The ShippingCharge property is always ChargeShippingAndHandling. When editing an order that was saved from the REST API the shipping will be re-calculated when the order is saved and will be different from when the order was placed.