/// <summary> /// Gets the gift card. /// </summary> /// <param name="giftCardId">The gift card identifier.</param> /// <param name="shopName">Name of the shop.</param> /// <returns> /// A gift card if found /// </returns> public ManagerResponse <GetGiftCardResult, GiftCard> GetGiftCard(string giftCardId, string shopName) { Assert.ArgumentNotNullOrEmpty(giftCardId, "giftCardId"); var request = new GetGiftCardRequest(giftCardId, shopName); var result = this.GiftCardServiceProvider.GetGiftCard(request); Helpers.LogSystemMessages(result.SystemMessages, result); return(new ManagerResponse <GetGiftCardResult, GiftCard>(result, result.GiftCard)); }
/// <summary> /// Gets the gift card. /// </summary> /// <param name="giftCardId">The gift card identifier.</param> /// <param name="shopName">Name of the shop.</param> /// <returns> /// A gift card if found /// </returns> public ManagerResponse<GetGiftCardResult, GiftCard> GetGiftCard(string giftCardId, string shopName) { Assert.ArgumentNotNullOrEmpty(giftCardId, "giftCardId"); var request = new GetGiftCardRequest(giftCardId, shopName); var result = this.GiftCardServiceProvider.GetGiftCard(request); Helpers.LogSystemMessages(result.SystemMessages, result); return new ManagerResponse<GetGiftCardResult, GiftCard>(result, result.GiftCard); }
private ManagerResponse <GetGiftCardResult, GiftCard> GetGiftCard(string giftCardId) { Assert.ArgumentNotNullOrEmpty(giftCardId, nameof(giftCardId)); if (this.StorefrontContext.Current == null) { throw new InvalidOperationException("Cannot be called without a valid storefront context."); } var request = new GetGiftCardRequest(giftCardId, StorefrontContext.Current.ShopName); var result = GiftCardServiceProvider.GetGiftCard(request); result.WriteToSitecoreLog(); return(new ManagerResponse <GetGiftCardResult, GiftCard>(result, result.GiftCard)); }