コード例 #1
0
        private void SetPayPalVisibility(CartViewModel model)
        {
            AvailablePayments availablePayments = new AvailablePayments();
            Collection<DisplayPaymentMethod> enabledMethods;
            enabledMethods = availablePayments.EnabledMethods(MTApp.CurrentStore);

            model.PayPalExpressAvailable = false;
            foreach (DisplayPaymentMethod m in enabledMethods)
            {
                switch (m.MethodId)
                {
                    case WebAppSettings.PaymentIdPaypalExpress:
                        model.PayPalExpressAvailable = true;
                        break;
                    default:
                        // do nothing
                        break;
                }
            }
        }
コード例 #2
0
        void DisplayPaymentMethods(CheckoutViewModel model)
        {
            MerchantTribe.Commerce.Payment.AvailablePayments availablePayments = new MerchantTribe.Commerce.Payment.AvailablePayments();
            Collection <DisplayPaymentMethod> enabledMethods;

            enabledMethods = availablePayments.EnabledMethods(MTApp.CurrentStore);

            model.PaymentViewModel.CheckDescription          = WebAppSettings.PaymentCheckDescription;
            model.PaymentViewModel.CodDescription            = WebAppSettings.PaymentCODDescription;
            model.PaymentViewModel.CompanyAccountDescription = WebAppSettings.PaymentCompanyAccountName;
            model.PaymentViewModel.PurchaseOrderDescription  = WebAppSettings.PaymentPurchaseOrderName;
            model.PaymentViewModel.TelephoneDescription      = WebAppSettings.PaymentTelephoneDescription;

            if ((model.CurrentOrder.TotalOrderAfterDiscounts > 0) || (!MTApp.CurrentStore.Settings.AllowZeroDollarOrders))
            {
                model.PaymentViewModel.NoPaymentNeeded = false;
                foreach (DisplayPaymentMethod m in enabledMethods)
                {
                    switch (m.MethodId)
                    {
                    case WebAppSettings.PaymentIdCheck:
                        model.PaymentViewModel.IsCheckActive = true;
                        break;

                    case WebAppSettings.PaymentIdCreditCard:
                        model.PaymentViewModel.IsCreditCardActive = true;
                        break;

                    case WebAppSettings.PaymentIdTelephone:
                        model.PaymentViewModel.IsTelephoneActive = true;
                        break;

                    case WebAppSettings.PaymentIdPurchaseOrder:
                        model.PaymentViewModel.IsPurchaseOrderActive = true;
                        break;

                    case WebAppSettings.PaymentIdCompanyAccount:
                        model.PaymentViewModel.IsCompanyAccountActive = true;
                        break;

                    case WebAppSettings.PaymentIdCashOnDelivery:
                        model.PaymentViewModel.IsCodActive = true;
                        break;

                    case WebAppSettings.PaymentIdPaypalExpress:
                        model.PaymentViewModel.IsPayPalActive = true;
                        break;

                    default:
                        // do nothing
                        break;
                    }
                }

                if (enabledMethods.Count == 1)
                {
                    switch (enabledMethods[0].MethodId)
                    {
                    case WebAppSettings.PaymentIdCheck:
                        model.PaymentViewModel.SelectedPayment = "check";
                        break;

                    case WebAppSettings.PaymentIdCreditCard:
                        model.PaymentViewModel.SelectedPayment = "creditcard";
                        break;

                    case WebAppSettings.PaymentIdTelephone:
                        model.PaymentViewModel.SelectedPayment = "telephone";
                        break;

                    case WebAppSettings.PaymentIdPurchaseOrder:
                        model.PaymentViewModel.SelectedPayment = "purchaseorder";
                        break;

                    case WebAppSettings.PaymentIdCompanyAccount:
                        model.PaymentViewModel.SelectedPayment = "companyaccount";
                        break;

                    case WebAppSettings.PaymentIdCashOnDelivery:
                        model.PaymentViewModel.SelectedPayment = "cod";
                        break;

                    case WebAppSettings.PaymentIdPaypalExpress:
                        model.PaymentViewModel.SelectedPayment = "paypal";
                        break;
                    }
                }
                else
                {
                    if (model.PaymentViewModel.IsCreditCardActive)
                    {
                        model.PaymentViewModel.SelectedPayment = "creditcard";
                    }
                }
            }
            else
            {
                model.PaymentViewModel.NoPaymentNeeded            = true;
                model.PaymentViewModel.NoPaymentNeededDescription = WebAppSettings.PaymentNoPaymentNeededDescription;
            }
        }
コード例 #3
0
        void DisplayPaymentMethods(CheckoutViewModel model)
        {
            MerchantTribe.Commerce.Payment.AvailablePayments availablePayments = new MerchantTribe.Commerce.Payment.AvailablePayments();
            Collection<DisplayPaymentMethod> enabledMethods;
            enabledMethods = availablePayments.EnabledMethods(MTApp.CurrentStore);

            model.PaymentViewModel.CheckDescription = WebAppSettings.PaymentCheckDescription;
            model.PaymentViewModel.CodDescription = WebAppSettings.PaymentCODDescription;
            model.PaymentViewModel.CompanyAccountDescription = WebAppSettings.PaymentCompanyAccountName;
            model.PaymentViewModel.PurchaseOrderDescription = WebAppSettings.PaymentPurchaseOrderName;
            model.PaymentViewModel.TelephoneDescription = WebAppSettings.PaymentTelephoneDescription;

            if ((model.CurrentOrder.TotalOrderAfterDiscounts > 0) || (!MTApp.CurrentStore.Settings.AllowZeroDollarOrders))
            {
                model.PaymentViewModel.NoPaymentNeeded = false;
                foreach (DisplayPaymentMethod m in enabledMethods)
                {
                    switch (m.MethodId)
                    {
                        case WebAppSettings.PaymentIdCheck:
                            model.PaymentViewModel.IsCheckActive = true;
                            break;
                        case WebAppSettings.PaymentIdCreditCard:
                            model.PaymentViewModel.IsCreditCardActive = true;
                            break;
                        case WebAppSettings.PaymentIdTelephone:
                            model.PaymentViewModel.IsTelephoneActive = true;
                            break;
                        case WebAppSettings.PaymentIdPurchaseOrder:
                            model.PaymentViewModel.IsPurchaseOrderActive = true;
                            break;
                        case WebAppSettings.PaymentIdCompanyAccount:
                            model.PaymentViewModel.IsCompanyAccountActive = true;
                            break;
                        case WebAppSettings.PaymentIdCashOnDelivery:
                            model.PaymentViewModel.IsCodActive = true;
                            break;
                        case WebAppSettings.PaymentIdPaypalExpress:
                            model.PaymentViewModel.IsPayPalActive = true;
                            break;
                        default:
                            // do nothing
                            break;
                    }
                }

                if (enabledMethods.Count == 1)
                {
                    switch (enabledMethods[0].MethodId)
                    {
                        case WebAppSettings.PaymentIdCheck:
                            model.PaymentViewModel.SelectedPayment = "check";
                            break;
                        case WebAppSettings.PaymentIdCreditCard:
                            model.PaymentViewModel.SelectedPayment = "creditcard";
                            break;
                        case WebAppSettings.PaymentIdTelephone:
                            model.PaymentViewModel.SelectedPayment = "telephone";
                            break;
                        case WebAppSettings.PaymentIdPurchaseOrder:
                            model.PaymentViewModel.SelectedPayment = "purchaseorder";
                            break;
                        case WebAppSettings.PaymentIdCompanyAccount:
                            model.PaymentViewModel.SelectedPayment = "companyaccount";
                            break;
                        case WebAppSettings.PaymentIdCashOnDelivery:
                            model.PaymentViewModel.SelectedPayment = "cod";
                            break;
                        case WebAppSettings.PaymentIdPaypalExpress:
                            model.PaymentViewModel.SelectedPayment = "paypal";
                            break;
                    }
                }
                else
                {
                    if (model.PaymentViewModel.IsCreditCardActive)
                    {
                        model.PaymentViewModel.SelectedPayment = "creditcard";
                    }
                }
            }
            else
            {
                model.PaymentViewModel.NoPaymentNeeded = true;
                model.PaymentViewModel.NoPaymentNeededDescription = WebAppSettings.PaymentNoPaymentNeededDescription;
            }
        }
コード例 #4
0
 private void LoadMethods()
 {
     MerchantTribe.Commerce.Payment.AvailablePayments availablePayments = new MerchantTribe.Commerce.Payment.AvailablePayments();
     this.PaymentMethodsGrid.DataSource = availablePayments.AvailableMethodsForPlan(MTApp.CurrentStore.PlanId);
     this.PaymentMethodsGrid.DataBind();
 }
コード例 #5
0
 private void LoadMethods()
 {
     MerchantTribe.Commerce.Payment.AvailablePayments availablePayments = new MerchantTribe.Commerce.Payment.AvailablePayments();
     this.PaymentMethodsGrid.DataSource = availablePayments.AvailableMethodsForPlan(MTApp.CurrentStore.PlanId);
     this.PaymentMethodsGrid.DataBind();
 }
