Class PaymentRefundClient
Client that use the Payment Refunds APIs.
Inherited Members
Namespace: MercadoPago.Client.Payment
Assembly: MercadoPago.dll
Syntax
public class PaymentRefundClient : MercadoPagoClient<PaymentRefund>
Constructors
| Edit this page View SourcePaymentRefundClient()
Initializes a new instance of the PaymentRefundClient class.
Declaration
public PaymentRefundClient()
PaymentRefundClient(IHttpClient)
Initializes a new instance of the PaymentRefundClient class.
Declaration
public PaymentRefundClient(IHttpClient httpClient)
Parameters
Type | Name | Description |
---|---|---|
IHttpClient | httpClient | The http client that will be used in HTTP requests. |
PaymentRefundClient(IHttpClient, ISerializer)
Initializes a new instance of the PaymentRefundClient class.
Declaration
public PaymentRefundClient(IHttpClient httpClient, ISerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IHttpClient | httpClient | The http client that will be used in HTTP requests. |
ISerializer | serializer | The serializer that will be used to serialize the HTTP requests content and to deserialize the HTTP response content. |
PaymentRefundClient(ISerializer)
Initializes a new instance of the PaymentRefundClient class.
Declaration
public PaymentRefundClient(ISerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
ISerializer | serializer | The serializer that will be used to serialize the HTTP requests content and to deserialize the HTTP response content. |
Methods
| Edit this page View SourceGet(long, long, RequestOptions)
Gets a refund by id from the payment.
Declaration
public PaymentRefund Get(long paymentId, long id, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
long | paymentId | The payment ID. |
long | id | The refund ID. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
PaymentRefund | A task whose the result is the refund. |
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
GetAsync(long, long, RequestOptions, CancellationToken)
Gets async a refund by id from the payment.
Declaration
public Task<PaymentRefund> GetAsync(long paymentId, long id, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
long | paymentId | The payment ID. |
long | id | The refund ID. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<PaymentRefund> | A task whose the result is the refund. |
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
List(long, RequestOptions)
Lists the refunds of the payment.
Declaration
public ResourcesList<PaymentRefund> List(long paymentId, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
long | paymentId | The payment ID. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
ResourcesList<PaymentRefund> | A task whose the result is the list of refund. |
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
ListAsync(long, RequestOptions, CancellationToken)
Lists async the refunds of the payment.
Declaration
public Task<ResourcesList<PaymentRefund>> ListAsync(long paymentId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
long | paymentId | The payment ID. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<ResourcesList<PaymentRefund>> | A task whose the result is the list of refund. |
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
Refund(long, RequestOptions)
Creates a total refund for payment.
Declaration
public PaymentRefund Refund(long paymentId, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
long | paymentId | The payment ID. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
PaymentRefund | The refund. |
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
Refund(long, decimal?, RequestOptions)
Creates a refund for payment.
Declaration
public PaymentRefund Refund(long paymentId, decimal? amount, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
long | paymentId | The payment ID. |
decimal? | amount | The amount to refund. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
PaymentRefund | The refund. |
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
RefundAsync(long, RequestOptions, CancellationToken)
Creates async a total refund for payment.
Declaration
public Task<PaymentRefund> RefundAsync(long paymentId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
long | paymentId | The payment ID. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<PaymentRefund> | A task whose the result is the refund. |
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
RefundAsync(long, decimal?, RequestOptions, CancellationToken)
Creates async a refund for payment.
Declaration
public Task<PaymentRefund> RefundAsync(long paymentId, decimal? amount, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
long | paymentId | The payment ID. |
decimal? | amount | The amount to refund. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<PaymentRefund> | A task whose the result is the refund. |
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |