西瓜退款
This commit is contained in:
@@ -438,9 +438,37 @@ namespace Hncore.Pass.Vpn.Service
|
||||
/// <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://dl.youziruanjian.com/userapi3/?secretId=20210121152313846555&secretKey=C41nUV6KpjvdYkfr&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=20210121152313846555&secretKey=C41nUV6KpjvdYkfr&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