Example #1
0
        public static int SendOfflineOperation()
        {
            int res = Cbposlib.SendOfflinePayments();

            MessageBox.Show("Количество выгруженных оффлайн операций: " + res, "Выгрузка оффлайн операций");
            return(res);
        }
Example #2
0
        public static string BonusReceipt()
        {
            string check = AdditionalFunc.StringFromNativeUtf8(Cbposlib.getReceiptHeaderPtr());

            check = check + AdditionalFunc.StringFromNativeUtf8(Cbposlib.getReceiptBodyPtr());
            check = check + AdditionalFunc.StringFromNativeUtf8(Cbposlib.getReceiptFooterPtr());

            return(check);
        }
Example #3
0
        public static string ResultStateMessage()
        {
            string delState = String.Empty;

            if (string.Equals(StringFromNativeUtf8(Cbposlib.getResponseStateCode()), "INCORRECT_REQUEST_ID"))
            {
                File.Delete("STATE");
                delState = "Удаляем файл STATE";
            }

            return(delState);
        }
Example #4
0
        public static string DetailReportOperation(string beginDate, string endDate)
        {
            int res = Cbposlib.GenerateReport(beginDate, endDate);

            if (res < 0)
            {
                MessageBox.Show(AdditionalFunc.StringFromNativeUtf8(Cbposlib.GetErrorMessage(res)), "Ошибка");
                return(res.ToString());
            }

            string report = AdditionalFunc.StringFromNativeUtf8(Cbposlib.GetReportPtr());

            return(report);
        }
Example #5
0
        public static int GetResultAPI(int res)
        {
            if (res != 0)
            {
                if (res == -405)
                {
                    MessageBox.Show(StringFromNativeUtf8(Cbposlib.getResponseStateCodeDescription()) + "\n" + ResultStateMessage(), "Ошибка");
                    return(1);
                }

                MessageBox.Show(StringFromNativeUtf8(Cbposlib.GetErrorMessage(res)), "Ошибка");
                return(1);
            }

            return(0);
        }
Example #6
0
        public static int AfterOperation()
        {
            int result = 0;
            int res    = Cbposlib.CloseTransaction();

            if (res != 0)
            {
                result = 1;
                MessageBox.Show(AdditionalFunc.StringFromNativeUtf8(Cbposlib.GetErrorMessage(res)), "Ошибка");
            }

            res = Cbposlib.BPOSClean();

            if (res != 0)
            {
                result = 1;
                MessageBox.Show(AdditionalFunc.StringFromNativeUtf8(Cbposlib.GetErrorMessage(res)), "Ошибка");
            }

            return(result);
        }
Example #7
0
        public static int BeforeOperation(string cardNum)
        {
            int result = 0;
            int res    = Cbposlib.BPOSInit();

            if (res != 0)
            {
                result = 1;
                MessageBox.Show(AdditionalFunc.StringFromNativeUtf8(Cbposlib.GetErrorMessage(res)), "Ошибка");
            }
            else
            {
                res = Cbposlib.CreateTransaction(cardNum, "TestEmployeeId");

                if (res != 0)
                {
                    result = 1;
                    MessageBox.Show(AdditionalFunc.StringFromNativeUtf8(Cbposlib.GetErrorMessage(res)), "Ошибка");
                }
            }

            return(result);
        }
Example #8
0
        public static int OpenShift(string shiftid)
        {
            int res = Cbposlib.OpenShift(shiftid);

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #9
0
        public static int LinkCardOperation(string linkcardNum)
        {
            int res = Cbposlib.LinkCardProc(linkcardNum);

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #10
0
        public static int ExchangeOperation(string token)
        {
            int res = Cbposlib.ExchangeProc(token);

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #11
0
        public static int PaymentOperation(int spend, string bill)
        {
            int res = Cbposlib.PaymentProc(spend, bill);

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #12
0
        public static int CashBackSecondTypeOperation(string rrn, int cashback_sum)
        {
            int res = Cbposlib.CashBackSumProc(rrn, cashback_sum);

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #13
0
        public static int DepositOperation(int depositSum)
        {
            int res = Cbposlib.DepositProc(depositSum);

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #14
0
        public static string GetRRN()
        {
            string rrn = AdditionalFunc.StringFromNativeUtf8(Cbposlib.getRRNForCancel());

            return(rrn);
        }
Example #15
0
        public static int ConfirmOperation(string rrn)
        {
            int res = Cbposlib.PaymentConfirmProc(rrn);

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #16
0
        public static string HashCardNumOperation(string cardNum)
        {
            string hash = AdditionalFunc.StringFromNativeUtf8(Cbposlib.BposHashForCardNum(cardNum));

            return(hash);
        }
Example #17
0
        public static int CloseShift()
        {
            int res = Cbposlib.CloseShift();

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #18
0
        public static int BalanceOperation()
        {
            int res = Cbposlib.BalanceProc();

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #19
0
        public static int ActivationOperation(string activation_type, string bill, int amount, string type, string refer_card_num)
        {
            int res = Cbposlib.ActivationProc(activation_type, bill, amount, type, refer_card_num);

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #20
0
        public static int CancelOperation(string rrn)
        {
            int res = Cbposlib.CancelProc(rrn);

            return(AdditionalFunc.GetResultAPI(res));
        }
Example #21
0
        public static int CashBackFirstTypeOperation(string rrn, string cashback_file)
        {
            int res = Cbposlib.CashBackProc(rrn, cashback_file);

            return(AdditionalFunc.GetResultAPI(res));
        }