All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.conekta.TransactionsApi Maven / Gradle / Ivy

Go to download

This is a java library that allows interaction with https://api.conekta.io API.

The newest version!
package com.conekta;

import com.conekta.ApiException;
import com.conekta.ApiClient;
import com.conekta.ApiResponse;
import com.conekta.Configuration;
import com.conekta.Pair;

import javax.ws.rs.core.GenericType;

import com.conekta.model.Error;
import com.conekta.model.GetTransactionsResponse;
import com.conekta.model.TransactionResponse;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
public class TransactionsApi {
  private ApiClient apiClient;

  public TransactionsApi() {
    this(Configuration.getDefaultApiClient());
  }

  public TransactionsApi(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * Get the API client
   *
   * @return API client
   */
  public ApiClient getApiClient() {
    return apiClient;
  }

  /**
   * Set the API client
   *
   * @param apiClient an instance of API client
   */
  public void setApiClient(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  /**
   * Get transaction
   * Get the details of a transaction
   * @param id Identifier of the resource (required)
   * @param acceptLanguage Use for knowing which language to use (optional, default to es)
   * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional)
   * @return TransactionResponse
   * @throws ApiException if fails to make API call
   * @http.response.details
     
Status Code Description Response Headers
200 successful * Date - The date and time that the response was sent
* Content-Type - The format of the response body
* Content-Length - The length of the response body in bytes
* Connection - The type of connection used to transfer the response
* Conekta-Media-Type -
401 authentication error -
404 authentication error -
500 internal server error -
*/ public TransactionResponse getTransaction(String id, String acceptLanguage, String xChildCompanyId) throws ApiException { return getTransactionWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData(); } /** * Get transaction * Get the details of a transaction * @param id Identifier of the resource (required) * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @return ApiResponse<TransactionResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful * Date - The date and time that the response was sent
* Content-Type - The format of the response body
* Content-Length - The length of the response body in bytes
* Connection - The type of connection used to transfer the response
* Conekta-Media-Type -
401 authentication error -
404 authentication error -
500 internal server error -
*/ public ApiResponse getTransactionWithHttpInfo(String id, String acceptLanguage, String xChildCompanyId) throws ApiException { // Check required parameters if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling getTransaction"); } // Path parameters String localVarPath = "/transactions/{id}" .replaceAll("\\{id}", apiClient.escapeString(id)); // Header parameters Map localVarHeaderParams = new LinkedHashMap<>(); if (acceptLanguage != null) { localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage)); } if (xChildCompanyId != null) { localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId)); } String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("TransactionsApi.getTransaction", localVarPath, "GET", new ArrayList<>(), null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } /** * Get List transactions * Get transaction details in the form of a list * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @param limit The numbers of items to return, the maximum value is 250 (optional, default to 20) * @param next next page (optional) * @param previous previous page (optional) * @param id id of the object to be retrieved (optional) * @param chargeId id of the charge used for filtering (optional) * @param type type of the object to be retrieved (optional) * @param currency currency of the object to be retrieved (optional) * @return GetTransactionsResponse * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful * Date - The date and time that the response was sent
* Content-Type - The format of the response body
* Content-Length - The length of the response body in bytes
* Connection - The type of connection used to transfer the response
* Conekta-Media-Type -
401 authentication error -
500 internal server error -
*/ public GetTransactionsResponse getTransactions(String acceptLanguage, String xChildCompanyId, Integer limit, String next, String previous, String id, String chargeId, String type, String currency) throws ApiException { return getTransactionsWithHttpInfo(acceptLanguage, xChildCompanyId, limit, next, previous, id, chargeId, type, currency).getData(); } /** * Get List transactions * Get transaction details in the form of a list * @param acceptLanguage Use for knowing which language to use (optional, default to es) * @param xChildCompanyId In the case of a holding company, the company id of the child company to which will process the request. (optional) * @param limit The numbers of items to return, the maximum value is 250 (optional, default to 20) * @param next next page (optional) * @param previous previous page (optional) * @param id id of the object to be retrieved (optional) * @param chargeId id of the charge used for filtering (optional) * @param type type of the object to be retrieved (optional) * @param currency currency of the object to be retrieved (optional) * @return ApiResponse<GetTransactionsResponse> * @throws ApiException if fails to make API call * @http.response.details
Status Code Description Response Headers
200 successful * Date - The date and time that the response was sent
* Content-Type - The format of the response body
* Content-Length - The length of the response body in bytes
* Connection - The type of connection used to transfer the response
* Conekta-Media-Type -
401 authentication error -
500 internal server error -
*/ public ApiResponse getTransactionsWithHttpInfo(String acceptLanguage, String xChildCompanyId, Integer limit, String next, String previous, String id, String chargeId, String type, String currency) throws ApiException { // Query parameters List localVarQueryParams = new ArrayList<>( apiClient.parameterToPairs("", "limit", limit) ); localVarQueryParams.addAll(apiClient.parameterToPairs("", "next", next)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "previous", previous)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "id", id)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "charge_id", chargeId)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "type", type)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "currency", currency)); // Header parameters Map localVarHeaderParams = new LinkedHashMap<>(); if (acceptLanguage != null) { localVarHeaderParams.put("Accept-Language", apiClient.parameterToString(acceptLanguage)); } if (xChildCompanyId != null) { localVarHeaderParams.put("X-Child-Company-Id", apiClient.parameterToString(xChildCompanyId)); } String localVarAccept = apiClient.selectHeaderAccept("application/vnd.conekta-v2.1.0+json"); String localVarContentType = apiClient.selectHeaderContentType(); String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI("TransactionsApi.getTransactions", "/transactions", "GET", localVarQueryParams, null, localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy