Skip to content

Commit

Permalink
Bug 19660. Included captured amount to logs for final capture result.
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavSmetaninSSM committed May 29, 2024
1 parent 7fa8fe4 commit be9ab0c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/QuickPayPaymentWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -675,22 +675,24 @@ public OrderCaptureInfo Capture(Order order, long amount, bool final)

order.GatewayResult = responseText;
CheckedData checkedData = CheckData(order, responseText, amount);

float capturedAmount = amount / 100f;
switch (checkedData.Result)
{
case CheckDataResult.FinalCaptureSucceed:
{
LogEvent(order, "Capture successful", DebuggingInfoType.CaptureResult);
LogEvent(order, string.Format("Message=\"{0}\" Amount=\"{1:f2}\"", "Capture successful", capturedAmount), DebuggingInfoType.CaptureResult);
return new OrderCaptureInfo(OrderCaptureInfo.OrderCaptureState.Success, "Capture successful");
}
case CheckDataResult.SplitCaptureSucceed:
if (final)
{
LogEvent(order, string.Format("Message=\"{0}\" Amount=\"{1:f2}\"", "Split capture(final)", amount / 100f), DebuggingInfoType.CaptureResult);
LogEvent(order, string.Format("Message=\"{0}\" Amount=\"{1:f2}\"", "Split capture(final)", capturedAmount), DebuggingInfoType.CaptureResult);
return new OrderCaptureInfo(OrderCaptureInfo.OrderCaptureState.Success, "Split capture successful");
}
else
{
LogEvent(order, string.Format("Message=\"{0}\" Amount=\"{1:f2}\"", "Split capture", amount / 100f), DebuggingInfoType.CaptureResult);
LogEvent(order, string.Format("Message=\"{0}\" Amount=\"{1:f2}\"", "Split capture", capturedAmount), DebuggingInfoType.CaptureResult);
return new OrderCaptureInfo(OrderCaptureInfo.OrderCaptureState.Split, "Split capture successful");
}
default:
Expand Down

0 comments on commit be9ab0c

Please sign in to comment.