private void Grid_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            e.Handled = true;
            switch (e.Key)
            {
            case Key.A:
                PaymentButton_Click(sender, e);
                break;

            case Key.B:
                TopupButton_Click(sender, e);
                break;

            case Key.C:
                BillRequestButton_Click(sender, e);
                break;

            default:
                TransactionInfo.GoToPage(Pages.SelectOperationPage);
                break;
            }
        }
        public ConfirmPayment(TransactionInfo transactionInfo)
        {
            InitializeComponent();

            TransactionInfo = transactionInfo;
            string price        = null;
            string titleMessage = string.Empty;

            if (TransactionInfo.PaymentRequest != null)
            {
                titleMessage = "خرید";
                price        = transactionInfo.PaymentRequest.Amount;
            }


            if (transactionInfo.BillRequest != null)
            {
                titleMessage = string.Format("پرداخت قبض به شناسه پرداخت{0} و شناسه قبض{1}", transactionInfo.BillRequest.PaymentId, transactionInfo.BillRequest.BillId);
                var strLenght = transactionInfo.BillRequest.PaymentId.Length;
                price = transactionInfo.BillRequest.Amount = transactionInfo.BillRequest.PaymentId.Substring(0, strLenght - 5) + "000";
            }

            if (transactionInfo.TopupRequest != null)
            {
                titleMessage = string.Format("شارژ {0}  ریالی {1} طرح {2}", transactionInfo.TopupRequest.Amount, GetOperatorName(transactionInfo.TopupRequest.VoucherOperator), GetOperatorName(transactionInfo.TopupRequest.ProfileId));
                price        = transactionInfo.TopupRequest.Amount;
            }

            if (double.TryParse(price, out double result))
            {
                TitleLabel.Content   = titleMessage;
                MessageLabel.Content = string.Format("آیا واریز مبلغ {0} ریال را تایید می کنید؟", price);
            }
            else
            {
                MessageLabel.Content = string.Format("تراکنش ناموفق", price);
                MessageLabel.Content = price;
            }
        }
Пример #3
0
        public static void Payment(TransactionInfo transactionInfo)
        {
            var paymentRequest = new PaymentRequest()
            {
                CustomerId     = customerId,
                Amount         = transactionInfo.PaymentRequest.Amount,
                LocalIP        = AppGlobal.LocalIP,
                PAN            = transactionInfo.Pan,
                PINBlock       = transactionInfo.Pinblock,
                Serial         = AppGlobal.Serial,
                TerminalID     = AppGlobal.TerminalID,
                Track2Ciphered = transactionInfo.Track2Card,
            };

            switch (transactionInfo.PaymentRequest.UnitId)
            {
            case 1:
                customerName = "لوازم خانگی ملاحسینی";
                customerTell = "8844255";
                break;

            case 2:
                customerName = "آزمایشگاه";
                customerTell = "8844255";
                break;

            case 3:
                customerName = "سونوگرافی";
                customerTell = "77554488";
                break;

            case 4:
                customerName = "سی تی اسکن";
                customerTell = "44775511";
                break;

            case 5:
                customerName = "رادیولوژی";
                customerTell = "88774445";
                break;
            }

            var cardIssuerBank = AppGlobal.BankCardNumList
                                 .FirstOrDefault(w => w.Key == paymentRequest.PAN.Substring(0, 6)).Value;
            var PanRecipt = $"{paymentRequest.PAN.Substring(0, 6)}××××××{paymentRequest.PAN.Substring(12, 4)}";

            var result = HttpHelper.Post(serverAddress + "/api/TransactionService/PaymentRequest", paymentRequest,
                                         new CancellationToken());

            var    report     = new StiReport();
            string ReportName = string.Empty;

            if (result != null && result.Status != "TransactionFaild")
            {
                ReportName = "ReciptSuccess.mrt";
                var reportPath = $"{AppDomain.CurrentDomain.BaseDirectory}Recipts\\{ReportName}";
                report.Load(reportPath);


                report.Dictionary.Variables.Add("Transaction", "خرید");
                report.Dictionary.Variables.Add("customerName", customerName);
                report.Dictionary.Variables.Add("customerTell", customerTell);
                report.Dictionary.Variables.Add("terminalID", paymentRequest.TerminalID);
                report.Dictionary.Variables.Add("PAN", PanRecipt);
                report.Dictionary.Variables.Add("cardIssuerBank", cardIssuerBank);
                report.Dictionary.Variables.Add("PSPRefNo", result.RefNo ?? string.Empty);
                report.Dictionary.Variables.Add("systemRefNo", result.ClientRefNo ?? string.Empty);
                report.Dictionary.Variables.Add("transactionStatus", result.Message);
                report.Dictionary.Variables.Add("amount", paymentRequest.Amount);
            }
            else
            {
                ReportName = "ReciptFailed.mrt";
                var reportPath = $"{AppDomain.CurrentDomain.BaseDirectory}Recipts\\{ReportName}";
                report.Load(reportPath);

                report.Dictionary.Variables.Add("Transaction", "خرید");
                report.Dictionary.Variables.Add("customerName", customerName);
                report.Dictionary.Variables.Add("customerTell", customerTell);
                report.Dictionary.Variables.Add("terminalID", paymentRequest.TerminalID);
                report.Dictionary.Variables.Add("PAN", PanRecipt);
                report.Dictionary.Variables.Add("cardIssuerBank", cardIssuerBank);
                report.Dictionary.Variables.Add("transactionStatus", result != null ? result.Message : "تراکنش ناموفق");
            }

            try
            {
                report.Print(false);
            }
            catch (Exception ex)
            {
                if (result != null)
                {
                    result.Message += $"{Environment.NewLine}در حال حاضر امکان چاپ رسید وجود ندارد.";
                }
            }
        }
