Class PreapprovalClient
- java.lang.Object
-
- com.mercadopago.client.MercadoPagoClient
-
- com.mercadopago.client.preapproval.PreapprovalClient
-
public class PreapprovalClient extends MercadoPagoClient
Client that use the Preapproval APIs.
-
-
Field Summary
-
Fields inherited from class com.mercadopago.client.MercadoPagoClient
defaultHeaders, httpClient
-
-
Constructor Summary
Constructors Constructor Description PreapprovalClient()Default constructor.PreapprovalClient(MPHttpClient httpClient)Constructor used for providing a custom http client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Preapprovalcreate(PreapprovalCreateRequest request)Creates a Preapproval.Preapprovalcreate(PreapprovalCreateRequest request, MPRequestOptions requestOptions)Creates a Preapproval.Preapprovalget(String id)Get a Preapproval by your ID.Preapprovalget(String id, MPRequestOptions requestOptions)Get a Preapproval by your ID.MPResultsResourcesPage<Preapproval>search(MPSearchRequest request)Method responsible for search preapprovals.MPResultsResourcesPage<Preapproval>search(MPSearchRequest request, MPRequestOptions requestOptions)Method responsible for search preapprovals.Preapprovalupdate(String id, PreapprovalUpdateRequest request)Updates a Preapproval.Preapprovalupdate(String id, PreapprovalUpdateRequest request, MPRequestOptions requestOptions)Updates a Preapproval.
-
-
-
Constructor Detail
-
PreapprovalClient
public PreapprovalClient()
Default constructor. Uses the default http client used by the SDK.
-
PreapprovalClient
public PreapprovalClient(MPHttpClient httpClient)
Constructor used for providing a custom http client.- Parameters:
httpClient- httpClient
-
-
Method Detail
-
get
public Preapproval get(String id) throws MPException, MPApiException
Get a Preapproval by your ID.- Parameters:
id- preapproval id.- Returns:
- Preapproval pre approval information
- Throws:
MPException- an error if the request failsMPApiException
-
get
public Preapproval get(String id, MPRequestOptions requestOptions) throws MPException, MPApiException
Get a Preapproval by your ID.- Parameters:
id- preapprovalId.requestOptions- metadata to customize the request- Returns:
- Preapproval pre approval information
- Throws:
MPException- an error if the request failsMPApiException
-
create
public Preapproval create(PreapprovalCreateRequest request) throws MPException, MPApiException
Creates a Preapproval.- Parameters:
request- attributes used to create a preapproval- Returns:
- Preapproval pre approval information
- Throws:
MPException- an error if the request failsMPApiException
-
create
public Preapproval create(PreapprovalCreateRequest request, MPRequestOptions requestOptions) throws MPException, MPApiException
Creates a Preapproval.- Parameters:
request- attributes used to create a preapprovalrequestOptions- metadata to customize the request- Returns:
- Preapproval pre approval information
- Throws:
MPException- an error if the request failsMPApiException
-
update
public Preapproval update(String id, PreapprovalUpdateRequest request) throws MPException, MPApiException
Updates a Preapproval.- Parameters:
id- preapprovalIdrequest- attributes used for the update- Returns:
- Preapproval pre approval information
- Throws:
MPException- an error if the request failsMPApiException
-
update
public Preapproval update(String id, PreapprovalUpdateRequest request, MPRequestOptions requestOptions) throws MPException, MPApiException
Updates a Preapproval.- Parameters:
id- preapprovalIdrequest- attributes used for the updaterequestOptions- metadata to customize the request- Returns:
- Preapproval pre approval information
- Throws:
MPException- an error if the request failsMPApiException
-
search
public MPResultsResourcesPage<Preapproval> search(MPSearchRequest request) throws MPException, MPApiException
Method responsible for search preapprovals.- Parameters:
request- attributes used for the search- Returns:
- list of results
- Throws:
MPException- an error if the request failsMPApiException
-
search
public MPResultsResourcesPage<Preapproval> search(MPSearchRequest request, MPRequestOptions requestOptions) throws MPException, MPApiException
Method responsible for search preapprovals.- Parameters:
request- attributes used for the searchrequestOptions- metadata to customize the request- Returns:
- list of results
- Throws:
MPException- an error if the request failsMPApiException
-
-