Ejemplo n.º 1
0
 public SBRFCreditCardConnector()
 {
     try
     {
         Utils.ToCardLog("SBRFCreditCardConnector.Init() ");
         SBRFSRV.Server SBSrv = new SBRFSRV.Server();
         SBSrv.Clear();
         Utils.ToCardLog("SBRFCreditCardConnector.Init() End");
         Inited = true;
     }
     catch (Exception e)
     {
         Utils.ToCardLog("[Error] SBRFCreditCardConnector.Init() " + e.Message);
     }
 }
Ejemplo n.º 2
0
        public void TestPinPad()
        {
            OperInProcess = true;
            SBRFSRV.Server SBSrv = new SBRFSRV.Server();
            SBSrv.Clear();
            int    res    = SBSrv.NFun(13);
            string ResStr = "";

            if (res == 0)
            {
                ResStr = "Пинпад готов к работе";
            }
            else
            {
                ResStr = "Ошибка соединения с пинпадом. Номер ошибки " + res.ToString();
            }
            OperInProcess = false;
            Receipt       = "";
            CreditCardAlohaIntegration.CreditCardOperationComplited(CreditCardOperationType.TestPinPad, true, res == 0, ResStr, Receipt);
        }
Ejemplo n.º 3
0
        private void RunOper()
        {
            try
            {
                Utils.ToCardLog("Запуск RunOper OperType=" + mOperType.ToString() + " Amount= " + Amount.ToString());
                OperInProcess = true;
                SBRFSRV.Server SBSrv = new SBRFSRV.Server();
                SBSrv.Clear();
                Int32 res = -1;
                if (mOperType == CreditCardOperationType.Payment)
                {
                    SBSrv.SParam("Amount", Math.Abs(Amount).ToString());
                    res = SBSrv.NFun(4000);
                }
                else if (mOperType == CreditCardOperationType.VoidPayment)
                {
                    SBSrv.SParam("Amount", Math.Abs(Amount).ToString());
                    res = SBSrv.NFun(4002);
                }
                else if (mOperType == CreditCardOperationType.Sverka)
                {
                    res = SBSrv.NFun(6000);
                }
                else if (mOperType == CreditCardOperationType.XReport)
                {
                    res = SBSrv.NFun(6002);
                }
                else if (mOperType == CreditCardOperationType.LongReport)
                {
                    res = SBSrv.NFun(7000);
                }
                else if (mOperType == CreditCardOperationType.LastChk)
                {
                    //   SBSrv.SParam("PayInfo", "3");
                    res = SBSrv.NFun(7001);
                }
                Receipt = SBSrv.GParamString("Cheque");
                if (Receipt == null)
                {
                    Receipt = "";
                }
                Receipt = AddCutToReceipt(Receipt);
                if (Receipt != "")
                {
                    CreditCardAlohaIntegration.CreditCardOperationComplited(mOperType, false, res == 0, res.ToString(), Receipt);
                }
                else

                {
                    CreditCardAlohaIntegration.CreditCardOperationComplited(mOperType, true, res == 0, "Код ошибки " + res.ToString(), Receipt);
                }
                SBSrv.Clear();
                OperInProcess = false;
                Utils.ToCardLog("Отработал RunOper OperType=" + mOperType.ToString() + " Amount= " + Amount.ToString());
            }
            catch (Exception e)
            {
                OperInProcess = false;
                resOper       = "Ошибка программы. " + e.Message;
                RespCode      = "-1";
                CreditCardAlohaIntegration.CreditCardOperationComplited(mOperType, true, false, resOper, Receipt);
                Utils.ToCardLog("[Error] Запускa RunOper " + e.Message);
            }
        }