Exemplo n.º 1
0
    private GatewayCurrency GetValidCurrencies()
    {
        GatewayCurrency gateways = new GatewayCurrency(Server.MapPath("~/Gateway/GatewayCurrencyList.xml"));

        IList <PaymentOption> paymentMethodList = GetPaymentMethodList();

        for (int index = 0; index < paymentMethodList.Count; index++)
        {
            if (paymentMethodList[index].Name == CurrentPaymentName)
            {
                if (IsPaymentEnabled)
                {
                    string[] currencies = paymentMethodList[index].Currencies;

                    if (currencies.Length > 0)
                    {
                        gateways.AddGateway(paymentMethodList[index].Name, currencies);
                    }
                }
            }
            else
            {
                string[] currencies = paymentMethodList[index].Currencies;

                if (currencies.Length > 0)
                {
                    gateways.AddGateway(paymentMethodList[index].Name, currencies);
                }
            }
        }

        return(gateways);
    }
Exemplo n.º 2
0
    public void RefreshDropDownList()
    {
        GatewayCurrency gateways = GetValidCurrencies();

        IList <Vevo.Domain.Currency> currencyList = DataAccessContext.CurrencyRepository.GetByEnabled(BoolFilter.ShowTrue);

        Vevo.Domain.Payments.PaymentCurrency[] currencies = gateways.GetValidCurrencies();
        if (currencies.Length > 0)
        {
            uxCurrencyDrop.Items.Clear();
            foreach (Vevo.Domain.Payments.PaymentCurrency item in currencies)
            {
                ListItem customListItem = new ListItem(item.DisplayName, item.CurrencyCode);
                string   attributes     = String.Empty;
                if (item.CurrencyCode == DataAccessContext.Configurations.GetValue("BaseWebsiteCurrency"))
                {
                    attributes += "font-weight:bold;";
                }

                if (!CurrencyInList(currencyList, item.CurrencyCode))
                {
                    attributes += "color:#E6E6E6;";
                }

                customListItem.Attributes.Add("style", attributes);
                uxCurrencyDrop.Items.Add(customListItem);
            }

            if (uxCurrencyDrop.Items.FindByValue(LastSelectedCurrency) != null)
            {
                uxCurrencyDrop.SelectedValue = LastSelectedCurrency;
            }
        }
        else
        {
            SetListToNone();
        }
    }