public string TuitionPayment(PaymentDTO model, out long orderID)
        {
            string CallBackUrl  = ConfigurationManager.AppSettings["TuitionPaymentCallback"];
            string TerminalId   = ConfigurationManager.AppSettings["Mellat_TerminalId"];
            string UserName     = ConfigurationManager.AppSettings["UserName"];
            string UserPassword = ConfigurationManager.AppSettings["UserPassword"];
            var    bpService    = new ir.shaparak.bpm1.PaymentGatewayImplService();
            var    PayDate      = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Day.ToString().PadLeft(2, '0');
            var    PayTime      = DateTime.Now.Hour.ToString().PadLeft(2, '0') + DateTime.Now.Minute.ToString().PadLeft(2, '0') + DateTime.Now.Second.ToString().PadLeft(2, '0');

            BypassCertificateError();

            orderID = PaymentDAO.CreateTuitionPayment(model);

            if (orderID > 0)
            {
                var payerId = createPayerID(model.stcode, 0, 0);

                var result = bpService.bpPayRequest(long.Parse(TerminalId),
                                                    UserName,
                                                    UserPassword,
                                                    orderID,
                                                    model.Amount,
                                                    PayDate,
                                                    PayTime,
                                                    model.stcode,
                                                    CallBackUrl, payerId);

                return(result);
            }
            return("");
        }
        public string pay(long amount, string payerUserID, out long orderID, int appID = 0, int payType = 0)
        {
            string CallBackUrl  = appID == 1? ConfigurationManager.AppSettings["Mellat_CallBackUrl"] : ConfigurationManager.AppSettings["Mellat_Request_CallBackUrl"];
            string TerminalId   = ConfigurationManager.AppSettings["Mellat_TerminalId"];
            string UserName     = ConfigurationManager.AppSettings["UserName"];
            string UserPassword = ConfigurationManager.AppSettings["UserPassword"];
            var    bpService    = new ir.shaparak.bpm1.PaymentGatewayImplService();

            orderID = GenerateOrderId();
            var PayDate = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0') + DateTime.Now.Day.ToString().PadLeft(2, '0');
            var PayTime = DateTime.Now.Hour.ToString().PadLeft(2, '0') + DateTime.Now.Minute.ToString().PadLeft(2, '0') + DateTime.Now.Second.ToString().PadLeft(2, '0');

            BypassCertificateError();


            var payerId = createPayerID(payerUserID, appID, payType);


            var result = bpService.bpPayRequest(long.Parse(TerminalId),
                                                UserName,
                                                UserPassword,
                                                orderID,
                                                amount,
                                                PayDate,
                                                PayTime,
                                                payerUserID,
                                                CallBackUrl, payerId);

            return(result);
        }