Exemplo n.º 1
0
        /// <summary>
        /// 获取支付二维码
        /// </summary>
        /// <returns></returns>
        public static string GetPayInfo(PayRequestModel requestModel)
        {
            string sign       = Md5Hash($"{requestModel.name}{requestModel.pay_type}{requestModel.price}{requestModel.order_id}{requestModel.notify_url}{PayConfig.app_secret}");
            string parameters = $"name={requestModel.name}&pay_type={requestModel.pay_type}&price={requestModel.price}&order_id={requestModel.order_id}&sign={sign}&notify_url={HttpUtility.UrlEncode(requestModel.notify_url)}&order_uid={requestModel.order_uid}&more={requestModel.more}&expire={requestModel.expire}&openid={requestModel.openid}";

            return(PayRequest.SendRequest($"https://xorpay.com/api/pay/{PayConfig.aid}", parameters, "POST"));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 发起退款
        /// </summary>
        /// <param name="aoid">XorPay平台订单号</param>
        /// <param name="price">退款金额</param>
        /// <returns></returns>
        public static string Refund(string aoid, float price)
        {
            string sign       = Md5Hash($"{price}{PayConfig.app_secret}");
            string parameters = $"price={price}&sign={sign}";

            return(PayRequest.SendRequest($"https://xorpay.com/api/refund/{aoid}", parameters, "POST"));
        }