Ejemplo n.º 1
0
        private void SavePaymentSelections(CheckoutViewModel model)
        {
            OrderPaymentManager payManager = new OrderPaymentManager(model.CurrentOrder, MTApp);
            payManager.ClearAllNonStoreCreditTransactions();

            bool found = false;

            if (model.PaymentViewModel.SelectedPayment == "creditcard")
            {
                found = true;
                payManager.CreditCardAddInfo(model.PaymentViewModel.DataCreditCard, model.CurrentOrder.TotalGrandAfterStoreCredits(MTApp.OrderServices));
            }

            if ((found == false) && (model.PaymentViewModel.SelectedPayment == "check"))
            {
                found = true;
                payManager.OfflinePaymentAddInfo(model.CurrentOrder.TotalGrandAfterStoreCredits(MTApp.OrderServices), "Customer will pay by check.");
            }

            if ((found == false) && (model.PaymentViewModel.SelectedPayment == "telephone"))
            {
                found = true;
                payManager.OfflinePaymentAddInfo(model.CurrentOrder.TotalGrandAfterStoreCredits(MTApp.OrderServices), "Customer will call with payment info.");
            }

            if ((found == false) && (model.PaymentViewModel.SelectedPayment == "purchaseorder"))
            {
                found = true;
                payManager.PurchaseOrderAddInfo(model.PaymentViewModel.DataPurchaseOrderNumber.Trim(), model.CurrentOrder.TotalGrandAfterStoreCredits(MTApp.OrderServices));
            }
            if ((found == false) && (model.PaymentViewModel.SelectedPayment == "companyaccount"))
            {
                found = true;
                payManager.CompanyAccountAddInfo(model.PaymentViewModel.DataCompanyAccountNumber.Trim(), model.CurrentOrder.TotalGrandAfterStoreCredits(MTApp.OrderServices));
            }

            if ((found == false) && (model.PaymentViewModel.SelectedPayment == "cod"))
            {
                found = true;
                payManager.OfflinePaymentAddInfo(model.CurrentOrder.TotalGrandAfterStoreCredits(MTApp.OrderServices), "Customer will pay cash on delivery.");
            }

            if ((found == false) && (model.PaymentViewModel.SelectedPayment == "paypal"))
            {
                found = true;
                // Need token and id before we can add this to the order
                // Handled on the checkout page.
                //payManager.PayPalExpressAddInfo(o.TotalGrand);
            }
        }
Ejemplo n.º 2
0
        private void SavePaymentInfo(Order o)
        {

            OrderPaymentManager payManager = new OrderPaymentManager(o, MTApp);

            payManager.ClearAllNonStoreCreditTransactions();

            bool found = false;

            if (this.rbCreditCard.Checked == true)
            {
                found = true;
                payManager.CreditCardAddInfo(this.CreditCardInput1.GetCardData(), o.TotalGrandAfterStoreCredits(MTApp.OrderServices));
            }

            if ((found == false) && (this.rbCheck.Checked == true))
            {
                found = true;
                payManager.OfflinePaymentAddInfo(o.TotalGrandAfterStoreCredits(MTApp.OrderServices), "Customer will pay by check.");
            }

            if ((found == false) && (this.rbTelephone.Checked == true))
            {
                found = true;
                payManager.OfflinePaymentAddInfo(o.TotalGrandAfterStoreCredits(MTApp.OrderServices), "Customer will call with payment info.");
            }

            if ((found == false) && (this.rbPurchaseOrder.Checked == true))
            {
                found = true;
                payManager.PurchaseOrderAddInfo(this.PurchaseOrderField.Text.Trim(), o.TotalGrandAfterStoreCredits(MTApp.OrderServices));
            }
            if ((found == false) && (this.rbCompanyAccount.Checked == true))
            {
                found = true;
                payManager.CompanyAccountAddInfo(this.accountnumber.Text.Trim(), o.TotalGrandAfterStoreCredits(MTApp.OrderServices));
            }

            if ((found == false) && (this.rbCOD.Checked == true))
            {
                found = true;
                payManager.OfflinePaymentAddInfo(o.TotalGrandAfterStoreCredits(MTApp.OrderServices), "Customer will pay cash on delivery.");
            }

            MTApp.OrderServices.Orders.Update(o);       
        }