Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _klarnaCheckoutService = ServiceLocator.Current.GetInstance <IKlarnaCheckoutService>();
            if (!base.IsPostBack && this._paymentMethodDto != null && this._paymentMethodDto.PaymentMethodParameter != null)
            {
                var markets = _paymentMethodDto.PaymentMethod.FirstOrDefault().GetMarketPaymentMethodsRows();

                if (markets != null)
                {
                    CheckoutConfiguration checkoutConfiguration = null;
                    try
                    {
                        checkoutConfiguration = _klarnaCheckoutService.GetConfiguration(markets.FirstOrDefault().MarketId);
                    }
                    catch
                    {
                        checkoutConfiguration = new CheckoutConfiguration();
                    }
                    BindData(checkoutConfiguration);

                    marketDropDownList.DataSource = markets.Select(m => m.MarketId);
                    marketDropDownList.DataBind();
                }
            }
        }
Exemplo n.º 2
0
        protected void marketDropDownList_OnSelectedIndexChanged(object sender, EventArgs e)
        {
            CheckoutConfiguration checkoutConfiguration = null;

            try
            {
                checkoutConfiguration = _klarnaCheckoutService.GetConfiguration(new MarketId(marketDropDownList.SelectedValue));
            }
            catch
            {
                checkoutConfiguration = new CheckoutConfiguration();
            }
            BindData(checkoutConfiguration);

            ConfigureUpdatePanelContentPanel.Update();
        }