Ejemplo n.º 1
0
        public async Task <Tuple <bool, string> > AppPay(string body, string outTradeNo, int totalFee)
        {
            try
            {
                var appId = "XX";
                var mchId = "XX";
                var key   = "XX";
                WxPayConfig.Config(appId, mchId, key);
                var appPay = new AppPay();
                var result = await appPay.Run(body, outTradeNo, totalFee);

                return(result == null
                    ? new Tuple <bool, string>(false, "返回数据为空!")
                    : new Tuple <bool, string>(true, AppSign(result.ToJson())));
            }
            catch (Exception e)
            {
                return(new Tuple <bool, string>(false, e.Message));
            }
        }
Ejemplo n.º 2
0
 public AppPayUtilities()
 {
     PaymentDb = new AppPay();
     WeUtil    = new WeChatUtilities();
 }