Interface SatimHttpClient

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractHttpClient

public interface SatimHttpClient extends AutoCloseable
HTTP client interface for communicating with the Satim API.

Implementations handle the actual HTTP requests to the payment gateway. Multiple transport options are available (OkHttp, Apache HttpClient, etc.).

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Releases resources held by this client.
    @NotNull CompletableFuture<com.google.gson.JsonObject>
    get(@NotNull String endpoint, @Nullable com.google.gson.JsonObject params)
    Performs a GET request.
    default @NotNull String
    Returns the base URL based on current mode.
    @NotNull String
    Returns the API password.
    @NotNull String
    Returns the merchant terminal ID.
    @NotNull String
    Returns the API username.
    boolean
    Returns whether test mode is enabled.
    @NotNull CompletableFuture<com.google.gson.JsonObject>
    post(@NotNull String endpoint, @Nullable com.google.gson.JsonObject params)
    Performs a POST request.
     
    withTestMode(boolean testMode)
    Enables or disables test mode.
  • Field Details

  • Method Details

    • getUsername

      @NotNull @NotNull String getUsername()
      Returns the API username.
    • getPassword

      @NotNull @NotNull String getPassword()
      Returns the API password.
    • getTerminalId

      @NotNull @NotNull String getTerminalId()
      Returns the merchant terminal ID.
    • isTestMode

      boolean isTestMode()
      Returns whether test mode is enabled.
    • withTestMode

      @NotNull @NotNull SatimHttpClient withTestMode(boolean testMode)
      Enables or disables test mode.
      Parameters:
      testMode - true for sandbox, false for production
      Returns:
      this client for method chaining
    • getBaseUrl

      @NotNull default @NotNull String getBaseUrl()
      Returns the base URL based on current mode.
    • get

      @NotNull @NotNull CompletableFuture<com.google.gson.JsonObject> get(@NotNull @NotNull String endpoint, @Nullable @Nullable com.google.gson.JsonObject params)
      Performs a GET request.
      Parameters:
      endpoint - the API endpoint
      params - query parameters, or null
      Returns:
      future containing the JSON response
    • post

      @NotNull @NotNull CompletableFuture<com.google.gson.JsonObject> post(@NotNull @NotNull String endpoint, @Nullable @Nullable com.google.gson.JsonObject params)
      Performs a POST request.
      Parameters:
      endpoint - the API endpoint
      params - form parameters, or null
      Returns:
      future containing the JSON response
    • close

      void close()
      Releases resources held by this client.
      Specified by:
      close in interface AutoCloseable
    • self

      default SatimHttpClient self()