Пример #4
0
 public InputPrice(TransactionInfo transactionInfo)
 {
     InitializeComponent();
     TransactionInfo = transactionInfo;
 }
Пример #5
0
 public CardReader(TransactionInfo transactionInfo)
 {
     InitializeComponent();
     TransactionInfo = transactionInfo;
 }
Пример #6
0
 public override UserControl FactoryMethod(TransactionInfo transactionInfo)
 {
     return(new InputMobileNO(transactionInfo));
 }
 private void TopupButton_Click(object sender, RoutedEventArgs e)
 {
     TransactionInfo.TopupRequest = new TopupRequest();
     TransactionInfo.GoToPage(Pages.SelectVoucherOperatorPage);
 }
Пример #8
0
 public abstract UserControl FactoryMethod(TransactionInfo transactionInfo);
Пример #9
0
 public override UserControl FactoryMethod(TransactionInfo transactionInfo)
 {
     return(new ConfirmPayment(transactionInfo));
 }
Пример #10
0
 public override UserControl FactoryMethod(TransactionInfo transactionInfo)
 {
     return(new SelectVoucherPrice(transactionInfo));
 }
Пример #11
0
 public override UserControl FactoryMethod(TransactionInfo transactionInfo)
 {
     return(new PinPad(transactionInfo));
 }
Пример #12
0
 public override UserControl FactoryMethod(TransactionInfo transactionInfo)
 {
     return(new CardReader(transactionInfo));
 }
Пример #13
0
 public override UserControl FactoryMethod(TransactionInfo transactionInfo)
 {
     return(new SelectPaymentOperation(transactionInfo));
 }
