Package com.stripe.net
Class RequestOptions.RequestOptionsBuilder
java.lang.Object
com.stripe.net.RequestOptions.RequestOptionsBuilder
- Enclosing class:
RequestOptions
-
Constructor Summary
ConstructorDescriptionConstructs a request options builder with the global parameters (API key and client ID) as default values. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs aRequestOptions
with the specified values.int
int
int
setClientId
(String clientId) setConnectionProxy
(Proxy connectionProxy) setConnectTimeout
(int timeout) Sets the timeout value that will be used for making new connections to the Stripe API (in milliseconds).setIdempotencyKey
(String idempotencyKey) setMaxNetworkRetries
(int maxNetworkRetries) Sets the maximum number of times the request will be retried in the event of a failure.setProxyCredential
(PasswordAuthentication proxyCredential) setReadTimeout
(int 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) setStripeVersionOverride
(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.
-
Constructor Details
-
RequestOptionsBuilder
public RequestOptionsBuilder()Constructs a request options builder with the global parameters (API key and client ID) as default values.
-
-
Method Details
-
getApiKey
-
setApiKey
-
clearApiKey
-
getClientId
-
setClientId
-
clearClientId
-
setIdempotencyKey
-
getConnectTimeout
public int 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
public int 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
public int 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
-
getStripeVersionOverride
-
setStripeVersionOverride
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 inEphemeralKey.create(Map, RequestOptions)
. Setting this value in a typical scenario will result in deserialization error as the model classes have schema according to the pinnedStripe.API_VERSION
and not thestripeVersionOverride
- Parameters:
stripeVersionOverride
- stripe version override which belongs to the client to make request on behalf of.- Returns:
- option builder
-
clearStripeVersionOverride
-
build
Constructs aRequestOptions
with the specified values.
-