电商收付通提现API返回的错误码和错误提示反序列化报错?
电商收付通提现APIhttps://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/fund/chapter3_5.shtml
当提现金额小于1时候(比如0),接口返回的错误为"{\“code\”:\“PARAM_ERROR\”,\“detail\”:{\“location\”:\“body\”,\“value\”:0},\“message\”:\“输入源“/body/amount”映射到数值字段“提现金额(单位RMB分)”规则校验失败,值低于最小值 1\”}",反序列化商上述内容报System.InvalidOperationException: Cannot get the value of a token type ‘Number’ as a string。
查看微信支付接口规则API v3该错误格式为
{
"code": "PARAM_ERROR",
"message": "参数错误",
"detail": {
"field": "/amount/currency",
"value": "XYZ",
"issue": "Currency code is invalid",
"location" :"body"
}
}
注意detail节点中value为string类型,而电商收付通提现API直接将调用时传入的数值0直接返回(正确返回"0"),造成类型不一致反序列化时失败。如何解决?