Пример #1
0
 protected override void OnEnter()
 {
     GetElementById("Ok").Click += Ok_Click;
     if (!ReceiptPrinter.ExistError())
     {
         PrintReceipt(new PowerPay().GetCardReceipt(true));
     }
 }
Пример #2
0
 private void PayResult(TransResult retPay)
 {
     if (retPay == TransResult.E_SUCC)
     {
         //缴费成功,发起确认销账
         CPetroPayBillConfirm billConfirm = new CPetroPayBillConfirm();
         TransResult          retConfirm  = SyncTransaction(billConfirm);
         if (retConfirm != TransResult.E_SUCC)
         {
             CReverse_PetroChinaPay rev = new CReverse_PetroChinaPay(PetroPayBeingPay);
             rev.Reason  = "06";
             rev.Field55 = emv.EMVInfo.AutoField55;
             SyncTransaction(rev);
             ShowMessageAndGotoMain("交易超时,请重试");
         }
         else
         {
             if (ReceiptPrinter.ExistError())
             {
                 StartActivity("中石油支付交易完成");
             }
             else
             {
                 StartActivity("中石油支付交易成功是否打印");
             }
         }
     }
     else if (retPay == TransResult.E_HOST_FAIL)
     {
         if (PetroPayBeingPay.ReturnCode == "51")
         {
             ShowMessageAndGotoMain("温馨提示:抱歉!交易失败!" + "\n" +
                                    "您卡内余额不足!");
         }
         else if (PetroPayBeingPay.ReturnCode == "55")
         {
             StartActivity("中石油支付密码错误");
         }
         else
         {
             ShowMessageAndGotoMain(PetroPayBeingPay.ReturnCode + "-" + PetroPayBeingPay.ReturnMessage);
         }
     }
     else if (retPay == TransResult.E_RECV_FAIL)
     {
         CReverse_PetroChinaPay rev = new CReverse_PetroChinaPay(PetroPayBeingPay);
         rev.Reason  = "98";
         rev.Field55 = emv.EMVInfo.AutoField55;
         SyncTransaction(rev);
         ShowMessageAndGotoMain("交易超时,请重试");
     }
     else
     {
         ShowMessageAndGotoMain("交易失败,请重试");
     }
 }
 void Ok_Click(object sender, HtmlElementEventArgs e)
 {
     if (ReceiptPrinter.ExistError())
     {
         StartActivity("电力支付交易完成");
     }
     else
     {
         StartActivity("电力支付交易成功是否打印");
     }
 }
Пример #4
0
 protected override void OnEnter()
 {
     GetElementById("Return").Click += new HtmlElementEventHandler(Return_Click);
     if (!ReceiptPrinter.ExistError())
     {
         ArrayList al = new YAPaymentPay().GetReceipt();
         al.Add("   ");
         al.Add("   操作成功,后台发生异常,核销失败,请不要继续缴费");
         al.Add("   等待系统自动处理。次日下午4:00以后再行查看缴费情况");
         PrintReceipt(al);
     }
 }
 protected override void OnEnter()
 {
     GetElementById("Return").Click += Return_Click;
     if (!ReceiptPrinter.ExistError())
     {
         ArrayList al = new PowerPay().GetUserReceipt();
         al.Add("   ");
         al.Add("   缴费确认未成功,48小时内系统会自动处理,");
         al.Add("   请耐心等待,不要重复缴费");
         PrintReceipt(al);
     }
 }
Пример #6
0
 protected override void OnEnter()
 {
     GetElementById("Return").Click += Return_Click;
     if (!ReceiptPrinter.ExistError())
     {
         ArrayList al = new YAPaymentPay().GetReceipt();
         al.Add("   ");
         al.Add("   �ɷ�ȷ��δ�ɹ���48Сʱ��ϵͳ���Զ������");
         al.Add("   �����ĵȴ�����Ҫ�ظ��ɷ�");
         PrintReceipt(al);
     }
 }
 protected override void OnEnter()
 {
     GetElementById("Return").Click += Return_Click;
     if (!ReceiptPrinter.ExistError())
     {
         ArrayList al = new YAPaymentPay().GetTPReceipt();
         al.Add("   ");
         al.Add("   银联扣款成功,交警确认失败,");
         al.Add("   请使用自助核销功能进行核销。");
         al.Add("   或耐心等待24小时,系统会自动处理。");
         PrintReceipt(al);
     }
 }
Пример #8
0
        protected override void OnEnter()
        {
            base.OnEnter();
            entity = (GetBusinessEntity() as DHRQPaymentEntity);
            //GetElementById("btnReturn").Style = "display: none";
            //GetElementById("btnHome").Style = "display: none";
            setComponnents("ComComponnents", true, false, false);

            GetElementById("Message1").InnerText = "正在写燃气卡,请稍后... ...";
            int res = WriteCardDeal();

            if (res == 0)
            {
                //写卡成功,打印凭条
                if (ReceiptPrinter.ExistError())
                {
                    StartActivity("德化燃气成功界面");
                }
                //StartActivity("德化燃气正在写燃气卡");
                else
                {
                    StartActivity("德化燃气正在打印");
                }

                //StartActivity("正在打印");
            }
            else
            {
                //写卡出错,发起冲正
                //if (SyncTransaction(new CReverser_DHRQPaymentPay()) == TransResult.E_RECV_FAIL)
                //{
                //    ShowMessageAndGotoMain("交易失败!|交易超时,请重试");
                //    return;
                //}
                if (res == -1)
                {
                    Log.Error("写卡出错|程序出错");
                }
                else
                {
                    string strRes = entity.GetGasCardReaderRes(res);
                    Log.Error("写卡出错|" + strRes);
                }
                ShowMessageAndGotoMain("写卡出错|请联系燃气公司客服人员");
            }
        }
Пример #9
0
        protected override void HandleResult(Result result)
        {
            PowerEntity entity = GetBusinessEntity() as PowerEntity;

            switch (result)
            {
            case Result.Success:
            {
                ReportSync("PowerWriteCard");
                //System.Threading.Thread.Sleep(5000);
                if (!new CPowerCard().WritePowerCard(entity.PowerCardData))
                {
                    //自动调用补写卡操作
                    ReportSync("PowerWriteCardAgain");
                    //System.Threading.Thread.Sleep(5000);
                    TransResult transR = new CPowerCardWriteAgain().WritePowerCardAgain();
                    if (transR != TransResult.E_SUCC)
                    {
                        goto case Result.Fail;
                    }
                }

                if (ReceiptPrinter.ExistError())
                {
                    StartActivity("电力支付交易完成");
                }
                else
                {
                    StartActivity("电力支付交易成功是否打印");
                }
            }
            break;

            case Result.HardwareError:
            case Result.Fail:
            case Result.Cancel:
            case Result.TimeOut:
                StartActivity("电力支付写卡失败");
                break;
            }
        }
Пример #10
0
 private void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Cancelled)
     {
         if (string.IsNullOrEmpty(entity.UnlockMessage))
         {
             entity.UnlockMessage = "渠道购票失败!";
         }
         StartActivity("解锁车票");
     }
     else
     {
         rev.ClearReverseFile();//有做冲正直接return,否则最后要清除冲正文件
         if (ReceiptPrinter.ExistError())
         {
             StartActivity("购票交易成功是否打印");
         }
         else
         {
             StartActivity("购票交易完成");
         }
     }
 }
Пример #11
0
        private void PayProcess()
        {
            CCreditcardPay        pay    = new CCreditcardPay();
            TransResult           result = SyncTransaction(pay);
            CReverse_YAPaymentPay rev    = new CReverse_YAPaymentPay(pay);

            if (result == TransResult.E_SUCC)
            {
                if (bisICCard)
                {
                    int state = emv.EMVTransEnd(entity.RecvField55, entity.RecvField38);
                    if (state != 0)
                    {
                        rev.Reason = "06";
                        SyncTransaction(rev);
                        ShowMessageAndGotoMain("IC确认错误,交易失败,请重试");
                        return;
                    }
                }

                if (ReceiptPrinter.ExistError())
                {
                    StartActivity("信用卡还款打印成功");
                }
                else
                {
                    StartActivity("信用卡还款交易成功");
                }
            }
            else if (result == TransResult.E_HOST_FAIL)
            {
                if (pay.ReturnCode == "51")
                {
                    ShowMessageAndGotoMain("温馨提示:抱歉!交易失败!" + "\n" +
                                           "您卡内余额不足!");
                }
                else if (pay.ReturnCode == "55")
                {
                    StartActivity("信用卡还款密码错误");
                }
                else
                {
                    ShowMessageAndGotoMain(pay.ReturnCode + "-" +
                                           pay.ReturnMessage);
                }
            }
            else if (result == TransResult.E_RECV_FAIL)
            {
                rev.Reason = "98";
                SyncTransaction(rev);
                ShowMessageAndGotoMain("交易超时,请重试");
                return;
            }
            else if (result == TransResult.E_CHECK_FAIL)
            {
                rev.Reason = "96";
                SyncTransaction(rev);
                ShowMessageAndGotoMain("系统异常,请稍后再试");
                return;
            }
            else
            {
                ShowMessageAndGotoMain("交易失败,请重试");
            }

            rev.ClearReverseFile();//在不发冲正文件的情况下,才清除冲正文件
        }
Пример #12
0
        private void PayProcess()
        {
            int nTryConfirm = 3;

            CPowerPayUserBeingPay beingPay = new CPowerPayUserBeingPay();
            TransResult           retPay   = SyncTransaction(beingPay);
            CReverse_PowerPay     rev      = new CReverse_PowerPay(beingPay);

            //Test
            //retPay = TransResult.E_RECV_FAIL;
            //beingPay.ReturnCode = "55";
            if (retPay == TransResult.E_SUCC)
            {
                if (bisICCard)
                {
                    int state = emv.EMVTransEnd(m_entity.RecvField55, m_entity.RecvField38);
                    if (state != 0)
                    {
                        rev.Reason = "06";
                        SyncTransaction(rev);
                        ShowMessageAndGotoMain("IC确认错误,交易失败,请重试");
                        return;
                    }
                }

                rev.ClearReverseFile();//缴费成功之后进入销账流程,不在发冲正报文,清除冲正文件

CONFIRM:
                //缴费成功,发起确认销账
                CPowerPayUserBillConfirm billConfirm = new CPowerPayUserBillConfirm();
                TransResult retConfirm = SyncTransaction(billConfirm);
                //Test
                //retConfirm = TransResult.E_RECV_FAIL;
                if (retConfirm != TransResult.E_SUCC)
                {
                    //超时无响应循环发送确认报文
                    if (nTryConfirm != 0 && (retConfirm == TransResult.E_RECV_FAIL))
                    {
                        nTryConfirm--;
                        goto CONFIRM;
                    }

                    //销账失败
                    //缴费确认未成功,48小时内系统会自动处理,请耐心等待,不要重复缴费
                    string temp0 = "银行卡扣款成功,但销账失败,由系统自行处理电表编号={0},凭证号={1},系统参考号={2},缴费流水号={3}";
                    string temp  = string.Format(temp0, m_entity.DBNo, m_entity.PayTraceNo, m_entity.PayReferenceNo, m_entity.PayFlowNo);
                    Log.Warn(temp);

                    StartActivity("电力支付用户销账失败");
                }
                else
                {
                    string temp = string.Format("销账成功,电表编号:{0},销账流水:{1},缴纳金额:{2}", m_entity.DBNo, m_entity.ConfirmTraceNo, CommonData.Amount.ToString("#######0.00"));
                    Log.Info(temp);
                    if (ReceiptPrinter.ExistError())
                    {
                        StartActivity("电力支付交易完成");
                    }
                    else
                    {
                        StartActivity("电力支付交易成功是否打印");
                    }
                }
            }
            else if (retPay == TransResult.E_HOST_FAIL)
            {
                if (beingPay.ReturnCode == "51")
                {
                    ShowMessageAndGotoMain("温馨提示:抱歉!交易失败!" + "\n" +
                                           "您卡内余额不足!");
                }
                else if (beingPay.ReturnCode == "55")
                {
                    StartActivity("电力支付密码错误");
                }
                else
                {
                    ShowMessageAndGotoMain(beingPay.ReturnCode + "-" + beingPay.ReturnMessage);
                }
            }
            else if (retPay == TransResult.E_RECV_FAIL)
            {
                rev.Reason = "98";
                SyncTransaction(rev);
                ShowMessageAndGotoMain("交易超时,请重试");
                return;
            }
            else if (retPay == TransResult.E_UNPACKET_FAIL)
            {
                rev.Reason = "96";
                SyncTransaction(rev);
                ShowMessageAndGotoMain("系统异常,请稍后再试");
                return;
            }
            else
            {
                ShowMessageAndGotoMain("交易失败,请重试");
            }

            rev.ClearReverseFile();//在不发冲正文件的情况下,才清除冲正文件
        }
Пример #13
0
        private void PayProcess()
        {
            CMobileRecharge       mobileRecharge = new CMobileRecharge();
            TransResult           retPay         = SyncTransaction(mobileRecharge);
            CReverse_YAPaymentPay rev            = new CReverse_YAPaymentPay(mobileRecharge);

            //Test
            //retPay = TransResult.E_RECV_FAIL;
            if (retPay == TransResult.E_SUCC)
            {
                if (bisICCard)
                {
                    int state = emv.EMVTransEnd(entity.RecvField55, entity.RecvField38);
                    if (state != 0)
                    {
                        rev.Reason = "06";
                        SyncTransaction(rev);
                        ShowMessageAndGotoMain("IC确认错误,交易失败,请重试");
                        return;
                    }
                }

                rev.ClearReverseFile();//有做冲正直接return,否则最后要清除冲正文件
                if (ReceiptPrinter.ExistError())
                {
                    StartActivity("手机充值打印成功");
                }
                else
                {
                    StartActivity("手机充值交易成功");
                }

                #region no use
                //缴费成功,发起确认交易
                //CMobileConfirm mobileConfirm = new CMobileConfirm();
                //TransResult retConfirm = SyncTransaction(mobileConfirm);
                //if (retConfirm == TransResult.E_SUCC)
                //{

                //}
                //else if (retConfirm == TransResult.E_HOST_FAIL)
                //{
                //    if (mobileConfirm.ReturnCode.ToUpper() == "ET")
                //    {
                //        //冲正
                //        CReverse_QMPay rev = new CReverse_QMPay(mobileRecharge);
                //        rev.Reason = "06";
                //        SyncTransaction(rev);
                //        ShowMessageAndGotoMain("交易失败");
                //    }
                //    else
                //    {
                //        ShowPringPage();
                //    }
                //}
                //else if (retConfirm == TransResult.E_RECV_FAIL)
                //{
                //    //检查查询交易返回结果
                //    CMobileQuery mobileQuery = new CMobileQuery();
                //    TransResult retQuery = TransResult.E_SUCC;
                //    for (int iPer = 0; iPer < 3; iPer++)
                //    {
                //        retQuery = SyncTransaction(mobileQuery);
                //        if (retQuery == TransResult.E_SUCC)
                //        {
                //            break;
                //        }
                //        else if (retQuery == TransResult.E_HOST_FAIL)
                //        {
                //            if (mobileQuery.ReturnCode.ToUpper() == "ET")
                //            {
                //                //冲正
                //                CReverse_QMPay rev = new CReverse_QMPay(mobileRecharge);
                //                rev.Reason = "06";
                //                SyncTransaction(rev);
                //            }
                //            break;
                //        }
                //        else if (retQuery != TransResult.E_RECV_FAIL)
                //        {
                //            break;
                //        }
                //    }

                //    if (retQuery == TransResult.E_SUCC)
                //    {
                //        ShowPringPage();
                //    }
                //    else if (retQuery == TransResult.E_HOST_FAIL)
                //    {
                //        if (mobileQuery.ReturnCode.ToUpper() == "ET")
                //        {
                //            ShowMessageAndGotoMain("交易失败");
                //        }
                //        else
                //        {
                //            ShowPringPage();
                //        }
                //    }
                //    else //查询交易其他情况
                //    {
                //        ShowPringPage();
                //    }
                //}
                //else //确认交易其他情况
                //{
                //    ShowPringPage();
                //}
                #endregion
            }
            else if (retPay == TransResult.E_HOST_FAIL)
            {
                if (mobileRecharge.ReturnCode == "51")
                {
                    ShowMessageAndGotoMain("温馨提示:抱歉!交易失败!" + "\n" +
                                           "您卡内余额不足!");
                }
                else if (mobileRecharge.ReturnCode == "55")
                {
                    StartActivity("手机充值密码错误");
                }
                else
                {
                    ShowMessageAndGotoMain(mobileRecharge.ReturnCode + "-" +
                                           mobileRecharge.ReturnMessage);
                }
            }
            else if (retPay == TransResult.E_RECV_FAIL)
            {
                rev.Reason = "98";
                SyncTransaction(rev);
                ShowMessageAndGotoMain("交易失败");
                return;
            }
            else if (retPay == TransResult.E_CHECK_FAIL)
            {
                rev.Reason = "96";
                SyncTransaction(rev);
                ShowMessageAndGotoMain("系统异常,请稍后再试");
                return;
            }
            else
            {
                ShowMessageAndGotoMain("交易失败");
            }
            rev.ClearReverseFile();//有做冲正直接return,否则最后要清除冲正文件
        }
Пример #14
0
        private void PayProcess()
        {
            TransAccessFactory db = new TransAccessFactory();
            int nTryConfirm       = 3;
            CPetroPayBeingPay     PetroPayBeingPay = new CPetroPayBeingPay();
            TransResult           retPay           = SyncTransaction(PetroPayBeingPay);
            CReverse_YAPaymentPay rev = new CReverse_YAPaymentPay(PetroPayBeingPay);

            if (retPay == TransResult.E_SUCC)
            {
                if (bisICCard)
                {
                    int state = emv.EMVTransEnd(YAPaymentPay.RecvField55, YAPaymentPay.RecvField38);
                    if (state != 0)
                    {
                        rev.Reason = "06";
                        SyncTransaction(rev);
                        ShowMessageAndGotoMain("IC确认错误,交易失败,请重试");
                        return;
                    }
                }

                if (GlobalAppData.GetInstance().AccessSwitch)
                {
                    db.PayTraceNo = YAPaymentPay.PayTraceNo;
                    ResponseData rd = new YAPaymentPay().GetResponseData();
                    db.InsertTransLog(rd);
                }
CONFIRM:
                //缴费成功,发起确认销账
                CPetroPayBillConfirm billConfirm = new CPetroPayBillConfirm();
                TransResult retConfirm = SyncTransaction(billConfirm);
                //Test
                //retConfirm = TransResult.E_RECV_FAIL;
                //PetroChinaPay.PayTraceNo = "111111";
                //PetroChinaPay.PayReferenceNo = "123456789012345678";
                if (retConfirm != TransResult.E_SUCC &&
                    retConfirm != TransResult.E_RECV_FAIL)
                {
                    if (GlobalAppData.GetInstance().AccessSwitch)
                    {
                        db.UpdateTransLog(EnumConfirmFlag.E_REVERSE);
                    }

                    //失败但不超时才发冲正
                    if (bisICCard)
                    {
                        rev.SetField55Value(emv.EMVInfo.EndField55, emv.EMVInfo.EndField55.Length);//处理之后的55域
                    }
                    rev.Reason = "06";
                    SyncTransaction(rev);
                    ShowMessageAndGotoMain("交易超时,请重试");
                    return;
                }
                else if (retConfirm == TransResult.E_RECV_FAIL)
                {
                    //超时无响应循环发送确认报文
                    if (nTryConfirm != 0)
                    {
                        nTryConfirm--;
                        goto CONFIRM;
                    }

                    //销账失败
                    //操作成功,后台发生异常,核销失败,请不要继续缴费,
                    //等待系统自动处理。次日下午4:00以后再行查看缴费情况
                    Log.Warn("银行卡扣款成功,但销账失败,需人工处理CardNo=" + CommonData.BankCardNum +
                             " 凭证号=" + YAPaymentPay.PayTraceNo + " 系统参考号=" + YAPaymentPay.PayReferenceNo);
                    rev.ClearReverseFile();//清除冲正文件
                    StartActivity("中石油支付销账失败");

                    //string failPath = Path.Combine(Application.StartupPath, "PetroConfirmFailInfo.dat");
                    //ConfirmFailInfo info = new ConfirmFailInfo();
                    //info.BankCardNo = CommonData.BankCardNum;
                    //info.PayTraceNo = PetroChinaPay.PayTraceNo;
                    //info.PayReferenceNo = PetroChinaPay.PayReferenceNo;
                    //List<ConfirmFailInfo> list = new List<ConfirmFailInfo>();
                    //list.Add(info);
                    //Utility.SaveToFile<ConfirmFailInfo>(failPath, list);
                }
                else
                {
                    if (GlobalAppData.GetInstance().AccessSwitch)
                    {
                        db.UpdateTransLog(EnumConfirmFlag.E_SUCC);
                    }

                    rev.ClearReverseFile();//清除冲正文件
                    if (ReceiptPrinter.ExistError())
                    {
                        StartActivity("中石油支付交易完成");
                    }
                    else
                    {
                        StartActivity("中石油支付交易成功是否打印");
                    }
                }
            }
            else if (retPay == TransResult.E_HOST_FAIL)
            {
                if (PetroPayBeingPay.ReturnCode == "51")
                {
                    ShowMessageAndGotoMain("温馨提示:抱歉!交易失败!" + "\n" +
                                           "您卡内余额不足!");
                }
                else if (PetroPayBeingPay.ReturnCode == "55")
                {
                    StartActivity("中石油支付密码错误");
                }
                else
                {
                    ShowMessageAndGotoMain(PetroPayBeingPay.ReturnCode + "-" + PetroPayBeingPay.ReturnMessage);
                }
            }
            else if (retPay == TransResult.E_RECV_FAIL)
            {
                rev.Reason = "98";
                SyncTransaction(rev);
                ShowMessageAndGotoMain("交易超时,请重试");
                return;
            }
            else
            {
                ShowMessageAndGotoMain("交易失败,请重试");
            }

            rev.ClearReverseFile();//在不发冲正文件的情况下,才清除冲正文件
        }
Пример #15
0
        protected override void HandleResult(Result result)
        {
            int nTryConfirm = 3;
            PowerEntity entity = GetBusinessEntity() as PowerEntity;

            CPowerCard powerCard = new CPowerCard();
            if (!powerCard.ReadPowerCard(entity.PowerCardData))
            {
                StartActivity("电力支付写卡失败");//
                return;
            }
            CONFIRM:
            //缴费成功,发起确认销账
            retConfirm = TransResult.E_RECV_FAIL;
            //PostAsync(ConfirmTrans);
            ConfirmTrans();
            if (retConfirm != TransResult.E_SUCC)//如果返回失败结果,超时有重复3次
            {
                //超时无响应循环发送确认报文
                if (nTryConfirm != 0 && (retConfirm == TransResult.E_RECV_FAIL))
                {
                    nTryConfirm--;
                    goto CONFIRM;
                }

                //销账失败
                //缴费确认未成功,48小时内系统会自动处理,请耐心等待,不要重复缴费
                string temp0 = "银行卡扣款成功,但销账失败,由系统自行处理CardNo={0},凭证号={1},系统参考号={2},缴费流水号={3}";
                string temp = string.Format(temp0, CommonData.BankCardNum, entity.PayTraceNo,
                    entity.PayReferenceNo, entity.PayFlowNo);
                Log.Warn(temp);
                StartActivity("电力支付销账失败");//
            }
            else
            {
                Log.Info("用户号:" + entity.PowerCardNo + "银联商户订单号:" + entity.PowerPayConfirmCode);
                ReportSync("PowerWriteCard");
                //System.Threading.Thread.Sleep(5000);
                //if (!new CPowerCard().WritePowerCard(entity.PowerCardData))
                //{
                    //自动调用补写卡操作
                    //ReportSync("PowerWriteCardAgain");
                System.Threading.Thread.Sleep(10000);
                for (int i = 0; i < 4; i++)
                {
                    TransResult transRet = new CPowerCardWriteAgain().WritePowerCardAgain();
                    if (transRet != TransResult.E_SUCC && i==2)
                    {
                        StartActivity("电力支付写卡失败");
                        return;
                    }
                    if (transRet == TransResult.E_SUCC)
                    {
                        if (ReceiptPrinter.ExistError())
                            StartActivity("电力支付交易完成");
                        else
                            StartActivity("电力支付交易成功是否打印");
                        break;
                    }
                    System.Threading.Thread.Sleep(500);
                }
                //}
                //if (!powerCard.ReadPowerCard(entity.PowerCardData))
                //{
                //    StartActivity("电力支付写卡失败");//
                //    return;
                //}
                //写卡成功
                //for (int i = 0; i < 3; i++)
                //{
                //    //购电校验
                //    ReportSync("PowerCheckAmount");
                //    retConfirm = ConfirmBillProcess();
                //    if (retConfirm == TransResult.E_SUCC)
                //    {
                //        Log.Info("entity.CheckBuyAmount:" + double.Parse(Utility.StringToAmount(entity.CheckWriteAmount)) + " entity.PowerPayAmount:" + CommonData.Amount + " entity.CheckWriteCardAmount:" + double.Parse(Utility.StringToAmount(entity.CheckRechargeAmount)));
                //        if ((double.Parse(Utility.StringToAmount(entity.CheckWriteAmount)) == CommonData.Amount) || (double.Parse(Utility.StringToAmount(entity.CheckRechargeAmount)) == CommonData.Amount))
                //        {
                //            //校验成功
                //            if (ReceiptPrinter.ExistError())
                //                StartActivity("电力支付交易完成");
                //            else
                //                StartActivity("电力支付交易成功是否打印");
                //            break;
                //        }
                //        else
                //        {
                //            //校验失败,进行补写卡
                //            if (i < 2)
                //            {
                //                ReportSync("PowerWriteCardAgain");
                //                //System.Threading.Thread.Sleep(5000);
                //                TransResult transR = new CPowerCardWriteAgain().WritePowerCardAgain();
                //                if (transR != TransResult.E_SUCC)
                //                {
                //                    StartActivity("电力支付写卡失败");
                //                    break;
                //                }
                //                continue;
                //            }
                //            else
                //            {
                //                ShowMessageAndGotoMain("购电校验失败, 请到柜台处理");
                //                break;
                //            }
                //        }
                //    }
                //    if (retConfirm == TransResult.E_RECV_FAIL)
                //    {
                //        //交易超时,再次校验
                //        if (i < 2)
                //        {
                //            continue;
                //        }
                //        else
                //        {
                //            ShowMessageAndGotoMain("购电校验超时, 请到柜台处理");
                //            break;
                //        }
                //    }
                //    else
                //        break;
                //}
            }
            
        }
Пример #16
0
        private void PayProcess()
        {
            DHRQTranspay             pay    = new DHRQTranspay();
            TransResult              result = SyncTransaction(pay);
            CReverser_DHRQPaymentPay rev    = new CReverser_DHRQPaymentPay(pay);

            //ReportSync("BeingPay");
            if (result == TransResult.E_SUCC)
            {
                //if (bisICCard)
                //{
                //    int state = emv.EMVTransEnd(entity.RecvField55, entity.RecvField38);
                //    if (state != 0)
                //    {
                //        rev.Reason = "06";
                //        SyncTransaction(rev);
                //        ShowMessageAndGotoMain("交易失败!|IC确认错误,交易失败,请重试");
                //        return;
                //    }
                //}

                if (ReceiptPrinter.ExistError())
                {
                    StartActivity("重庆园博园正在打印");
                }
                else
                {
                    StartActivity("重庆园博园成功界面");
                }
            }
            else if (result == TransResult.E_HOST_FAIL)
            {
                if (pay.ReturnCode == "51")
                {
                    ShowMessageAndGotoMain("交易失败!|您卡内余额不足!");
                }
                else if (pay.ReturnCode == "55")
                {
                    ShowMessageAndGotoMain("交易失败!|密码错误!");
                }
                else
                {
                    ShowMessageAndGotoMain(pay.ReturnCode + "|" +
                                           pay.ReturnMessage);
                }
            }
            else if (result == TransResult.E_RECV_FAIL)
            {
                rev.Reason = "98";
                SyncTransaction(rev);
                ShowMessageAndGotoMain("交易失败!|交易超时,请重试");
                return;
            }
            else if (result == TransResult.E_CHECK_FAIL)
            {
                rev.Reason = "96";
                SyncTransaction(rev);
                ShowMessageAndGotoMain("交易失败!|系统异常,请稍后再试");
                return;
            }
            else
            {
                ShowMessageAndGotoMain("交易失败|请重试");
            }

            rev.ClearReverseFile();//在不发冲正文件的情况下,才清除冲正文件
        }