Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
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.CreateCustomerPaymentMethodsRequest;
import com.conekta.model.CreateCustomerPaymentMethodsResponse;
import com.conekta.model.Error;
import com.conekta.model.GetPaymentMethodResponse;
import com.conekta.model.UpdateCustomerPaymentMethodsResponse;
import com.conekta.model.UpdatePaymentMethods;
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 PaymentMethodsApi {
private ApiClient apiClient;
public PaymentMethodsApi() {
this(Configuration.getDefaultApiClient());
}
public PaymentMethodsApi(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;
}
/**
* Create Payment Method
* Create a payment method for a customer.
* @param id Identifier of the resource (required)
* @param createCustomerPaymentMethodsRequest requested field for customer payment methods (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 CreateCustomerPaymentMethodsResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public CreateCustomerPaymentMethodsResponse createCustomerPaymentMethods(String id, CreateCustomerPaymentMethodsRequest createCustomerPaymentMethodsRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return createCustomerPaymentMethodsWithHttpInfo(id, createCustomerPaymentMethodsRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Create Payment Method
* Create a payment method for a customer.
* @param id Identifier of the resource (required)
* @param createCustomerPaymentMethodsRequest requested field for customer payment methods (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<CreateCustomerPaymentMethodsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse createCustomerPaymentMethodsWithHttpInfo(String id, CreateCustomerPaymentMethodsRequest createCustomerPaymentMethodsRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling createCustomerPaymentMethods");
}
if (createCustomerPaymentMethodsRequest == null) {
throw new ApiException(400, "Missing the required parameter 'createCustomerPaymentMethodsRequest' when calling createCustomerPaymentMethods");
}
// Path parameters
String localVarPath = "/customers/{id}/payment_sources"
.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("application/json");
String[] localVarAuthNames = new String[] {"bearerAuth"};
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("PaymentMethodsApi.createCustomerPaymentMethods", localVarPath, "POST", new ArrayList<>(), createCustomerPaymentMethodsRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Delete Payment Method
* Delete an existing payment method
* @param id Identifier of the resource (required)
* @param paymentMethodId Identifier of the payment method (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 UpdateCustomerPaymentMethodsResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public UpdateCustomerPaymentMethodsResponse deleteCustomerPaymentMethods(String id, String paymentMethodId, String acceptLanguage, String xChildCompanyId) throws ApiException {
return deleteCustomerPaymentMethodsWithHttpInfo(id, paymentMethodId, acceptLanguage, xChildCompanyId).getData();
}
/**
* Delete Payment Method
* Delete an existing payment method
* @param id Identifier of the resource (required)
* @param paymentMethodId Identifier of the payment method (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<UpdateCustomerPaymentMethodsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse deleteCustomerPaymentMethodsWithHttpInfo(String id, String paymentMethodId, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling deleteCustomerPaymentMethods");
}
if (paymentMethodId == null) {
throw new ApiException(400, "Missing the required parameter 'paymentMethodId' when calling deleteCustomerPaymentMethods");
}
// Path parameters
String localVarPath = "/customers/{id}/payment_sources/{payment_method_id}"
.replaceAll("\\{id}", apiClient.escapeString(id))
.replaceAll("\\{payment_method_id}", apiClient.escapeString(paymentMethodId));
// 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("PaymentMethodsApi.deleteCustomerPaymentMethods", localVarPath, "DELETE", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get Payment Methods
* Get a list of Payment Methods
* @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)
* @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 search General order search, e.g. by mail, reference etc. (optional)
* @return GetPaymentMethodResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public GetPaymentMethodResponse getCustomerPaymentMethods(String id, String acceptLanguage, String xChildCompanyId, Integer limit, String next, String previous, String search) throws ApiException {
return getCustomerPaymentMethodsWithHttpInfo(id, acceptLanguage, xChildCompanyId, limit, next, previous, search).getData();
}
/**
* Get Payment Methods
* Get a list of Payment Methods
* @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)
* @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 search General order search, e.g. by mail, reference etc. (optional)
* @return ApiResponse<GetPaymentMethodResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
401
authentication error
-
404
not found entity
-
500
internal server error
-
*/
public ApiResponse getCustomerPaymentMethodsWithHttpInfo(String id, String acceptLanguage, String xChildCompanyId, Integer limit, String next, String previous, String search) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling getCustomerPaymentMethods");
}
// Path parameters
String localVarPath = "/customers/{id}/payment_sources"
.replaceAll("\\{id}", apiClient.escapeString(id));
// 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("", "search", search));
// 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("PaymentMethodsApi.getCustomerPaymentMethods", localVarPath, "GET", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Update Payment Method
* Gets a payment Method that corresponds to a customer ID.
* @param id Identifier of the resource (required)
* @param paymentMethodId Identifier of the payment method (required)
* @param updatePaymentMethods requested field for customer payment methods (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 UpdateCustomerPaymentMethodsResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public UpdateCustomerPaymentMethodsResponse updateCustomerPaymentMethods(String id, String paymentMethodId, UpdatePaymentMethods updatePaymentMethods, String acceptLanguage, String xChildCompanyId) throws ApiException {
return updateCustomerPaymentMethodsWithHttpInfo(id, paymentMethodId, updatePaymentMethods, acceptLanguage, xChildCompanyId).getData();
}
/**
* Update Payment Method
* Gets a payment Method that corresponds to a customer ID.
* @param id Identifier of the resource (required)
* @param paymentMethodId Identifier of the payment method (required)
* @param updatePaymentMethods requested field for customer payment methods (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<UpdateCustomerPaymentMethodsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
-
401
authentication error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse updateCustomerPaymentMethodsWithHttpInfo(String id, String paymentMethodId, UpdatePaymentMethods updatePaymentMethods, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling updateCustomerPaymentMethods");
}
if (paymentMethodId == null) {
throw new ApiException(400, "Missing the required parameter 'paymentMethodId' when calling updateCustomerPaymentMethods");
}
if (updatePaymentMethods == null) {
throw new ApiException(400, "Missing the required parameter 'updatePaymentMethods' when calling updateCustomerPaymentMethods");
}
// Path parameters
String localVarPath = "/customers/{id}/payment_sources/{payment_method_id}"
.replaceAll("\\{id}", apiClient.escapeString(id))
.replaceAll("\\{payment_method_id}", apiClient.escapeString(paymentMethodId));
// 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("application/json");
String[] localVarAuthNames = new String[] {"bearerAuth"};
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("PaymentMethodsApi.updateCustomerPaymentMethods", localVarPath, "PUT", new ArrayList<>(), updatePaymentMethods,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
}