Пример #1
0
        void submitData(ChargeResult cr)
        {
            /*
             *           url: 'https://www.wolfinv.com/pk10/app/submitCharge.asp',
             * data: {
             * reqId: myThis.data.reqId,
             * wxId: myThis.data.telNo,
             * wxName: myThis.data.wxName,
             * chargeAmt: myThis.data.chargeAmt,
             * chargeAccount: myThis.data.chargeAccount,
             * orderNum: myThis.data.orderNum,
             * imgData: "已获取到base64",
             * bankNo: myThis.data.bankNo,
             * bankName:myThis.data.bankName,
             * provider: 'littleFunction'
             */
            string urlM = "http://www.wolfinv.com/pk10/app/submitCharge.asp?reqId={0}&wxId={1}&wxName={2}&chargeAmt={3}&chargeAcount={4}&orderNum={5}&provider={6}&imgData={7}";
            string url  = string.Format(urlM,
                                        cr.reqId,
                                        roomName,
                                        requestNike,
                                        cr.chargeAmt,
                                        cr.chargeAccount,
                                        cr.orderNum,
                                        "",
                                        cr.imgData
                                        );

            new WebClient().DownloadString(url);
        }
Пример #2
0
        public override bool ResponseAsk(TheAskWaitingUserAnswer ask)
        {
            //wxprocess.CopyToHistoryAsks(ask);
            // wxprocess.CloseCurrAsk(ask);
            if (ask.AnswerResult.key == "0")//结束流程
            {
                answerMsg("欢迎下次使用!");
                return(false);
            }
            else
            {
                ShareLotteryPlanClass plan = null;
                if (ask.UserResponseAnswer.Count == 1) //确定上次的金额
                {
                    if (Buffs.Count != 1)
                    {
                        answerMsg("上次存储的金额信息丢失!请重新申请");
                        return(false);
                    }
                    string signatrue = "";
                    //if (signatrue.ToString().ToUpper().Equals(sha1result))
                    //{

                    //}
                    try
                    {
                        answerMsg("生成和获取二维码需要一定时间,请您耐心等候!");
                        string      url = string.Format("http://www.wolfinv.com/pk10/app/charge.asp?chargeAmt={0}&rnd={1}&wxId={2}&wxName={3}&provide={4}", ask.LastRequestWaitResponse.Buffs[0], new Random().Next(), wxmsg.FromMemberUserName, wxmsg.FromMemberNikeName, wxprocess.RobotNikeName);
                        WebClientTo wc  = new WebClientTo(3 * 60 * 1000);
                        wc.Encoding = System.Text.Encoding.UTF8;
                        string res = wc.DownloadString(url);

                        JavaScriptClass jsc = new JavaScriptClass();
                        ChargeResult    cr  = new ChargeResult();

                        cr = cr.GetFromJson <ChargeResult>(res);

                        if (cr == null)
                        {
                            answerMsg("服务器异常!" + url);
                            return(false);
                        }
                        if (!string.IsNullOrEmpty(cr.imgData) && cr.imgData.Trim() != "空")
                        {
                            answerMsg(string.Format(@"订单号:{0};订单金额:{1}元 ;
请在三分钟内在云闪付内完成支付!", cr.orderNum, cr.chargeAmt));
                            answerMsg(cr.imgData, null, null, true);
                            //string insql = "insert into userchargetable(
                            //chargeid,wxid,wxname,chargeamt,ordernum,imgurl,ChargeAccount) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')";

                            /*if (db != null)
                             * {
                             *  int cnt = db.ExecSql(new ConditionSql(string.Format(insql,
                             *      cr.reqId,
                             *      ask.LastRequestWaitResponse.roomName,
                             *      ask.LastRequestWaitResponse.requestNike,
                             *      cr.chargeAmt,
                             *      cr.orderNum,
                             *      cr.imgData,
                             *      cr.chargeAccount)));
                             * }*/
                            Task.Run(() => {
                                submitData(cr);
                            });
                        }
                        else
                        {
                            answerMsg(cr.msg);
                            return(false);
                        }

                        //answerMsg(cr.imgData);
                        return(false);
                    }
                    catch (Exception ce)
                    {
                        answerMsg(string.Format("{0}:{1}", ce.Message, ce.StackTrace));
                        //throw ce;
                        return(false);
                    }
                }
                else
                {
                    answerMsg("请重新提交金额!");
                    return(false);
                }

                return(false);
            }
            return(false);
        }