Esempio n. 1
0
        public WeRefundRequest(string orderId, int totalFee, int refundFee, string opUserId, WeOrderName orderName)
            : this()
        {
            if (orderName == WeOrderName.TransactionId)
            {
                TransactionId = orderId;
            }
            else if (orderName == WeOrderName.OutTradeNo)
            {
                OutTradeNo = orderId;
            }

            TotalFee = totalFee;
            RefundFee = refundFee;
            OpUserId = opUserId;
        }
 public WeRefundQueryRequest(string orderid, WeOrderName orderName)
     : this()
 {
     if (orderName == WeOrderName.RefundId)
     {
         RefundId = orderid;
     }
     else if (orderName == WeOrderName.OutRefundNo)
     {
         OutRefundNo = orderid;
     }
     else if (orderName == WeOrderName.TransactionId)
     {
         TransactionId = orderid;
     }
     else if (orderName == WeOrderName.OutTradeNo)
     {
         OutTradeNo = orderid;
     }
 }
        public static WeRefundQueryResponse RefundQuery(string orderId, WeOrderName orderName)
        {
            TkDebug.AssertArgumentNullOrEmpty(orderId, "orderId", null);

            string url = WeUtil.GetUrl(WePayConst.REFUND_QUERY_URL);
            WeRefundQueryRequest request = new WeRefundQueryRequest(orderId, orderName);
            var result = WeUtil.PostDataToUri(url, request.WriteXml(), new WeRefundQueryResponse());
            return result;
        }
        public static WeRefundResponse Refund(string orderId, int totalFee, int refundFee,
                                             string opUserId, WeOrderName orderName)
        {
            TkDebug.AssertArgumentNullOrEmpty(orderId, "outRefundNo", null);
            TkDebug.AssertArgumentNullOrEmpty(opUserId, "opUserId", null);

            string url = WeUtil.GetUrl(WePayConst.REFUND_URL);
            WeRefundRequest request = new WeRefundRequest(orderId, totalFee, refundFee, opUserId, orderName);
            WeRefundResponse result = WeUtil.PostDataToUri(url, request.WriteXml(), new WeRefundResponse());
            return result;
        }