Skip to content

Commit 657cfb0

Browse files
authored
Merge pull request #13 from fiskaltrust/bugfix/12-devkit-howto_08-sign-tip-pay-item-id-wrong
#12 take care the ftPayItemId is null if empty to avoid issues with b…
2 parents 6fea609 + 573a37b commit 657cfb0

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

libPosSystemAPI/DTO/PayItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace fiskaltrust.DevKit.POSSystemAPI.lib.DTO
66
public class PayItem
77
{
88
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
9-
public string ftPayItemId { get; set; } = string.Empty;
9+
public string? ftPayItemId { get; set; } = string.Empty;
1010

1111
public string Description { get; set; } = string.Empty;
1212
public decimal Amount { get; set; }

libPosSystemAPI/DTO/ReceiptRequest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ public ReceiptRequest(string cbReceiptReference, ReceiptCaseBuilder buildableRec
2424
{
2525
this.cbReceiptReference = cbReceiptReference;
2626
this.cbChargeItems = cbChargeItems;
27+
// verify that empty ftPayItemIDs are null
28+
foreach (var payItem in cbPayItems)
29+
{
30+
if (payItem.ftPayItemId == "")
31+
{
32+
payItem.ftPayItemId = null;
33+
}
34+
}
2735
this.cbPayItems = cbPayItems;
2836
this.ftReceiptCase = buildableReceiptCase.Build();
2937
}

0 commit comments

Comments
 (0)