Skip to content

Commit

Permalink
Handle quantity decimal feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ELepolt committed Jul 26, 2024
1 parent 470a897 commit b3573d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Library/Adjustment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ internal override void ReadXml(XmlTextReader reader)
break;

case "quantity_decimal":
QuantityDecimal = reader.ReadElementContentAsDecimal();
var quantityDecimal = reader.ReadElementContentAsString();
if (!quantityDecimal.IsNullOrEmpty())
QuantityDecimal = reader.ReadElementContentAsDecimal();
break;

case "quantity_remaining":
Expand Down
7 changes: 4 additions & 3 deletions Library/Refund.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ internal override void WriteXml(XmlTextWriter writer)
writer.WriteElementString("uuid", Uuid);

if (Type == RefundType.Quantity)
{
writer.WriteElementString("quantity", Quantity.AsString());

if (QuantityDecimal.HasValue)
writer.WriteElementString("quantity_decimal", QuantityDecimal.Value.ToString());
if (QuantityDecimal.HasValue)
writer.WriteElementString("quantity_decimal", QuantityDecimal.Value.ToString());
}

if (Type == RefundType.Percentage)
writer.WriteElementString("percentage", Percentage.Value.ToString());
Expand Down

0 comments on commit b3573d7

Please sign in to comment.