Package com.stripe
Class Stripe
- java.lang.Object
-
- com.stripe.Stripe
-
public abstract class Stripe extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAPI_VERSIONstatic java.lang.StringapiKeystatic java.lang.StringclientIdstatic java.lang.StringCONNECT_API_BASEstatic intDEFAULT_CONNECT_TIMEOUTstatic intDEFAULT_READ_TIMEOUTstatic booleanenableTelemetrystatic java.lang.StringLIVE_API_BASEstatic java.lang.StringpartnerIdstatic java.lang.StringUPLOAD_API_BASEstatic java.lang.StringVERSION
-
Constructor Summary
Constructors Constructor Description Stripe()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetApiBase()static java.util.Map<java.lang.String,java.lang.String>getAppInfo()static java.lang.StringgetConnectBase()static java.net.ProxygetConnectionProxy()static intgetConnectTimeout()Returns the connection timeout.static intgetMaxNetworkRetries()Returns the maximum number of times requests will be retried.static java.net.PasswordAuthenticationgetProxyCredential()static intgetReadTimeout()Returns the read timeout.static java.lang.StringgetUploadBase()static voidoverrideApiBase(java.lang.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(java.lang.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 voidoverrideUploadBase(java.lang.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(java.lang.String name)static voidsetAppInfo(java.lang.String name, java.lang.String version)static voidsetAppInfo(java.lang.String name, java.lang.String version, java.lang.String url)static voidsetAppInfo(java.lang.String name, java.lang.String version, java.lang.String url, java.lang.String partnerId)Sets information about your application.static voidsetConnectionProxy(java.net.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 voidsetProxyCredential(java.net.PasswordAuthentication auth)Provide 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 Detail
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT
- See Also:
- Constant Field Values
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT
- See Also:
- Constant Field Values
-
API_VERSION
public static final java.lang.String API_VERSION
- See Also:
- Constant Field Values
-
CONNECT_API_BASE
public static final java.lang.String CONNECT_API_BASE
- See Also:
- Constant Field Values
-
LIVE_API_BASE
public static final java.lang.String LIVE_API_BASE
- See Also:
- Constant Field Values
-
UPLOAD_API_BASE
public static final java.lang.String UPLOAD_API_BASE
- See Also:
- Constant Field Values
-
VERSION
public static final java.lang.String VERSION
- See Also:
- Constant Field Values
-
apiKey
public static volatile java.lang.String apiKey
-
clientId
public static volatile java.lang.String clientId
-
enableTelemetry
public static volatile boolean enableTelemetry
-
partnerId
public static volatile java.lang.String partnerId
-
-
Method Detail
-
overrideApiBase
public static void overrideApiBase(java.lang.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.
-
getApiBase
public static java.lang.String getApiBase()
-
overrideConnectBase
public static void overrideConnectBase(java.lang.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.
-
getConnectBase
public static java.lang.String getConnectBase()
-
overrideUploadBase
public static void overrideUploadBase(java.lang.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.
-
getUploadBase
public static java.lang.String getUploadBase()
-
setConnectionProxy
public static void setConnectionProxy(java.net.Proxy proxy)
Set proxy to tunnel all Stripe connections.- Parameters:
proxy- proxy host and port setting
-
getConnectionProxy
public static java.net.Proxy 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
public static void setProxyCredential(java.net.PasswordAuthentication auth)
Provide credential for proxy authorization if required.- Parameters:
auth- proxy required userName and password
-
getProxyCredential
public static java.net.PasswordAuthentication getProxyCredential()
-
setAppInfo
public static void setAppInfo(java.lang.String name)
-
setAppInfo
public static void setAppInfo(java.lang.String name, java.lang.String version)
-
setAppInfo
public static void setAppInfo(java.lang.String name, java.lang.String version, java.lang.String url)
-
setAppInfo
public static void setAppInfo(java.lang.String name, java.lang.String version, java.lang.String url, java.lang.String partnerId)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
public static java.util.Map<java.lang.String,java.lang.String> getAppInfo()
-
-