Пример #14
0
        public static void BillRequest(TransactionInfo transactionInfo)
        {
            var bill = new BillRequest()
            {
                CustomerId     = customerId,
                BillId         = transactionInfo.BillRequest.BillId,
                PaymentId      = transactionInfo.BillRequest.PaymentId,
                LocalIP        = AppGlobal.LocalIP,
                PAN            = transactionInfo.Pan,
                PINBlock       = transactionInfo.Pinblock,
                Serial         = AppGlobal.Serial,
                TerminalID     = AppGlobal.TerminalID,
                Track2Ciphered = transactionInfo.Track2Card,
                Amount         = transactionInfo.BillRequest.Amount
            };

            var cardIssuerBank = AppGlobal.BankCardNumList
                                 .FirstOrDefault(w => w.Key == bill.PAN.Substring(0, 6)).Value;
            var PanRecipt = $"{bill.PAN.Substring(0, 6)}××××××{bill.PAN.Substring(12, 4)}";

            var result = HttpHelper.Post(serverAddress + "/api/TransactionService/BillRequest", bill,
                                         new CancellationToken());

            var    report     = new StiReport();
            string ReportName = string.Empty;

            if (result != null && result.Status != "TransactionFaild")
            {
                ReportName = "RecipetBill.mrt";
                var reportPath = $"{AppDomain.CurrentDomain.BaseDirectory}Recipts\\{ReportName}";
                report.Load(reportPath);

                report.Dictionary.Variables.Add("Transaction", "پرداخت قبض");
                report.Dictionary.Variables.Add("customerName", customerName);
                report.Dictionary.Variables.Add("customerTell", customerTell);
                report.Dictionary.Variables.Add("terminalID", bill.TerminalID);
                report.Dictionary.Variables.Add("PAN", PanRecipt);
                report.Dictionary.Variables.Add("cardIssuerBank", cardIssuerBank);
                report.Dictionary.Variables.Add("PSPRefNo", result.RefNo ?? string.Empty);
                report.Dictionary.Variables.Add("systemRefNo", result.ClientRefNo ?? string.Empty);
                report.Dictionary.Variables.Add("transactionStatus", result.Message);
                report.Dictionary.Variables.Add("paymentId", bill.PaymentId);
                report.Dictionary.Variables.Add("billId", bill.BillId);
                report.Dictionary.Variables.Add("amount", bill.Amount);
            }
            else
            {
                ReportName = "ReciptFailed.mrt";
                var reportPath = $"{AppDomain.CurrentDomain.BaseDirectory}Recipts\\{ReportName}";
                report.Load(reportPath);

                report.Dictionary.Variables.Add("Transaction", "پرداخت قبض");
                report.Dictionary.Variables.Add("customerName", customerName);
                report.Dictionary.Variables.Add("customerTell", customerTell);
                report.Dictionary.Variables.Add("terminalID", bill.TerminalID);
                report.Dictionary.Variables.Add("PAN", PanRecipt);
                report.Dictionary.Variables.Add("cardIssuerBank", cardIssuerBank);
                report.Dictionary.Variables.Add("transactionStatus", result != null ? result.Message : "تراکنش ناموفق");
            }

            try
            {
                report.Print(false);
            }
            catch (Exception ex)
            {
                if (result != null)
                {
                    result.Message += $"{Environment.NewLine}در حال حاضر امکان چاپ رسید وجود ندارد.";
                }
            }
        }
Пример #15
0
 public override UserControl FactoryMethod(TransactionInfo transactionInfo)
 {
     return(new FinalPage(transactionInfo));
 }
 public SelectOperation(TransactionInfo transactionInfo)
 {
     InitializeComponent();
     TransactionInfo = transactionInfo;
 }
Пример #17
0
 public override UserControl FactoryMethod(TransactionInfo transactionInfo)
 {
     return(new InputPaymentId(transactionInfo));
 }
 private void PaymentButton_Click(object sender, RoutedEventArgs e)
 {
     TransactionInfo.GoToPage(Pages.SelectPaymentOperationPage);
 }
Пример #19
0
 public override UserControl FactoryMethod(TransactionInfo transactionInfo)
 {
     return(new InputBillRequestId(transactionInfo));
 }
 private void BillRequestButton_Click(object sender, RoutedEventArgs e)
 {
     TransactionInfo.BillRequest = new BillRequest();
     TransactionInfo.GoToPage(Pages.InputPaymentIdPage);
 }
Пример #21
0
 public PinPad(TransactionInfo transactionInfo)
 {
     InitializeComponent();
     TransactionInfo = transactionInfo;
 }