/// <summary>
        /// Gets the supported currencies.
        /// </summary>
        /// <param name="storefront">The storefront.</param>
        /// <param name="catalogName">Name of the catalog.</param>
        /// <returns>The manager response.</returns>
        public virtual ManagerResponse <Sitecore.Commerce.Services.Prices.GetSupportedCurrenciesResult, IReadOnlyCollection <string> > GetSupportedCurrencies(CommerceStorefront storefront, string catalogName)
        {
            Assert.ArgumentNotNull(storefront, "storefront");

            var request = new Requests.GetSupportedCurrenciesRequest(storefront.ShopName, catalogName);
            var result  = _pricingServiceProvider.GetSupportedCurrencies(request);

            return(new ManagerResponse <GetSupportedCurrenciesResult, IReadOnlyCollection <string> >(result, result.Currencies));
        }
コード例 #2
0
        public ManagerResponse <GetSupportedCurrenciesResult, IReadOnlyCollection <string> > GetSupportedCurrencies(string catalogName)
        {
            if (StorefrontContext.Current == null)
            {
                throw new InvalidOperationException("Cannot be called without a valid storefront context.");
            }

            var request = new GetSupportedCurrenciesRequest(StorefrontContext.Current.ShopName, catalogName);
            var result  = PricingServiceProvider.GetSupportedCurrencies(request);

            return(new ManagerResponse <GetSupportedCurrenciesResult, IReadOnlyCollection <string> >(result, result.Currencies));
        }