I found one strange issue in postman. In below request amount is integer field.
{ "merchantId": 49, "amount": 020 }
When I pass Amount 020 instead of 20. In API controller I received amount 16. When I pass 0100 I receive 64.
If I pass in double quotes like "020" or "0100". Then I get 20 and 100.
Below is controller method and request class:
[HttpPost]
public IHttpActionResult Post(XXXXXXXXCommand command)
{
IHttpActionResult result = null;
using (_logger.PushWeb())
{
_logger.Info("POST request to /transactions/debits/accountsetup", command);
try
{
}
catch (MerchantNotFoundException ex)
{
_logger.Error("XXXX", ex);
}
}
return result;
}
[DataContract(Name = "XXXXCommand")]
public class XXXXXXCommand : CommandBase
{
/// <summary>
/// Merchant ID
/// </summary>
[DataMember(Name = "merchantId", Order = 1)]
public int MerchantId { get; set; }
/// <summary>
/// Transaction amount
/// </summary>
[DataMember(Name = "amount", Order = 2)]
public int Amount { get; set; }
}
It looks like postman bug.