Package com.akraml.satim.http
Class AbstractHttpClient
java.lang.Object
com.akraml.satim.http.AbstractHttpClient
- All Implemented Interfaces:
SatimHttpClient,AutoCloseable
Abstract implementation for
SatimHttpClient.
Example usage:
SatimHttpClient client = new OkHttpSatimClient(
"your-username",
"your-password",
"your-terminal-id"
);
SatimAPI api = new SatimAPI(client);
- See Also:
-
Field Summary
Fields inherited from interface com.akraml.satim.http.SatimHttpClient
USER_AGENT -
Constructor Summary
ConstructorsConstructorDescriptionAbstractHttpClient(@NotNull String username, @NotNull String password, @NotNull String terminalId) -
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull StringReturns the API password.final @NotNull StringReturns the merchant terminal ID.final @NotNull StringReturns the API username.final booleanReturns whether test mode is enabled.final @NotNull SatimHttpClientwithTestMode(boolean testMode) Enables or disables test mode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.akraml.satim.http.SatimHttpClient
close, get, getBaseUrl, post, self
-
Constructor Details
-
AbstractHttpClient
-
-
Method Details
-
getUsername
Description copied from interface:SatimHttpClientReturns the API username.- Specified by:
getUsernamein interfaceSatimHttpClient
-
getPassword
Description copied from interface:SatimHttpClientReturns the API password.- Specified by:
getPasswordin interfaceSatimHttpClient
-
getTerminalId
Description copied from interface:SatimHttpClientReturns the merchant terminal ID.- Specified by:
getTerminalIdin interfaceSatimHttpClient
-
isTestMode
public final boolean isTestMode()Description copied from interface:SatimHttpClientReturns whether test mode is enabled.- Specified by:
isTestModein interfaceSatimHttpClient
-
withTestMode
Description copied from interface:SatimHttpClientEnables or disables test mode.- Specified by:
withTestModein interfaceSatimHttpClient- Parameters:
testMode-truefor sandbox,falsefor production- Returns:
- this client for method chaining
-