コード例 #6
0
        private void LoadPaymentMethods()
        {
            MerchantTribe.Commerce.Payment.AvailablePayments availablePayments = new MerchantTribe.Commerce.Payment.AvailablePayments();
            Collection<DisplayPaymentMethod> enabledMethods;
            enabledMethods = availablePayments.EnabledMethods(MTApp.CurrentStore);

            this.rowNoPaymentNeeded.Visible = false;
            foreach (DisplayPaymentMethod m in enabledMethods)
            {
                switch (m.MethodId)
                {
                    case WebAppSettings.PaymentIdCheck:
                        this.lblCheckDescription.Text = WebAppSettings.PaymentCheckDescription;
                        this.rowCheck.Visible = true;
                        break;
                    case WebAppSettings.PaymentIdCreditCard:
                        this.rowCreditCard.Visible = true;
                        break;
                    case WebAppSettings.PaymentIdTelephone:
                        this.lblTelephoneDescription.Text = WebAppSettings.PaymentTelephoneDescription;
                        this.rowTelephone.Visible = true;
                        break;
                    case WebAppSettings.PaymentIdPurchaseOrder:
                        this.lblPurchaseOrderDescription.Text = WebAppSettings.PaymentPurchaseOrderName;
                        this.trPurchaseOrder.Visible = true;
                        break;
                    case WebAppSettings.PaymentIdCashOnDelivery:
                        this.lblCOD.Text = WebAppSettings.PaymentCODDescription;
                        this.trCOD.Visible = true;
                        break;
                    case WebAppSettings.PaymentIdCompanyAccount:
                        this.lblCompanyAccountDescription.Text = WebAppSettings.PaymentCompanyAccountName;
                        this.trCompanyAccount.Visible = true;
                        break;
                    default:
                        // do nothign
                        break;
                }

            }

            if (enabledMethods.Count == 1)
            {
                switch (enabledMethods[0].MethodId)
                {
                    case WebAppSettings.PaymentIdCheck:
                        rbCheck.Checked = true;
                        break;
                    case WebAppSettings.PaymentIdCreditCard:
                        rbCreditCard.Checked = true;
                        break;
                    case WebAppSettings.PaymentIdTelephone:
                        rbTelephone.Checked = true;
                        break;
                    case WebAppSettings.PaymentIdPurchaseOrder:
                        rbPurchaseOrder.Checked = true;
                        break;
                    case WebAppSettings.PaymentIdCompanyAccount:
                        rbCompanyAccount.Checked = true;
                        break;
                    case WebAppSettings.PaymentIdCashOnDelivery:
                        rbCOD.Checked = true;
                        break;
                }
            }
            else
            {
                if (rbCreditCard.Visible)
                {
                    rbCreditCard.Checked = true;
                }
            }

        }
コード例 #7
0
        private void LoadPaymentMethods()
        {
            MerchantTribe.Commerce.Payment.AvailablePayments availablePayments = new MerchantTribe.Commerce.Payment.AvailablePayments();
            Collection <DisplayPaymentMethod> enabledMethods;

            enabledMethods = availablePayments.EnabledMethods(MTApp.CurrentStore);

            this.rowNoPaymentNeeded.Visible = false;
            foreach (DisplayPaymentMethod m in enabledMethods)
            {
                switch (m.MethodId)
                {
                case WebAppSettings.PaymentIdCheck:
                    this.lblCheckDescription.Text = WebAppSettings.PaymentCheckDescription;
                    this.rowCheck.Visible         = true;
                    break;

                case WebAppSettings.PaymentIdCreditCard:
                    this.rowCreditCard.Visible = true;
                    break;

                case WebAppSettings.PaymentIdTelephone:
                    this.lblTelephoneDescription.Text = WebAppSettings.PaymentTelephoneDescription;
                    this.rowTelephone.Visible         = true;
                    break;

                case WebAppSettings.PaymentIdPurchaseOrder:
                    this.lblPurchaseOrderDescription.Text = WebAppSettings.PaymentPurchaseOrderName;
                    this.trPurchaseOrder.Visible          = true;
                    break;

                case WebAppSettings.PaymentIdCashOnDelivery:
                    this.lblCOD.Text   = WebAppSettings.PaymentCODDescription;
                    this.trCOD.Visible = true;
                    break;

                case WebAppSettings.PaymentIdCompanyAccount:
                    this.lblCompanyAccountDescription.Text = WebAppSettings.PaymentCompanyAccountName;
                    this.trCompanyAccount.Visible          = true;
                    break;

                default:
                    // do nothign
                    break;
                }
            }

            if (enabledMethods.Count == 1)
            {
                switch (enabledMethods[0].MethodId)
                {
                case WebAppSettings.PaymentIdCheck:
                    rbCheck.Checked = true;
                    break;

                case WebAppSettings.PaymentIdCreditCard:
                    rbCreditCard.Checked = true;
                    break;

                case WebAppSettings.PaymentIdTelephone:
                    rbTelephone.Checked = true;
                    break;

                case WebAppSettings.PaymentIdPurchaseOrder:
                    rbPurchaseOrder.Checked = true;
                    break;

                case WebAppSettings.PaymentIdCompanyAccount:
                    rbCompanyAccount.Checked = true;
                    break;

                case WebAppSettings.PaymentIdCashOnDelivery:
                    rbCOD.Checked = true;
                    break;
                }
            }
            else
            {
                if (rbCreditCard.Visible)
                {
                    rbCreditCard.Checked = true;
                }
            }
        }