Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ public static List<CreateEstateRequest> ToCreateEstateRequests(this DataTableRow
FeeType feeType = ReqnrollTableHelper.GetEnumValue<FeeType>(tableRow, "FeeType");
String feeDescription = ReqnrollTableHelper.GetStringRowValue(tableRow, "FeeDescription");
Decimal feeValue = ReqnrollTableHelper.GetDecimalValue(tableRow, "Value");
transactionFees.Add((calculationType, feeDescription, feeValue, feeType));
}

return transactionFees;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@ public void ToSettlementFeeDetails_ReturnsEveryFeeRow()
result[1].CalculatedValue.ShouldBe(0.25m);
}

[Test]
public void ToContractTransactionFeeDetails_ReturnsEveryFeeRow()
{
Reqnroll.Table table = new(new[] { "CalculationType", "FeeDescription", "Value", "FeeType" });
table.AddRow(new[] { "Fixed", "Merchant Commission", "1.00", "Merchant" });
table.AddRow(new[] { "Percentage", "Merchant Commission", "0.015", "Merchant" });

List<(CalculationType, String, Decimal?, FeeType)> result = table.Rows.ToContractTransactionFeeDetails();

result.Count.ShouldBe(2);
result[0].Item1.ShouldBe(CalculationType.Fixed);
result[0].Item2.ShouldBe("Merchant Commission");
result[0].Item3.ShouldBe(1.00m);
result[0].Item4.ShouldBe(FeeType.Merchant);
result[1].Item1.ShouldBe(CalculationType.Percentage);
result[1].Item3.ShouldBe(0.015m);
}

[Test]
public void ToSettlementDetails_RejectsMultipleRows()
{
Expand Down
Loading