|
@@ -219,11 +219,29 @@ namespace MySystem
|
|
|
Dictionary<string, object> return_result = new Dictionary<string, object>();
|
|
|
try
|
|
|
{
|
|
|
- function.WriteLog(BusinessCode, "服务商平台商户进件提交申请单API");
|
|
|
string result = postJson("https://api.mch.weixin.qq.com/v3/applyment4sub/applyment/business_code/" + BusinessCode, "", prikey, MchId, serialNo, "GET");
|
|
|
- function.WriteLog(result + "\n\n", "服务商平台查询申请单状态API");
|
|
|
+
|
|
|
//{\"applyment_id\":2000002247709762,\"applyment_state\":\"APPLYMENT_STATE_FINISHED\",\"applyment_state_msg\":\"商户入驻申请已完成\",\"audit_detail\":[],\"business_code\":\"0123456789\",\"sign_url\":\"https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQFv7zwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAyUXE1czkzb3JlUjIxZHpXbTF5Y2YAAgRjbe9hAwQAjScA\",\"sub_mchid\":\"1619775262\"}
|
|
|
JsonData jsonObj = JsonMapper.ToObject(result);
|
|
|
+ bool logFlag = true;
|
|
|
+ if (jsonObj["applyment_state"].ToString() == "APPLYMENT_STATE_AUDITING" || jsonObj["applyment_state"].ToString() == "APPLYMENT_STATE_TO_BE_SIGNED" || jsonObj["applyment_state"].ToString() == "APPLYMENT_STATE_TO_BE_CONFIRMED")
|
|
|
+ {
|
|
|
+ string check = RedisDbconn.Instance.Get<string>("WeChatQueryMerchant:" + BusinessCode + ":" + jsonObj["applyment_state"].ToString());
|
|
|
+ if(!string.IsNullOrEmpty(check))
|
|
|
+ {
|
|
|
+ logFlag = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ RedisDbconn.Instance.Set("WeChatQueryMerchant:" + BusinessCode + ":" + jsonObj["applyment_state"].ToString(), result);
|
|
|
+ RedisDbconn.Instance.SetExpire("WeChatQueryMerchant:" + BusinessCode + ":" + jsonObj["applyment_state"].ToString(), 7200);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(logFlag)
|
|
|
+ {
|
|
|
+ function.WriteLog(BusinessCode, "服务商平台商户进件提交申请单API");
|
|
|
+ function.WriteLog(result + "\n\n", "服务商平台查询申请单状态API");
|
|
|
+ }
|
|
|
return_result.Add("applyment_id", jsonObj["applyment_id"].ToString()); //微信支付申请单号
|
|
|
return_result.Add("applyment_state", jsonObj["applyment_state"].ToString()); //申请单状态
|
|
|
return_result.Add("applyment_state_msg", jsonObj["applyment_state_msg"].ToString()); //申请状态描述
|
|
@@ -267,6 +285,7 @@ namespace MySystem
|
|
|
par.Add("sub_mchid", SubMchId); //子商户号
|
|
|
par.Add("out_trade_no", OrderNo); //商户订单号
|
|
|
par.Add("out_refund_no", RefundNo); //商户退款单号
|
|
|
+ par.Add("reason", "活动返现"); //退款原因
|
|
|
Dictionary<string, object> amountDic = new Dictionary<string, object>();
|
|
|
amountDic.Add("refund", refund); //退款金额
|
|
|
amountDic.Add("total", amount); //原订单金额
|