|
@@ -341,7 +341,7 @@ namespace MySystem
|
|
|
|
|
|
#region 退款
|
|
|
|
|
|
- public string Refund(string TradeNo, string Amount, string MerPid, string Reason = "")
|
|
|
+ public string Refund(string TradeNo, string Amount, string Reason, string MerToken)
|
|
|
{
|
|
|
IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", AppId, PrivateKey, "json", "1.0", "RSA2", AlipayPublicKey, "utf-8", false);
|
|
|
AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
|
|
@@ -349,19 +349,19 @@ namespace MySystem
|
|
|
"\"trade_no\":\"" + TradeNo + "\"," +
|
|
|
"\"refund_amount\":" + Amount + "," +
|
|
|
"\"out_request_no\":\"" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8) + "\"," +
|
|
|
- "\"refund_reason\":\"" + Reason + "\"," +
|
|
|
- "\"refund_royalty_parameters\":[{" +
|
|
|
- "\"royalty_type\":\"transfer\"," +
|
|
|
- "\"trans_out_type\":\"userId\"," +
|
|
|
- "\"trans_out\":\"" + MerPid + "\"," +
|
|
|
- "\"amount\":" + Amount + "," +
|
|
|
- "\"desc\":\"" + Reason + "\"" +
|
|
|
- "}]" +
|
|
|
+ "\"refund_reason\":\"" + Reason + "\"" +
|
|
|
+ // "\"refund_royalty_parameters\":[{" +
|
|
|
+ // "\"royalty_type\":\"transfer\"," +
|
|
|
+ // "\"trans_out_type\":\"userId\"," +
|
|
|
+ // "\"trans_out\":\"" + MerPid + "\"," +
|
|
|
+ // "\"amount\":" + Amount + "," +
|
|
|
+ // "\"desc\":\"" + Reason + "\"" +
|
|
|
+ // "}]" +
|
|
|
"}";
|
|
|
string result = "";
|
|
|
try
|
|
|
{
|
|
|
- AlipayTradeRefundResponse response = client.Execute(request, null, "202306BB117e046cfc29434c8f4acfd2a43aeX03");
|
|
|
+ AlipayTradeRefundResponse response = client.Execute(request, null, MerToken);
|
|
|
result = response.Body;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -375,7 +375,7 @@ namespace MySystem
|
|
|
#endregion
|
|
|
|
|
|
#region 分账
|
|
|
- public string Settle(string OrderNo, string TradeNo, List<RoyaltyParameters> Parameters)
|
|
|
+ public string Settle(string OrderNo, string TradeNo, List<RoyaltyParameters> Parameters, string MerToken)
|
|
|
{
|
|
|
IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", AppId, PrivateKey, "json", "1.0", "RSA2", AlipayPublicKey, "utf-8", false);
|
|
|
AlipayTradeOrderSettleRequest request= new AlipayTradeOrderSettleRequest();
|
|
@@ -400,7 +400,7 @@ namespace MySystem
|
|
|
string result = "";
|
|
|
try
|
|
|
{
|
|
|
- AlipayTradeOrderSettleResponse response = client.Execute(request, null, "202306BB117e046cfc29434c8f4acfd2a43aeX03");
|
|
|
+ AlipayTradeOrderSettleResponse response = client.Execute(request, null, MerToken);
|
|
|
result = response.Body;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -414,7 +414,7 @@ namespace MySystem
|
|
|
#endregion
|
|
|
|
|
|
#region 绑定分账关系
|
|
|
- public string BindSettleRelation(string RequestNo, string Account)
|
|
|
+ public string BindSettleRelation(string RequestNo, string Account, string MerToken)
|
|
|
{
|
|
|
IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", AppId, PrivateKey, "json", "1.0", "RSA2", AlipayPublicKey, "utf-8", false);
|
|
|
AlipayTradeRoyaltyRelationBindRequest request = new AlipayTradeRoyaltyRelationBindRequest();
|
|
@@ -434,7 +434,7 @@ namespace MySystem
|
|
|
string result = "";
|
|
|
try
|
|
|
{
|
|
|
- AlipayTradeRoyaltyRelationBindResponse response = client.Execute(request, null, "202306BB117e046cfc29434c8f4acfd2a43aeX03");
|
|
|
+ AlipayTradeRoyaltyRelationBindResponse response = client.Execute(request, null, MerToken);
|
|
|
result = response.Body;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -448,19 +448,18 @@ namespace MySystem
|
|
|
#endregion
|
|
|
|
|
|
#region 查看分账
|
|
|
- public string QuerySettle(string OrderNo, string TradeNo)
|
|
|
+ public string QuerySettle(string OrderNo, string TradeNo, string MerToken)
|
|
|
{
|
|
|
IAopClient client = new DefaultAopClient("https://openapi.alipay.com/gateway.do", AppId, PrivateKey, "json", "1.0", "RSA2", AlipayPublicKey, "utf-8", false);
|
|
|
AlipayTradeOrderSettleQueryRequest request = new AlipayTradeOrderSettleQueryRequest();
|
|
|
request.BizContent="{" +
|
|
|
- " \"settle_no\":\"20210706002530020036530021395831\"," +
|
|
|
- " \"out_request_no\":\"20210727001\"," +
|
|
|
- " \"trade_no\":\"2021112611001004680 073956707\"" +
|
|
|
+ " \"out_request_no\":\"" + OrderNo + "\"," +
|
|
|
+ " \"trade_no\":\"" + TradeNo + "\"" +
|
|
|
"}";
|
|
|
string result = "";
|
|
|
try
|
|
|
{
|
|
|
- AlipayTradeOrderSettleQueryResponse response = client.Execute(request, null, "202306BB117e046cfc29434c8f4acfd2a43aeX03");
|
|
|
+ AlipayTradeOrderSettleQueryResponse response = client.Execute(request, null, MerToken);
|
|
|
result = response.Body;
|
|
|
}
|
|
|
catch (Exception ex)
|