示例#1
0
        public PaymentPage()
        {
            InitializeComponent();

            //this.BackgroundColor = Color.FromRgb(0, 200, 255);
            this.BackgroundColor = Color.White;

            paymentLabel.FontFamily = Device.RuntimePlatform == Device.iOS ? "Cabin-Bold" : "Cabin-Bold.ttf#Cabin-Bold";

            if (Device.RuntimePlatform == Device.Android)
            {
                NavigationPage.SetHasBackButton(this, false);
            }

            ExceptionModel.ExceptionModelInstance = new ExceptionModel();

            pricingManager = new PricingManager();

            manager = new BookingsManager();

            emailService = new EmailService();

            var viewModel = new PaymentPageViewModel(new StripeRepository(), new APIRepository());

            this.BindingContext = viewModel;
        }
示例#2
0
        public PaymentPage(int PromotionPrice, string ReferenceCode)
        {
            InitializeComponent();

            this.ViewModel = new PaymentPageViewModel(PromotionPrice, ReferenceCode)
            {
                Title = this.Title
            };
            this.BindingContext = this.ViewModel;
        }
        // GET: CheckOut
        public ActionResult Index()
        {
            string currentUserId = User.Identity.GetUserId();
            IEnumerable <UserCartListShowViewModel> carts = aCartManager.GetUserCartList(currentUserId);
            ApplicationUser      user           = HttpContext.GetOwinContext().GetUserManager <ApplicationUserManager>().FindById(User.Identity.GetUserId());
            User                 aUser          = aCustomUserManager.GetUser(user.UserName);
            PaymentPageViewModel aPageViewModel = new PaymentPageViewModel();

            aPageViewModel.Address = aUser.Address;
            aPageViewModel.Bkash   = aUser.Number;
            return(View(aPageViewModel));
        }
        public ActionResult Index(PaymentPageViewModel aPageViewModel)
        {
            string curentUser = User.Identity.GetUserId();
            int    paymentId  = aPaymentManager.Save(aPageViewModel, curentUser);

            aCartToDeliverManager.TransferCart(curentUser, paymentId);

            IEnumerable <CartToDeliver> cartToDelivers = aCartToDeliverManager.GetCartList(curentUser, paymentId);

            aOrderManager.Save(cartToDelivers, paymentId, curentUser, aPageViewModel.Address);

            return(View());
        }
        public ScanToPayOne(string merchantName, string merchantAccountNumber)
        {
            InitializeComponent();
            PaymentPageViewModel payment = new PaymentPageViewModel()
            {
                MerchantName          = merchantName,
                MerchantAccountNumber = merchantAccountNumber
            };

            BindingContext = payment;
            //(BindingContext as PaymentPageViewModel).MerchantName = merchantName;
            //(BindingContext as PaymentPageViewModel).MerchantAccountNumber = merchantAccountNumber;
        }
示例#6
0
        public PaymentPage()
        {
            InitializeComponent();

            //this.BackgroundColor = Color.FromRgb(0, 200, 255);
            this.BackgroundColor = Color.White;

            ExceptionModel.ExceptionModelInstance = new ExceptionModel();

            pricingManager = new PricingManager();

            manager = new BookingsManager();

            emailService = new EmailService();

            var viewModel = new PaymentPageViewModel(new StripeRepository(), new APIRepository());

            this.BindingContext = viewModel;
        }
        public ScanToPayOne(string merchantName, string merchantAccountNumber, decimal amount, string TransactionReference)
        {
            InitializeComponent();
            bool isNotFixedAmount = true;

            if (amount > 0)
            {
                isNotFixedAmount = false;
            }
            PaymentPageViewModel payment = new PaymentPageViewModel()
            {
                MerchantName          = merchantName,
                MerchantAccountNumber = merchantAccountNumber,
                Amount               = amount,
                IsNotFixedAmount     = isNotFixedAmount,
                TransactionReference = TransactionReference
            };

            BindingContext = payment;
            //(BindingContext as PaymentPageViewModel).MerchantName = merchantName;
            //(BindingContext as PaymentPageViewModel).MerchantAccountNumber = merchantAccountNumber;
        }
示例#8
0
        public int Save(PaymentPageViewModel aPageViewModel, string UserId)
        {
            Payment aPayment = new Payment();

            aPayment.UserId           = UserId;
            aPayment.BkashNumber      = aPageViewModel.Bkash;
            aPayment.CreditCardNumber = aPageViewModel.CreditCardNumber;
            aPayment.IsActive         = true;
            aPayment.TrxNo            = aPageViewModel.TrxNo;
            aPayment.Date             = DateTime.Today;
            aPayment.CashOnDelivery   = aPageViewModel.CashOnDelivery;
            aUnitOfWork.Repository <Payment>().InsertModel(aPayment);
            aUnitOfWork.Save();

            IEnumerable <Payment> payments = aUnitOfWork.Repository <Payment>().GetList();
            int paymentId = 0;

            foreach (Payment pay in payments.Reverse())
            {
                paymentId = pay.Id; break;
                ;
            }
            return(paymentId);
        }
示例#9
0
 public ScanToPayTwo(PaymentPageViewModel vm)
 {
     InitializeComponent();
     BindingContext = vm;
 }
示例#10
0
 public PaymentPage()
 {
     InitializeComponent();
     BindingContext = new PaymentPageViewModel();
 }
        public PaymentPage(RequestSpecs requestSpecs)

        {
            InitializeComponent();
            BindingContext = viewModel = new PaymentPageViewModel(requestSpecs);
            RequestSpecs   = requestSpecs;

            string txtAmount = (requestSpecs.ProductValue + requestSpecs.Commission).ToString() + App.strCurrency;

            AmountPay.Text = Translator.getText("NoChargeYet");

            ObservableCollection <Countries> lstcountry = DatabaseHelper.getCountries(App.Os_Folder);


            //CardNumber.BorderColor = Color.Green;



            foreach (Countries country in lstcountry)
            {
                Country.Items.Add(country.CountryCode + "-" + country.CountryName);
            }
            Country.SelectedIndex = 0;
            c = new List <Card>();

            loadCards(RequestSpecs.Email);


            loadPickers();

            viewModel.DisplayTravelObjectCreated += async() =>
            {
                await DisplayAlert(Translator.getText("Success"), Translator.getText("UpdateDone"), "Ok");


                Application.Current.MainPage = new MainPage {
                    Detail = new NavigationPage(new RequestList())
                };
            };

            MessagingCenter.Subscribe <PaymentPageViewModel, string>(this, "CardMessages", (obj, item) => {
                DisplayAlert(Translator.getText("Notice"), item, "Ok");
            });

            viewModel.DisplayTravelObjectNotCreated += async() =>
            {
                await DisplayAlert(Translator.getText("Error"), Translator.getText("ProcessNotCompleted"), "Ok");
            };
            lb_backFunc();
            void lb_backFunc()
            {
                try
                {
                    Back.GestureRecognizers.Add(new TapGestureRecognizer()
                    {
                        Command = new Command(() =>
                        {
                            Navigation.PopModalAsync();
                        })
                    });
                }
                catch (Exception ex) { Debug.WriteLine(ex); }
            }
        }