Package com.stripe.net
Class RequestOptions.RequestOptionsBuilder
java.lang.Object
com.stripe.net.RequestOptions.RequestOptionsBuilder
- Direct Known Subclasses:
RawRequestOptions.RawRequestOptionsBuilder
- Enclosing class:
- RequestOptions
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a request options builder with the global parameters (API key and client ID) as default values. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs aRequestOptionswith the specified values.Empties the current builder value for StripeContext, which will defer to the client options.Sets the API key for bearer token authentication.setAuthenticator(Authenticator authenticator) Sets the authenticator used to authorize requests.setBaseUrl(String baseUrl) setClientId(String clientId) setConnectionProxy(Proxy connectionProxy) setConnectTimeout(Integer timeout) Sets the timeout value that will be used for making new connections to the Stripe API (in milliseconds).setIdempotencyKey(String idempotencyKey) setMaxNetworkRetries(Integer maxNetworkRetries) Sets the maximum number of times the request will be retried in the event of a failure.setProxyCredential(PasswordAuthentication proxyCredential) setReadTimeout(Integer timeout) Sets the timeout value that will be used when reading data from an established connection to the Stripe API (in milliseconds).setStripeAccount(String stripeAccount) setStripeContext(StripeContext context) setStripeContext(String context) setStripeRequestTrigger(String stripeRequestTrigger) unsafeSetStripeVersionOverride(RequestOptions.RequestOptionsBuilder builder, String stripeVersionOverride) This is for internal use only.
-
Field Details
-
authenticator
-
clientId
-
idempotencyKey
-
stripeContext
-
stripeRequestTrigger
-
stripeAccount
-
stripeVersionOverride
-
connectTimeout
-
readTimeout
-
maxNetworkRetries
-
connectionProxy
-
proxyCredential
-
baseUrl
-
-
Constructor Details
-
RequestOptionsBuilder
public RequestOptionsBuilder()Constructs a request options builder with the global parameters (API key and client ID) as default values.
-
-
Method Details
-
getAuthenticator
-
setAuthenticator
Sets the authenticator used to authorize requests. Use this for custom authentication strategies. For standard API key authentication, prefersetApiKey(String).This shares a backing field with
setApiKey(String)— calling one overwrites the other.- Parameters:
authenticator- the authenticator to use
-
setApiKey
Sets the API key for bearer token authentication. This is a convenience method equivalent to callingsetAuthenticator(new BearerTokenAuthenticator(apiKey)).This shares a backing field with
setAuthenticator(Authenticator)— calling one overwrites the other.- Parameters:
apiKey- the API key; if null, clears the authenticator
-
clearApiKey
-
getClientId
-
setClientId
-
clearClientId
-
getStripeContext
-
setStripeContext
-
setStripeContext
-
clearStripeContext
Empties the current builder value for StripeContext, which will defer to the client options.To send no context at all, call `setContext(new StripeContext())`or set the context to an empty string.
-
getStripeRequestTrigger
-
setStripeRequestTrigger
-
setIdempotencyKey
-
getConnectTimeout
-
setConnectTimeout
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
-
setReadTimeout
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
-
setMaxNetworkRetries
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
-
setConnectionProxy
-
getProxyCredential
-
setProxyCredential
public RequestOptions.RequestOptionsBuilder setProxyCredential(PasswordAuthentication proxyCredential) -
clearIdempotencyKey
-
getIdempotencyKey
-
getStripeAccount
-
setStripeAccount
-
clearStripeAccount
-
unsafeSetStripeVersionOverride
public static RequestOptions.RequestOptionsBuilder unsafeSetStripeVersionOverride(RequestOptions.RequestOptionsBuilder builder, String stripeVersionOverride) This is for internal use only. SeeEphemeralKey.create(Map, RequestOptions). Setting this yourself will result in a version mismatch between your request and this library's types, which can result in missing data and deserialization errors.Static, so that it doesn't appear in IDE auto-completion alongside the other setters.
- Returns:
- option builder
-
setBaseUrl
-
build
Constructs aRequestOptionswith the specified values.
-