极客退款
This commit is contained in:
@@ -436,10 +436,39 @@ namespace Hncore.Pass.Vpn.Service
|
||||
/// <param name="account"></param>
|
||||
/// <returns></returns>
|
||||
public override async Task<ApiResult> Refund(string account, string packageKey, int days)
|
||||
{
|
||||
var title = GetOpTitle("Refund", account);
|
||||
LogHelper.Info(title, account);
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "退款失败-不支持退款");
|
||||
{
|
||||
|
||||
var url1 = "http://user.webok.me/userapi3/?secretId=20200716182518182489&secretKey=OFcEJAfzYjWT3e2s&type=buy_log&user="+account+"&page=1";
|
||||
|
||||
System.Net.WebRequest wrq = System.Net.WebRequest.Create(url1);
|
||||
wrq.Method = "GET";
|
||||
System.Net.WebResponse wrp = wrq.GetResponse();
|
||||
System.IO.StreamReader sr = new System.IO.StreamReader(wrp.GetResponseStream(), System.Text.Encoding.GetEncoding("gb2312"));
|
||||
var strResult = sr.ReadToEnd();
|
||||
|
||||
JObject jo1 = (JObject)JsonConvert.DeserializeObject(strResult);
|
||||
|
||||
|
||||
var id = jo1["data"][0]["id"].ToString();
|
||||
|
||||
var url = "/userapi3/?secretId=20200716182518182489&secretKey=OFcEJAfzYjWT3e2s&type=refund&id="+id;
|
||||
|
||||
var client = CreateHttpClient();
|
||||
|
||||
var resp = await client.GetAsync(url);
|
||||
var content = await resp.Content.ReadAsStringAsync();
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(content);
|
||||
|
||||
var status = jo["code"].ToString();
|
||||
if (status =="1")
|
||||
{
|
||||
return new ApiResult(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ApiResult(ResultCode.C_INVALID_ERROR, "退款失败");
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否在线
|
||||
|
||||
Reference in New Issue
Block a user