37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using System;
|
|
|
|
namespace WX.CRM.WEB.ViewModel.Level2
|
|
{
|
|
public class ValidatePayOrder
|
|
{
|
|
private string payid;
|
|
public ValidatePayOrder(string payid)
|
|
{
|
|
this.payid = payid;
|
|
}
|
|
public void CheckNullPayid()
|
|
{
|
|
if (string.IsNullOrEmpty(payid) || string.IsNullOrWhiteSpace(payid))
|
|
throw new ArgumentException("支付流水号不能为空");
|
|
}
|
|
public bool ValidationOfPayid(string url, out string msg)
|
|
{
|
|
msg = string.Empty;
|
|
returnResult result = new returnResult();
|
|
result = result.getResult(this.payid, url);
|
|
if (result.result)
|
|
return true;
|
|
else
|
|
{
|
|
if (result.retcode == 10052)
|
|
msg = "该交易流水号已存在支付,请检查流水号";
|
|
else if (result.retcode == 10053)
|
|
msg = "该交易流水号不正确,请检查流水号";
|
|
else
|
|
msg = result.retMessage;
|
|
return false;
|
|
}
|
|
|
|
}
|
|
}
|
|
} |