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.Checkout;
import com.conekta.model.CheckoutResponse;
import com.conekta.model.CheckoutsResponse;
import com.conekta.model.EmailCheckoutRequest;
import com.conekta.model.Error;
import com.conekta.model.SmsCheckoutRequest;
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 PaymentLinkApi {
private ApiClient apiClient;
public PaymentLinkApi() {
this(Configuration.getDefaultApiClient());
}
public PaymentLinkApi(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;
}
/**
* Cancel Payment Link
*
* @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 CheckoutResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public CheckoutResponse cancelCheckout(String id, String acceptLanguage, String xChildCompanyId) throws ApiException {
return cancelCheckoutWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData();
}
/**
* Cancel Payment Link
*
* @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<CheckoutResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse cancelCheckoutWithHttpInfo(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 cancelCheckout");
}
// Path parameters
String localVarPath = "/checkouts/{id}/cancel"
.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("PaymentLinkApi.cancelCheckout", localVarPath, "PUT", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Create Unique Payment Link
*
* @param checkout requested field for checkout (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 CheckoutResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
422
parameter validation error
-
500
internal server error
-
*/
public CheckoutResponse createCheckout(Checkout checkout, String acceptLanguage, String xChildCompanyId) throws ApiException {
return createCheckoutWithHttpInfo(checkout, acceptLanguage, xChildCompanyId).getData();
}
/**
* Create Unique Payment Link
*
* @param checkout requested field for checkout (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<CheckoutResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse createCheckoutWithHttpInfo(Checkout checkout, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (checkout == null) {
throw new ApiException(400, "Missing the required parameter 'checkout' when calling createCheckout");
}
// 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("PaymentLinkApi.createCheckout", "/checkouts", "POST", new ArrayList<>(), checkout,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Send an email
*
* @param id Identifier of the resource (required)
* @param emailCheckoutRequest requested field for sms checkout (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 CheckoutResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public CheckoutResponse emailCheckout(String id, EmailCheckoutRequest emailCheckoutRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return emailCheckoutWithHttpInfo(id, emailCheckoutRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Send an email
*
* @param id Identifier of the resource (required)
* @param emailCheckoutRequest requested field for sms checkout (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<CheckoutResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse emailCheckoutWithHttpInfo(String id, EmailCheckoutRequest emailCheckoutRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling emailCheckout");
}
if (emailCheckoutRequest == null) {
throw new ApiException(400, "Missing the required parameter 'emailCheckoutRequest' when calling emailCheckout");
}
// Path parameters
String localVarPath = "/checkouts/{id}/email"
.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("PaymentLinkApi.emailCheckout", localVarPath, "POST", new ArrayList<>(), emailCheckoutRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get a payment link by ID
*
* @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 CheckoutResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public CheckoutResponse getCheckout(String id, String acceptLanguage, String xChildCompanyId) throws ApiException {
return getCheckoutWithHttpInfo(id, acceptLanguage, xChildCompanyId).getData();
}
/**
* Get a payment link by ID
*
* @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<CheckoutResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse getCheckoutWithHttpInfo(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 getCheckout");
}
// Path parameters
String localVarPath = "/checkouts/{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("PaymentLinkApi.getCheckout", localVarPath, "GET", new ArrayList<>(), null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Get a list of payment links
* Returns a list of links generated by the merchant
* @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 search General order search, e.g. by mail, reference etc. (optional)
* @param next next page (optional)
* @param previous previous page (optional)
* @return CheckoutsResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
422
parameter validation error
-
500
internal server error
-
*/
public CheckoutsResponse getCheckouts(String acceptLanguage, String xChildCompanyId, Integer limit, String search, String next, String previous) throws ApiException {
return getCheckoutsWithHttpInfo(acceptLanguage, xChildCompanyId, limit, search, next, previous).getData();
}
/**
* Get a list of payment links
* Returns a list of links generated by the merchant
* @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 search General order search, e.g. by mail, reference etc. (optional)
* @param next next page (optional)
* @param previous previous page (optional)
* @return ApiResponse<CheckoutsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse getCheckoutsWithHttpInfo(String acceptLanguage, String xChildCompanyId, Integer limit, String search, String next, String previous) throws ApiException {
// Query parameters
List localVarQueryParams = new ArrayList<>(
apiClient.parameterToPairs("", "limit", limit)
);
localVarQueryParams.addAll(apiClient.parameterToPairs("", "search", search));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "next", next));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "previous", previous));
// 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("PaymentLinkApi.getCheckouts", "/checkouts", "GET", localVarQueryParams, null,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Send an sms
*
* @param id Identifier of the resource (required)
* @param smsCheckoutRequest requested field for sms checkout (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 CheckoutResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public CheckoutResponse smsCheckout(String id, SmsCheckoutRequest smsCheckoutRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
return smsCheckoutWithHttpInfo(id, smsCheckoutRequest, acceptLanguage, xChildCompanyId).getData();
}
/**
* Send an sms
*
* @param id Identifier of the resource (required)
* @param smsCheckoutRequest requested field for sms checkout (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<CheckoutResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
successful operation
* 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
-
402
payment required error
-
404
not found entity
-
422
parameter validation error
-
500
internal server error
-
*/
public ApiResponse smsCheckoutWithHttpInfo(String id, SmsCheckoutRequest smsCheckoutRequest, String acceptLanguage, String xChildCompanyId) throws ApiException {
// Check required parameters
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling smsCheckout");
}
if (smsCheckoutRequest == null) {
throw new ApiException(400, "Missing the required parameter 'smsCheckoutRequest' when calling smsCheckout");
}
// Path parameters
String localVarPath = "/checkouts/{id}/sms"
.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("PaymentLinkApi.smsCheckout", localVarPath, "POST", new ArrayList<>(), smsCheckoutRequest,
localVarHeaderParams, new LinkedHashMap<>(), new LinkedHashMap<>(), localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
}