Beispiel #1
0
        /// <summary>
        /// 获取微信收银台跳转链接
        /// </summary>
        /// <param name="requestModel"></param>
        /// <returns></returns>
        public static string GetWXPayUrl(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)}&return_url={HttpUtility.UrlEncode(requestModel.return_url)}&cancel_url={HttpUtility.UrlEncode(requestModel.cancel_url)}&order_uid={requestModel.order_uid}&more={requestModel.more}&expire={requestModel.expire}";

            return($"https://xorpay.com/api/cashier/{PayConfig.aid}?{parameters}");
        }
Beispiel #2
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"));
        }