protected void lnkCreditCardAddInfo_Click(object sender, EventArgs e)
        {
            this.MessageBox1.ClearMessage();
            CardData card = this.CreditCardInput1.GetCardData();

            ShowTransaction(payManager.CreditCardAddInfo(card, 0));
            LoadCreditCardLists();
        }
Пример #2
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);
            }
        }
        private void SavePaymentInfo()
        {
            var payManager = new OrderPaymentManager(CurrentOrder, HccApp);

            payManager.ClearAllNonStoreCreditTransactions();

            // Don't add payment info if gift cards or points cover the entire order.
            var total = CurrentOrder.TotalGrandAfterStoreCredits(HccApp.OrderServices);

            if (total <= 0 && !CurrentOrder.IsRecurring)
            {
                return;
            }

            if (rbCreditCard.Checked)
            {
                var creditCardData = ucCreditCardInput.GetCardData();
                if (!CurrentOrder.IsRecurring)
                {
                    payManager.CreditCardAddInfo(creditCardData, total);
                }
                else
                {
                    payManager.RecurringSubscriptionAddCardInfo(creditCardData);
                }
            }
            else if (rbPurchaseOrder.Checked)
            {
                payManager.PurchaseOrderAddInfo(txtPurchaseOrder.Text.Trim(), total);
            }
            else if (rbCompanyAccount.Checked)
            {
                payManager.CompanyAccountAddInfo(txtAccountNumber.Text.Trim(), total);
            }
            else if (rbCheck.Checked)
            {
                payManager.OfflinePaymentAddInfo(total, Localization.GetFormattedString("CustomerPayByCheck"));
            }
            else if (rbTelephone.Checked)
            {
                payManager.OfflinePaymentAddInfo(total, Localization.GetString("CustomerPayByPhone"));
            }
            else if (rbCashOnDelivery.Checked)
            {
                payManager.OfflinePaymentAddInfo(total, Localization.GetString("CustomerPayCod"));
            }
        }
Пример #4
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);
        }