public static BundleInfoDTO BundleToken2BundleInfoDto(this CRS_BundleInfoToken token, string trackingId) { if (token == null) { return(null); } var dto = new BundleInfoDTO { BundleId = token.BundleId , BundleName = token.BundleName , Description = token.BundleDescription , ThumbUrl = token.BannerImage.ToThumbUrl(Constants.ImageBaseUrl) , PromoVideoIdentifier = String.IsNullOrEmpty(token.OverviewVideoIdentifier) ? (long?)null : Int64.Parse(token.OverviewVideoIdentifier) , PriceToken = new PriceBaseDTO { Price = token.Price , MonthlySubscriptionPrice = token.MonthlySubscriptionPrice } , Author = new UserInfoDTO { UserId = token.AuthorId , FirstName = token.FirstName , LastName = token.LastName , FullName = token.Entity2AuthorFullName() , Email = token.Email , FacebookId = token.FacebookID } }; dto.BundlePageUrl = token.GenerateBundleFullPageUrl(dto.Author.FullName, dto.BundleName, trackingId); return(dto); }
public static ItemPurchaseDataToken BundleInfoDTO2ItemPurchaseDataToken(this BundleInfoDTO token, PriceLineDTO priceToken) { return(new ItemPurchaseDataToken { ItemId = token.BundleId , ItemName = token.BundleName , Type = BillingEnums.ePurchaseItemTypes.BUNDLE , PriceToken = priceToken , Author = new UserBaseDTO { userId = token.Author.UserId , fullName = token.Author.FullName } }); }
public static ItemPurchaseCompleteToken BundleInfoDto2ItemPurchaseCompleteToken(this BundleInfoDTO token, PriceLineDTO priceToken, BaseUserInfoDTO buyer, decimal totalPrice) { return(new ItemPurchaseCompleteToken { ItemId = token.BundleId , ItemName = token.BundleName , ItemType = BillingEnums.ePurchaseItemTypes.BUNDLE , ThumbUrl = token.ThumbUrl , FinalPrice = totalPrice , PriceToken = priceToken , BuyerInfo = buyer , Author = new BaseUserInfoDTO { UserId = token.Author.UserId , FullName = token.Author.FullName } }); }