Package com.mercadopago.client.payment
Class PaymentRefundClient
- java.lang.Object
-
- com.mercadopago.client.MercadoPagoClient
-
- com.mercadopago.client.payment.PaymentRefundClient
-
public class PaymentRefundClient extends MercadoPagoClient
Client that use the Payment Refunds APIs.
-
-
Field Summary
-
Fields inherited from class com.mercadopago.client.MercadoPagoClient
defaultHeaders, httpClient
-
-
Constructor Summary
Constructors Constructor Description PaymentRefundClient()
Default constructor.PaymentRefundClient(MPHttpClient httpClient)
Constructor used for providing a custom http client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentRefund
get(Long paymentId, Long refundId)
Gets refund information by id from the payment.PaymentRefund
get(Long paymentId, Long refundId, MPRequestOptions requestOptions)
Gets refund information by id from the payment.MPResourceList<PaymentRefund>
list(Long paymentId)
Lists the refunds of the payment.MPResourceList<PaymentRefund>
list(Long paymentId, MPRequestOptions requestOptions)
Lists the refunds of the payment.PaymentRefund
refund(Long paymentId)
Creates a refund for payment.PaymentRefund
refund(Long paymentId, MPRequestOptions requestOptions)
Creates a refund for payment.PaymentRefund
refund(Long paymentId, BigDecimal amount)
Creates a refund for payment.PaymentRefund
refund(Long paymentId, BigDecimal amount, MPRequestOptions requestOptions)
Creates a refund for payment.
-
-
-
Constructor Detail
-
PaymentRefundClient
public PaymentRefundClient()
Default constructor. Uses the default http client used by the SDK.
-
PaymentRefundClient
public PaymentRefundClient(MPHttpClient httpClient)
Constructor used for providing a custom http client.- Parameters:
httpClient
- httpClient
-
-
Method Detail
-
refund
public PaymentRefund refund(Long paymentId) throws MPException, MPApiException
Creates a refund for payment.- Parameters:
paymentId
- payment id- Returns:
- PaymentRefund
- Throws:
MPException
- an error if the request failsMPApiException
- See Also:
- api docs
-
refund
public PaymentRefund refund(Long paymentId, MPRequestOptions requestOptions) throws MPException, MPApiException
Creates a refund for payment.- Parameters:
paymentId
- payment idrequestOptions
- metadata to customize the request- Returns:
- PaymentRefund
- Throws:
MPException
- an error if the request failsMPApiException
- See Also:
- api docs
-
refund
public PaymentRefund refund(Long paymentId, BigDecimal amount) throws MPException, MPApiException
Creates a refund for payment.- Parameters:
paymentId
- payment idamount
- refund amount- Returns:
- PaymentRefund
- Throws:
MPException
- an error if the request failsMPApiException
- See Also:
- api docs
-
refund
public PaymentRefund refund(Long paymentId, BigDecimal amount, MPRequestOptions requestOptions) throws MPException, MPApiException
Creates a refund for payment.- Parameters:
paymentId
- payment idamount
- refund amountrequestOptions
- metadata to customize the request- Returns:
- PaymentRefund
- Throws:
MPException
- an error if the request failsMPApiException
- See Also:
- api docs
-
get
public PaymentRefund get(Long paymentId, Long refundId) throws MPException, MPApiException
Gets refund information by id from the payment.- Parameters:
paymentId
- payment idrefundId
- refund id- Returns:
- PaymentRefund
- Throws:
MPException
- an error if the request failsMPApiException
- See Also:
- api docs
-
get
public PaymentRefund get(Long paymentId, Long refundId, MPRequestOptions requestOptions) throws MPException, MPApiException
Gets refund information by id from the payment.- Parameters:
paymentId
- payment idrefundId
- refund idrequestOptions
- metadata to customize the request- Returns:
- PaymentRefund
- Throws:
MPException
- an error if the request failsMPApiException
- See Also:
- api docs
-
list
public MPResourceList<PaymentRefund> list(Long paymentId) throws MPException, MPApiException
Lists the refunds of the payment.- Parameters:
paymentId
- payment id- Returns:
- list of PaymentRefund
- Throws:
MPException
- an error if the request failsMPApiException
- See Also:
- api docs
-
list
public MPResourceList<PaymentRefund> list(Long paymentId, MPRequestOptions requestOptions) throws MPException, MPApiException
Lists the refunds of the payment.- Parameters:
paymentId
- payment idrequestOptions
- metadata to customize the request- Returns:
- list of PaymentRefund
- Throws:
MPException
- an error if the request failsMPApiException
- See Also:
- api docs
-
-