Package com.stripe
Class Stripe
java.lang.Object
com.stripe.Stripe
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic Stringstatic Stringstatic final Stringstatic final intstatic final intstatic booleanstatic final Stringstatic final Stringstatic final StringStripe API version which is sent by default on requests.static final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBetaVersion(String betaName, String betaVersion) Add a specified beta to the global Stripe API Version.static voidstatic Stringstatic Stringstatic Proxystatic intReturns the connection timeout.static intReturns the maximum number of times requests will be retried.static Stringstatic PasswordAuthenticationstatic intReturns the read timeout.static Stringstatic Stringstatic voidoverrideApiBase(String overriddenApiBase) (FOR TESTING ONLY) If you'd like your API requests to hit your own (mocked) server, you can set this up here by overriding the base api URL.static voidoverrideConnectBase(String overriddenConnectBase) (FOR TESTING ONLY) If you'd like your OAuth requests to hit your own (mocked) server, you can set this up here by overriding the base Connect URL.static voidoverrideMeterEventsBase(String overriddenMeterEventsBase) (FOR TESTING ONLY) If you'd like your events requests to hit your own (mocked) server, you can set this up here by overriding the base api URL.static voidoverrideUploadBase(String overriddenUploadBase) (FOR TESTING ONLY) If you'd like your upload requests to hit your own (mocked) server, you can set this up here by overriding the base api URL.static voidsetAppInfo(String name) static voidsetAppInfo(String name, String version) static voidsetAppInfo(String name, String version, String url) static voidsetAppInfo(String name, String version, String url, String partnerId) Sets information about your application.static voidsetConnectionProxy(Proxy proxy) Set proxy to tunnel all Stripe connections.static voidsetConnectTimeout(int timeout) Sets the timeout value that will be used for making new connections to the Stripe API (in milliseconds).static voidsetMaxNetworkRetries(int numRetries) Sets the maximum number of times requests will be retried.static voidProvide credential for proxy authorization if required.static voidsetReadTimeout(int timeout) Sets the timeout value that will be used when reading data from an established connection to the Stripe API (in milliseconds).
-
Field Details
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT- See Also:
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT- See Also:
-
API_VERSION
- See Also:
-
CONNECT_API_BASE
- See Also:
-
LIVE_API_BASE
- See Also:
-
UPLOAD_API_BASE
- See Also:
-
METER_EVENTS_API_BASE
- See Also:
-
VERSION
- See Also:
-
apiKey
-
clientId
-
enableTelemetry
public static volatile boolean enableTelemetry -
stripeVersion
Stripe API version which is sent by default on requests. This is set to the API version that is linked to this SDK version. CalladdBetaVersion(String,String)to add beta version information.- See Also:
-
-
Constructor Details
-
Stripe
public Stripe()
-
-
Method Details
-
addBetaVersion
Add a specified beta to the global Stripe API Version. If the betaName already exists, the higher version will be used.- Throws:
IllegalArgumentException- if the betaVersion is not in the format 'v' + number (e.g. "v3")
-
clearBetaVersion
public static void clearBetaVersion() -
overrideApiBase
(FOR TESTING ONLY) If you'd like your API requests to hit your own (mocked) server, you can set this up here by overriding the base api URL. -
getApiBase
-
overrideConnectBase
(FOR TESTING ONLY) If you'd like your OAuth requests to hit your own (mocked) server, you can set this up here by overriding the base Connect URL. -
getConnectBase
-
overrideUploadBase
(FOR TESTING ONLY) If you'd like your upload requests to hit your own (mocked) server, you can set this up here by overriding the base api URL. -
getUploadBase
-
overrideMeterEventsBase
(FOR TESTING ONLY) If you'd like your events requests to hit your own (mocked) server, you can set this up here by overriding the base api URL. -
getMeterEventsBase
-
setConnectionProxy
Set proxy to tunnel all Stripe connections.- Parameters:
proxy- proxy host and port setting
-
getConnectionProxy
-
getConnectTimeout
public static int getConnectTimeout()Returns the connection timeout.- Returns:
- timeout value in milliseconds
-
setConnectTimeout
public static void 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 static int getReadTimeout()Returns the read timeout.- Returns:
- timeout value in milliseconds
-
setReadTimeout
public static void 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 static int getMaxNetworkRetries()Returns the maximum number of times requests will be retried.- Returns:
- the maximum number of times requests will be retried
-
setMaxNetworkRetries
public static void setMaxNetworkRetries(int numRetries) Sets the maximum number of times requests will be retried.- Parameters:
numRetries- the maximum number of times requests will be retried
-
setProxyCredential
Provide credential for proxy authorization if required.- Parameters:
auth- proxy required userName and password
-
getProxyCredential
-
setAppInfo
-
setAppInfo
-
setAppInfo
-
setAppInfo
Sets information about your application. The information is passed along to Stripe.- Parameters:
name- Name of your application (e.g. "MyAwesomeApp")version- Version of your application (e.g. "1.2.34")url- Website for your application (e.g. "https://myawesomeapp.info")partnerId- Your Stripe Partner ID (e.g. "pp_partner_1234")
-
getAppInfo
-
getStripeVersionWithBetaHeaders
-