All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ingenico.connect.gateway.sdk.java.MetaDataProviderBuilder Maven / Gradle / Ivy

package com.ingenico.connect.gateway.sdk.java;

import java.util.ArrayList;
import java.util.List;

import com.ingenico.connect.gateway.sdk.java.domain.metadata.ShoppingCartExtension;

/**
 * Builder for a {@link MetaDataProvider} object.
 */
public class MetaDataProviderBuilder {

	final String integrator;

	ShoppingCartExtension shoppingCartExtension;

	final List additionalRequestHeaders = new ArrayList();

	/**
	 * @param integrator The integrator to use.
	 */
	public MetaDataProviderBuilder(String integrator) {
		this.integrator = integrator;
	}

	/**
	 * Sets the shopping cart extension to use.
	 */
	public MetaDataProviderBuilder withShoppingCartExtension(ShoppingCartExtension shoppingCartExtension) {
		this.shoppingCartExtension = shoppingCartExtension;
		return this;
	}

	/**
	 * Adds an additional request header.
	 * The following names are prohibited in these additional request headers, because these will be set automatically
	 * as needed:
	 * 
    *
  • X-GCS-ServerMetaInfo
  • *
  • X-GCS-ClientMetaInfo
  • *
  • X-GCS-Idempotence-Key
  • *
  • Date
  • *
  • Content-Type
  • *
  • Authorization
  • *
*/ public MetaDataProviderBuilder withAdditionalRequestHeader(RequestHeader additionalRequestHeader) { MetaDataProvider.validateAdditionalRequestHeader(additionalRequestHeader); additionalRequestHeaders.add(additionalRequestHeader); return this; } /** * Creates a fully initialized {@link MetaDataProvider} object. */ public MetaDataProvider build() { return new MetaDataProvider(this); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy