Exemple #1
0
    private void ToggleCreditCardForm(bool show)
    {
        if (show)
        {
            HidePaymentForms();

            RadioCreditCard.Checked = true;

            if (!SecureNetPaymentView.IsVaultPaymentSelected)
            {
                CreditCardPaymentViewForm.Initialize();
                CreditCardPaymentViewForm.Show();
                CreditCardPaymentViewForm.BindView();
            }

            SecureNetPaymentView.Initialize();
            SecureNetPaymentView.Show();
            SecureNetPaymentView.BindView();
        }
        else
        {
            RadioCreditCard.Checked = false;
            CreditCardPaymentViewForm.Hide();
            SecureNetPaymentView.Hide();
        }
    }
    protected void BindPaymentView()
    {
        if (this.PaymentMethodView == null)
        {
            return;
        }

        bool showPaymentView = true;

        if (this.Model.ActivePaymentMethod != null && this.Model.ActivePaymentMethod.PaymentType == PaymentType.CreditCard)
        {
            if (AspDotNetStorefrontCore.AppLogic.ActivePaymentGatewayCleaned() ==
                AspDotNetStorefrontGateways.Gateway.ro_GWTWOCHECKOUT)
            {
                showPaymentView = false;

                TwoCheckoutPaymentView.Initialize();
                TwoCheckoutPaymentView.Show();
                TwoCheckoutPaymentView.BindView();
            }
            else if (AspDotNetStorefrontCore.AppLogic.ActivePaymentGatewayCleaned() ==
                     (new AspDotNetStorefrontGateways.Processors.Worldpay()).GatewayIdentifier)
            {
                showPaymentView = false;

                WorldPayPaymentView.Initialize();
                WorldPayPaymentView.Show();
                WorldPayPaymentView.BindView();
            }
            else
            {
                if (SecureNetPaymentView.IsVaultPaymentSelected)
                {
                    showPaymentView = false;
                }

                SecureNetPaymentView.Initialize();
                SecureNetPaymentView.Show();
                SecureNetPaymentView.BindView();
            }
        }

        if (showPaymentView)
        {
            this.PaymentMethodView.Initialize();
            this.PaymentMethodView.Show();
            this.PaymentMethodView.BindView();
        }
    }