public class RefundHandler extends AbstractHandler
| Constructor and Description |
|---|
RefundHandler(String baseUrl) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelRefund(String paymentId,
String refundId)
For certain payment methods, like iDEAL, the underlying banking system will delay refunds until the next day.
|
void |
cancelRefund(String paymentId,
String refundId,
QueryParams params)
For certain payment methods, like iDEAL, the underlying banking system will delay refunds until the next day.
|
RefundResponse |
createRefund(String paymentId,
RefundRequest body)
Most payment methods support refunds.
|
RefundResponse |
createRefund(String paymentId,
RefundRequest body,
QueryParams params)
Most payment methods support refunds.
|
RefundResponse |
getRefund(String paymentId,
String refundId)
Retrieve a single refund by its ID.
|
RefundResponse |
getRefund(String paymentId,
String refundId,
QueryParams params)
Retrieve a single refund by its ID.
|
Pagination<RefundListResponse> |
listRefunds()
Retrieve refunds.
|
Pagination<RefundListResponse> |
listRefunds(QueryParams params)
Retrieve refunds.
|
Pagination<RefundListResponse> |
listRefunds(String paymentId)
Retrieve refunds.
|
Pagination<RefundListResponse> |
listRefunds(String paymentId,
QueryParams params)
Retrieve refunds.
|
delete, delete, delete, get, get, patch, patch, post, post, postWithoutBody, validateResponsepublic RefundHandler(String baseUrl)
public RefundResponse createRefund(String paymentId, RefundRequest body) throws MollieException
Refunds are not available at all for Bitcoin, paysafecard and gift cards. If you need to refund direct debit payments, please contact our support department.
Refunds support descriptions, which we will show in the Dashboard, your exports and pass to your customer if possible.
If you have insufficient balance with Mollie to perform the refund, the refund will be queued. We will automatically process the refund once your balance increases.
Any payments created for Orders can also be refunded using the Payment Refunds API. However, we recommend using the Order Refund API in those cases so you can pass the order lines you are refunding too. For pay after delivery methods, this is mandatory.
Possible errors¶ Sometimes a situation can occur in which it is not possible to perform the refund. In such cases an HTTP 4xx error will be returned. Some of these situations are illustrated here:
There might not be enough balance on your account with the payment provider (e.g. PayPal). You may have forgotten to grant the appropriate rights to Mollie for the payment provider (PayPal only). It is possible that the payment has already been (partially) refunded. It is not always possible to do a partial refund. If you perform many refunds in parallel, you may get an HTTP 503 Service unavailable error. In this case, you can be certain the refund was not performed and you can safely retry the refund.
If there is a connection issue during the creation of a refund (e.g. a client-side time out is triggered) you should not retry automatically as you cannot be sure the refund has been performed or not. In this case we suggest logging into the Mollie Dashboard, or retrieving the payment’s refunds via the API to validate if the refund has been created.
paymentId - the payment id for the payment that needs to be refundedbody - RefundRequest objectMollieException - when something went wrongpublic RefundResponse createRefund(String paymentId, RefundRequest body, QueryParams params) throws MollieException
Refunds are not available at all for Bitcoin, paysafecard and gift cards. If you need to refund direct debit payments, please contact our support department.
Refunds support descriptions, which we will show in the Dashboard, your exports and pass to your customer if possible.
If you have insufficient balance with Mollie to perform the refund, the refund will be queued. We will automatically process the refund once your balance increases.
Any payments created for Orders can also be refunded using the Payment Refunds API. However, we recommend using the Order Refund API in those cases so you can pass the order lines you are refunding too. For pay after delivery methods, this is mandatory.
Possible errors¶ Sometimes a situation can occur in which it is not possible to perform the refund. In such cases an HTTP 4xx error will be returned. Some of these situations are illustrated here:
There might not be enough balance on your account with the payment provider (e.g. PayPal). You may have forgotten to grant the appropriate rights to Mollie for the payment provider (PayPal only). It is possible that the payment has already been (partially) refunded. It is not always possible to do a partial refund. If you perform many refunds in parallel, you may get an HTTP 503 Service unavailable error. In this case, you can be certain the refund was not performed and you can safely retry the refund.
If there is a connection issue during the creation of a refund (e.g. a client-side time out is triggered) you should not retry automatically as you cannot be sure the refund has been performed or not. In this case we suggest logging into the Mollie Dashboard, or retrieving the payment’s refunds via the API to validate if the refund has been created.
paymentId - the payment id for the payment that needs to be refundedbody - RefundRequest objectparams - A map of query paramsMollieException - when something went wrongpublic RefundResponse getRefund(String paymentId, String refundId) throws MollieException
paymentId - the payment id for of the refundrefundId - the refund idMollieException - when something went wrongpublic RefundResponse getRefund(String paymentId, String refundId, QueryParams params) throws MollieException
paymentId - the payment id for of the refundrefundId - the refund idparams - A map of query paramsMollieException - when something went wrongpublic void cancelRefund(String paymentId, String refundId) throws MollieException
The refund can only be canceled while the refund’s status field is either queued or pending. See Get payment refund for more information.
paymentId - the payment id off the refundrefundId - the refund idMollieException - when something went wrongpublic void cancelRefund(String paymentId, String refundId, QueryParams params) throws MollieException
The refund can only be canceled while the refund’s status field is either queued or pending. See Get payment refund for more information.
paymentId - the payment id off the refundrefundId - the refund idparams - A map of query paramsMollieException - when something went wrongpublic Pagination<RefundListResponse> listRefunds() throws MollieException
only refunds for the corresponding website profile and mode are returned.
The results are paginated
MollieException - when something went wrongpublic Pagination<RefundListResponse> listRefunds(QueryParams params) throws MollieException
only refunds for the corresponding website profile and mode are returned.
The results are paginated
params - A map of query paramsMollieException - when something went wrongpublic Pagination<RefundListResponse> listRefunds(String paymentId) throws MollieException
only refunds for that specific payment are returned.
The results are paginated
paymentId - a payment idMollieException - when something went wrongpublic Pagination<RefundListResponse> listRefunds(String paymentId, QueryParams params) throws MollieException
only refunds for that specific payment are returned.
The results are paginated
paymentId - a payment idparams - A map of query paramsMollieException - when something went wrongCopyright © 2020. All rights reserved.