Package com.stripe

Class StripeClient.StripeClientBuilder

java.lang.Object
com.stripe.StripeClient.StripeClientBuilder
Enclosing class:
StripeClient

public static final class StripeClient.StripeClientBuilder extends Object
  • Constructor Details

    • StripeClientBuilder

      public StripeClientBuilder()
      Constructs a request options builder with the global parameters (API key and client ID) as default values.
  • Method Details

    • getApiKey

      public String getApiKey()
    • setApiKey

      public StripeClient.StripeClientBuilder setApiKey(String apiKey)
      Set API key to use for authenticating requests.
      Parameters:
      apiKey - API key
    • getClientId

      public String getClientId()
    • setClientId

      public StripeClient.StripeClientBuilder setClientId(String clientId)
      Set the client id, used for OAuth with Stripe Connect.
      Parameters:
      clientId - client ID
    • getConnectTimeout

      public int getConnectTimeout()
    • setConnectTimeout

      public StripeClient.StripeClientBuilder setConnectTimeout(int timeout)
      Sets the timeout value that will be used for making new connections to the Stripe API (in milliseconds).
      Parameters:
      timeout - timeout value in milliseconds
    • getReadTimeout

      public int getReadTimeout()
    • setReadTimeout

      public StripeClient.StripeClientBuilder setReadTimeout(int timeout)
      Sets the timeout value that will be used when reading data from an established connection to the Stripe API (in milliseconds).

      Note that this value should be set conservatively because some API requests can take time and a short timeout increases the likelihood of causing a problem in the backend.

      Parameters:
      timeout - timeout value in milliseconds
    • getMaxNetworkRetries

      public int getMaxNetworkRetries()
    • setMaxNetworkRetries

      public StripeClient.StripeClientBuilder setMaxNetworkRetries(int maxNetworkRetries)
      Sets the maximum number of times the request will be retried in the event of a failure.
      Parameters:
      maxNetworkRetries - the number of times to retry the request
    • getConnectionProxy

      public Proxy getConnectionProxy()
    • setConnectionProxy

      public StripeClient.StripeClientBuilder setConnectionProxy(Proxy connectionProxy)
      Set proxy to tunnel all Stripe connections.
      Parameters:
      connectionProxy - proxy host and port setting
    • getProxyCredential

      public PasswordAuthentication getProxyCredential()
    • setProxyCredential

      public StripeClient.StripeClientBuilder setProxyCredential(PasswordAuthentication proxyCredential)
      Provide credential for proxy authorization if required.
      Parameters:
      proxyCredential - proxy required userName and password
    • setApiBase

      public StripeClient.StripeClientBuilder setApiBase(String address)
      Set the base URL for the Stripe API. By default this is "https://api.stripe.com".

      This only affects requests made with a BaseAddress of API. Use setFilesBase(java.lang.String) or setConnectBase(java.lang.String) to interpect requests with other bases.

    • getApiBase

      public String getApiBase()
    • setFilesBase

      public StripeClient.StripeClientBuilder setFilesBase(String address)
      Set the base URL for the Stripe Files API. By default this is "https://files.stripe.com".

      This only affects requests made with a BaseAddress of FILES.

    • getFilesBase

      public String getFilesBase()
    • setConnectBase

      public StripeClient.StripeClientBuilder setConnectBase(String address)
      Set the base URL for the Stripe Connect API. By default this is "https://connect.stripe.com".

      This only affects requests made with a BaseAddress of CONNECT.

    • getConnectBase

      public String getConnectBase()
    • build

      public StripeClient build()
      Constructs a StripeClient with the specified configuration.