Example #1
0
        /// <summary>
        /// 退票申请
        /// </summary>
        /// <param name="out_trade_no"></param>
        /// <returns></returns>
        private bool sendReturnTicketMessage(string out_trade_no)
        {
            PaymentDao pDao = new PaymentDao();

            try
            {
                PaymentDataResults paymentDataResults = pDao.getPayData(out_trade_no);
                double             refundFee          = Math.Round(Convert.ToDouble(paymentDataResults.billPrice) * 0.8, 2);
                WxJsonResult       wxJsonResult       = TemplateApi.SendTemplateMessage(Global.APPID,
                                                                                        paymentDataResults.openId,
                                                                                        Global.ReturnTicketTemplate,
                                                                                        new
                {
                    keyword1 = new { value = paymentDataResults.billid },
                    keyword2 = new { value = refundFee },
                    keyword3 = new { value = paymentDataResults.refundTime },
                    keyword4 = new { value = "退票申请中,等待商家处理" },
                    keyword5 = new { value = "退款说明" }
                },
                                                                                        paymentDataResults.formId, "/pages/orderList/orderList?num=1", "keyword3.DATA");
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Example #2
0
        /// <summary>
        /// 待支付
        /// </summary>
        /// <param name="out_trade_no"></param>
        /// <returns></returns>
        private bool sendToBePayMessage(string out_trade_no)
        {
            PaymentDao pDao = new PaymentDao();

            try
            {
                PaymentDataResults paymentDataResults = pDao.getPayData(out_trade_no);
                WxJsonResult       wxJsonResult       = TemplateApi.SendTemplateMessage(Global.APPID,
                                                                                        paymentDataResults.openId,
                                                                                        Global.ToBePayTemplate,
                                                                                        new
                {
                    keyword1 = new { value = paymentDataResults.billid },
                    keyword2 = new { value = paymentDataResults.billPrice },
                    keyword3 = new { value = paymentDataResults.billValue },
                    keyword4 = new { value = paymentDataResults.bookingTime },
                    keyword5 = new { value = "待支付" },
                    keyword6 = new { value = "船票已预订,请在10分钟内付款,否则船票会被回收!" }
                },
                                                                                        paymentDataResults.formId, "/pages/orderList/orderList?num=0", "keyword3.DATA");
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Example #3
0
 /// <summary>
 /// 支付成功
 /// </summary>
 /// <param name="out_trade_no"></param>
 /// <returns></returns>
 private bool sendTemplateMessage(string out_trade_no)
 {
     try
     {
         PaymentDataResults paymentDataResults = pDao.getPayData(out_trade_no);
         WxJsonResult       wxJsonResult       = TemplateApi.SendTemplateMessage(Global.APPID,
                                                                                 paymentDataResults.openId,
                                                                                 Global.PaySuccessTemplate,
                                                                                 new
         {
             keyword1 = new { value = paymentDataResults.billid },
             keyword2 = new { value = paymentDataResults.billPrice },
             keyword3 = new { value = paymentDataResults.billValue },
             keyword4 = new { value = paymentDataResults.bookingTime },
             keyword5 = new { value = paymentDataResults.bookingState }
         },
                                                                                 paymentDataResults.prePayId, "/pages/orderList/orderList?num=1", "keyword4.DATA");
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }