Ejemplo n.º 1
0
        private void PayProcess()
        {
            QueryBalancePay query = new QueryBalancePay();
            DHRQTranspay    pay   = new DHRQTranspay();
            TransResult     res   = TransResult.E_INVALID;

            if (!entity.isSign)
            {
                res = SyncTransaction(query);
            }
            if (res == TransResult.E_SUCC || entity.isSign)
            {
                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;
                        //}
                    }
                    StartActivity("德化燃气正在写燃气卡");
                }
                else if (result == TransResult.E_HOST_FAIL)
                {
                    if (pay.ReturnCode == "1370" || pay.ReturnCode == "0370")
                    {
                        //ShowMessageAndGotoMain("交易失败!|您卡内余额不足!");
                        StartActivity("德化燃气余额不足提示");
                    }
                    else
                    {
                        ShowMessageAndGotoMain("交易失败|" + entity.returnCode + entity.returnMsg);
                    }
                }
                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("交易失败|请重试");
                }
            }
            else
            {
                Log.Error("[DHRQBeingProcessDeal][PayProcess] err == query fail");
                ShowMessageAndGotoMain("交易失败|查询余额失败");
            }
            //rev.ClearReverseFile();//在不发冲正文件的情况下,才清除冲正文件
        }
Ejemplo n.º 2
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();//在不发冲正文件的情况下,才清除冲正文件
        }