Class SendonPayment

java.lang.Object
io.sendon.base.SendonClient
io.sendon.payment.SendonPayment

public class SendonPayment extends SendonClient
SendonPayment is a client wrapper for interacting with the Sendon API. It provides methods to retrieve payment-related information such as payment histories and details.
  • Constructor Details

    • SendonPayment

      public SendonPayment(String userId, String apiKey)
      Constructor to initialize SendonPayment with user credentials.
      Parameters:
      userId - The user ID for authentication.
      apiKey - The API key for authentication.
    • SendonPayment

      public SendonPayment(String userId, String apiKey, boolean useOkHttp)
      Constructor to initialize SendonPayment with user credentials and an option to use OkHttp.
      Parameters:
      userId - The user ID for authentication.
      apiKey - The API key for authentication.
      useOkHttp - Flag to indicate whether to use OkHttp for HTTP requests.
  • Method Details

    • getPaymentHistories

      public GetPaymentHistories getPaymentHistories(int page, int limit, String startDate, String endDate)
      Fetches a paginated list of payment histories from the Sendon API.
      Parameters:
      page - The page number for pagination.
      limit - The maximum number of results to fetch per page.
      startDate - The start date for filtering payment histories (optional).
      endDate - The end date for filtering payment histories (optional).
      Returns:
      A GetPaymentHistories object containing the response data, or null if an error occurs.
    • getPaymentHistory

      public GetPaymentHistory getPaymentHistory(int historyId)
      Fetches the details of a specific payment history from the Sendon API.
      Parameters:
      historyId - The ID of the payment history to retrieve.
      Returns:
      A GetPaymentHistory object containing the payment history details, or null if an error occurs.