Class PayPalRefundRequest
- java.lang.Object
-
- com.broadleafcommerce.paypal.micro.domain.api.AbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest>
-
- com.broadleafcommerce.paypal.micro.domain.api.PayPalRefundRequest
-
- All Implemented Interfaces:
PayPalRequest
public class PayPalRefundRequest extends AbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest>
Represents a refund request. To partially refund an order, specifyRefundRequest.amount(Money)
, otherwise the refund request may be empty (but not null).
-
-
Constructor Summary
Constructors Constructor Description PayPalRefundRequest(PayPalClientProvider clientProvider, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.paypal.payments.RefundRequest refundRequest, String captureId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.paypal.payments.CapturesRefundRequest
buildRequest()
Method to build outAbstractPayPalRequest.request
and provide it the implementation-specific configuration such as headers and request body.protected AbstractPayPalResponse<com.paypal.payments.Refund>
executeInternal(String applicationId, String tenantId)
Executes the configuredAbstractPayPalRequest.request
using theAbstractPayPalRequest.getClient(String, String)
PayPalHttpClient}.protected String
getCaptureId()
protected com.paypal.payments.RefundRequest
getRefundRequest()
protected boolean
isValidInternal()
Implementation specific determination of whether the request can be executed.-
Methods inherited from class com.broadleafcommerce.paypal.micro.domain.api.AbstractPayPalRequest
configureRequest, execute, executeInternal, getClient, getClient, getClientProvider, getPaymentRequest, getRequest, isExecuted, isValid
-
-
-
-
Constructor Detail
-
PayPalRefundRequest
public PayPalRefundRequest(PayPalClientProvider clientProvider, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.paypal.payments.RefundRequest refundRequest, String captureId)
-
-
Method Detail
-
buildRequest
protected com.paypal.payments.CapturesRefundRequest buildRequest()
Description copied from class:AbstractPayPalRequest
Method to build outAbstractPayPalRequest.request
and provide it the implementation-specific configuration such as headers and request body.- Specified by:
buildRequest
in classAbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest>
- Returns:
- The configured request
-
executeInternal
protected AbstractPayPalResponse<com.paypal.payments.Refund> executeInternal(@Nullable String applicationId, @Nullable String tenantId) throws IOException
Description copied from class:AbstractPayPalRequest
Executes the configuredAbstractPayPalRequest.request
using theAbstractPayPalRequest.getClient(String, String)
PayPalHttpClient}.- Specified by:
executeInternal
in classAbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest>
- Parameters:
applicationId
- the application IDtenantId
- the tenant ID- Returns:
- The response from PayPal
- Throws:
IOException
- Thrown if the request execution fails.
-
isValidInternal
protected boolean isValidInternal()
Description copied from class:AbstractPayPalRequest
Implementation specific determination of whether the request can be executed.- Specified by:
isValidInternal
in classAbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest>
- Returns:
- Whether the request can be executed or is in an erroneous state.
-
getCaptureId
protected String getCaptureId()
-
getRefundRequest
protected com.paypal.payments.RefundRequest getRefundRequest()
-
-