Ejemplo n.º 1
0
        /// <summary>
        /// Refund money
        /// </summary>
        /// <param name="wechat_paymentNo">Wehchat payment number</param>
        /// <param name="out_payment_no">Local payment number</param>
        /// <param name="refund_no">Local refund number</param>
        /// <param name="amount">Fen, please pay attention</param>
        /// <returns></returns>
        public static RefundApplyResponse Refund(WeChatPayConfig config, string wechat_paymentNo, string out_payment_no, string refund_no, int refundAmount, int totalAmount, AppType from = AppType.PUBLICK_SVR)
        {
            RefundApplyResponse res     = null;
            RefundApplyRequest  request = new RefundApplyRequest(config);

            request.transaction_id = wechat_paymentNo;
            request.out_trade_no   = out_payment_no;
            request.out_refund_no  = refund_no;
            request.total_fee      = totalAmount;
            request.refund_fee     = refundAmount;
            request.refund_account = config.RefundAccount;// "REFUND_SOURCE_RECHARGE_FUNDS";
            logger.Info(string.Format("Refund Account:{0}", (config.RefundAccount != null ? config.RefundAccount : "REFUND_SOURCE_UNSETTLED_FUNDS")));
            switch (from)
            {
            case AppType.PUBLICK_SVR:
                request.appid = config.APPID;
                break;

            case AppType.MINI_APP:
                request.appid = config.MiniAppId;
                break;

            case AppType.OPEN_PLATFORM:
                request.appid = config.APPID;
                break;
            }
            BaseResponse response = request.Execute();

            if (response != null)
            {
                res = response as RefundApplyResponse;
            }
            return(res);
        }
Ejemplo n.º 2
0
        public object Refund(RefundApplyRequest reqModel)
        {
            var result = QctPayReturn.Fail(msg: "参数格式错误");
            OrderBuilder <RefundApplyRequest, RefundApplyResponse> rfdOrder = new OrderBuilderForRefund();

            result = rfdOrder.Build(reqModel);
            return(rfdOrder.Result(result));
        }