Class RequestOptions.RequestOptionsBuilder

  • Enclosing class:
    RequestOptions

    public static final class RequestOptions.RequestOptionsBuilder
    extends java.lang.Object
    • Constructor Detail

      • RequestOptionsBuilder

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

      • getApiKey

        public java.lang.String getApiKey()
      • getClientId

        public java.lang.String getClientId()
      • getConnectTimeout

        public int getConnectTimeout()
      • setConnectTimeout

        public RequestOptions.RequestOptionsBuilder 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 RequestOptions.RequestOptionsBuilder 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 RequestOptions.RequestOptionsBuilder 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 java.net.Proxy getConnectionProxy()
      • getProxyCredential

        public java.net.PasswordAuthentication getProxyCredential()
      • getIdempotencyKey

        public java.lang.String getIdempotencyKey()
      • getStripeAccount

        public java.lang.String getStripeAccount()
      • getStripeVersionOverride

        public java.lang.String getStripeVersionOverride()
      • setStripeVersionOverride

        public RequestOptions.RequestOptionsBuilder setStripeVersionOverride​(java.lang.String stripeVersionOverride)
        Do not use this except for in API where JSON response is not fully deserialized into explicit Stripe classes, but only passed to other clients as raw data -- essentially making request on behalf of others with their API version. One example is in EphemeralKey.create(Map, RequestOptions). Setting this value in a typical scenario will result in deserialization error as the model classes have schema according to the pinned Stripe.API_VERSION and not the stripeVersionOverride
        Parameters:
        stripeVersionOverride - stripe version override which belongs to the client to make request on behalf of.
        Returns:
        option builder