43 lines
1.8 KiB
C#
43 lines
1.8 KiB
C#
using Ninject;
|
||
using System.Text;
|
||
using WX.CRM.BLL.Util;
|
||
using WX.CRM.Common;
|
||
using WX.CRM.IBLL.Util;
|
||
using WX.CRM.WebHelper.Infrastructure;
|
||
|
||
namespace WX.CRM.WEB.ViewModel.Level2
|
||
{
|
||
public class returnResult
|
||
{
|
||
public bool result { get; set; }
|
||
public int retcode { get; set; }
|
||
public int total { get; set; }
|
||
public string retMessage { get; set; }
|
||
public string retpwd { get; set; }
|
||
public returnResult getResult(string json, string url)
|
||
{
|
||
ISecurityHelper sHelper = NinjectControllerFactory.ninjectKernel.Get<ISecurityHelper>();
|
||
string key = sHelper.createSignEncodingStr(json, SecurityHelper.OrderClientIdKey);
|
||
LogHelper.Info(string.Format("调用接口:{0}\r\n参数:{1}", url, key));
|
||
string response = Utility.PostData(url + "?" + key, Encoding.UTF8);
|
||
string _retmsg = sHelper.decyptData(SecurityHelper.OrderClientIdKey, response);
|
||
returnResult result = Utility.MAXJSONToObject<returnResult>(_retmsg);
|
||
return result;
|
||
}
|
||
}
|
||
public class PayOrderResult
|
||
{
|
||
public bool result { get; set; }
|
||
public int retcode { get; set; }
|
||
public string ApplyOrderId { get; set; }
|
||
public PayOrderResult getResule(string json, string url)
|
||
{
|
||
ISecurityHelper sHelper = NinjectControllerFactory.ninjectKernel.Get<ISecurityHelper>();
|
||
string key = sHelper.createSignEncodingStr(json, SecurityHelper.OrderClientIdKey);
|
||
string response = Utility.PostData(url + "?" + key, Encoding.UTF8);
|
||
string _retmsg = sHelper.decyptData(SecurityHelper.OrderClientIdKey, response);
|
||
PayOrderResult result = Utility.JSONToObject<PayOrderResult>(_retmsg);
|
||
return result;
|
||
}
|
||
}
|
||
} |