Browse Source

企业支付 - 查询付款记录

Roc 7 years ago
parent
commit
d99bf8ceda

+ 45 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Request/WeChatPayQueryWwSpTrans2PockeRequest.cs

@@ -0,0 +1,45 @@
+using System.Collections.Generic;
+using Essensoft.AspNetCore.Payment.WeChatPay.Response;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Request
+{
+    /// <summary>
+    /// 企业支付 - 查询付款记录
+    /// </summary>
+    public class WeChatPayQueryWwSpTrans2PockeRequest : IWeChatPayCertificateRequest<WeChatPayQueryWwSpTrans2PockeResponse>
+    {
+        /// <summary>
+        /// 公众账号appid
+        /// </summary>
+        public string AppId { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// </summary>
+        public string PartnerTradeNo { get; set; }
+
+        #region IWeChatPayCertificateRequest Members
+
+        public string GetRequestUrl()
+        {
+            return "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/querywwsptrans2pocket";
+        }
+
+        public IDictionary<string, string> GetParameters()
+        {
+            var parameters = new WeChatPayDictionary
+            {
+                { "appid", AppId },
+                { "partner_trade_no", PartnerTradeNo },
+            };
+            return parameters;
+        }
+
+        public bool IsCheckResponseSign()
+        {
+            return false;
+        }
+
+        #endregion
+    }
+}

+ 102 - 0
src/Essensoft.AspNetCore.Payment.WeChatPay/Response/WeChatPayQueryWwSpTrans2PockeResponse.cs

@@ -0,0 +1,102 @@
+using System.Xml.Serialization;
+
+namespace Essensoft.AspNetCore.Payment.WeChatPay.Response
+{
+    [XmlRoot("xml")]
+    public class WeChatPayQueryWwSpTrans2PockeResponse : WeChatPayResponse
+    {
+        /// <summary>
+        /// 返回状态码
+        /// 此字段是通信标识,非交易标识,
+        /// 交易是否成功需要查看result_code来判断
+        /// </summary>
+        [XmlElement("return_code")]
+        public string ReturnCode { get; set; }
+
+        /// <summary>
+        /// 返回信息,如非空,为错误原因
+        /// 签名失败
+        /// 参数格式校验错误
+        /// </summary>
+        [XmlElement("return_msg")]
+        public string ReturnMsg { get; set; }
+
+        /// <summary>
+        /// 业务结果
+        /// </summary>
+        [XmlElement("result_code")]
+        public string ResultCode { get; set; }
+
+        /// <summary>
+        /// 错误代码
+        /// </summary>
+        [XmlElement("err_code")]
+        public string ErrCode { get; set; }
+
+        /// <summary>
+        /// 错误描述	
+        /// </summary>
+        [XmlElement("err_code_des")]
+        public string ErrCodeDes { get; set; }
+
+        /// <summary>
+        /// 商户订单号
+        /// </summary>
+        [XmlElement("partner_trade_no")]
+        public string PartnerTradeNo { get; set; }
+
+        /// <summary>
+        /// 商户号
+        /// </summary>
+        [XmlElement("mch_id")]
+        public string MchId { get; set; }
+
+        /// <summary>
+        /// 付款单号
+        /// </summary>
+        [XmlElement("detail_id")]
+        public string DetailId { get; set; }
+
+        /// <summary>
+        /// 转账状态
+        /// </summary>
+        [XmlElement("status")]
+        public string Status { get; set; }
+
+        /// <summary>
+        /// 失败原因
+        /// </summary>
+        [XmlElement("reason")]
+        public string Reason { get; set; }
+
+        /// <summary>
+        /// 收款用户openid	
+        /// </summary>
+        [XmlElement("openid")]
+        public string OpenId { get; set; }
+
+        /// <summary>
+        /// 收款用户姓名	
+        /// </summary>
+        [XmlElement("transfer_name")]
+        public string TransferName { get; set; }
+
+        /// <summary>
+        /// 付款金额	
+        /// </summary>
+        [XmlElement("payment_amount")]
+        public string PaymentAmount { get; set; }
+
+        /// <summary>
+        /// 转账时间	
+        /// </summary>
+        [XmlElement("transfer_time")]
+        public string TransferTime { get; set; }
+
+        /// <summary>
+        /// 付款描述	
+        /// </summary>
+        [XmlElement("desc")]
+        public string Desc { get; set; }
+    }
+}