MetaDataProvider(string integrator, ShoppingCartExtension shoppingCartExtension, IEnumerable <RequestHeader> additionalRequestHeaders) { ValidateAdditionalRequestHeaders(additionalRequestHeaders); ServerMetaInfo serverMetaInfo = new ServerMetaInfo() { PlatformIdentifier = PlatformIdentifier, SdkIdentifier = SdkIdentifier, SdkCreator = "Ingenico", Integrator = integrator, ShoppingCartExtension = shoppingCartExtension }; string serverMetaInfoString = DefaultMarshaller.Instance.Marshal(serverMetaInfo); RequestHeader serverMetaInfoHeader = new RequestHeader(SERVER_META_INFO_HEADER, serverMetaInfoString.ToBase64String()); _metaDataHeaders = new List <RequestHeader> { serverMetaInfoHeader } .Concat(additionalRequestHeaders ?? Enumerable.Empty <RequestHeader>());; }
/// <summary> /// Returns this with the shopping cart extension assigned. /// </summary> /// <param name="shoppingCartExtension">The shopping cart extension.</param> /// <returns>This.</returns> public CommunicatorConfiguration WithShoppingCartExtension(ShoppingCartExtension shoppingCartExtension) { ShoppingCartExtension = shoppingCartExtension; return(this); }
/// <summary> /// Sets the shopping cart extension to use. /// </summary> /// <returns>This.</returns> public MetaDataProviderBuilder WithShoppingCartExtension(ShoppingCartExtension shoppingCartExtension) { ShoppingCartExtension = shoppingCartExtension; return(this); }