Class PayPalRefundRequest
java.lang.Object
org.broadleafcommerce.vendor.paypal.service.payment.AbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest>
org.broadleafcommerce.vendor.paypal.service.payment.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, specify
RefundRequest.amount(Money), otherwise the refund request may be empty (but not null).-
Constructor Summary
ConstructorsConstructorDescriptionPayPalRefundRequest(PayPalClientProvider clientProvider, org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequest, com.paypal.payments.RefundRequest refundRequest, String captureId) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.paypal.payments.CapturesRefundRequestMethod to build outAbstractPayPalRequest.requestand provide it the implementation-specific configuration such as headers and request body.protected AbstractPayPalResponse<com.paypal.payments.Refund>Executes the configuredAbstractPayPalRequest.requestusing thePayPalHttpClient.protected Stringprotected com.paypal.payments.RefundRequestprotected booleanImplementation specific determination of whether the request can be executed.Methods inherited from class org.broadleafcommerce.vendor.paypal.service.payment.AbstractPayPalRequest
configureRequest, execute, getClient, getClientProvider, getPaymentRequest, getRequest, isExecuted, isValid
-
Constructor Details
-
PayPalRefundRequest
public PayPalRefundRequest(PayPalClientProvider clientProvider, org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequest, com.paypal.payments.RefundRequest refundRequest, String captureId)
-
-
Method Details
-
buildRequest
protected com.paypal.payments.CapturesRefundRequest buildRequest()Description copied from class:AbstractPayPalRequestMethod to build outAbstractPayPalRequest.requestand provide it the implementation-specific configuration such as headers and request body.- Specified by:
buildRequestin classAbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest> - Returns:
- The configured request
-
executeInternal
Description copied from class:AbstractPayPalRequestExecutes the configuredAbstractPayPalRequest.requestusing thePayPalHttpClient.- Specified by:
executeInternalin classAbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest> - Returns:
- The response from PayPal.
- Throws:
IOException- Thrown if the request execution fails.
-
isValidInternal
protected boolean isValidInternal()Description copied from class:AbstractPayPalRequestImplementation specific determination of whether the request can be executed.- Specified by:
isValidInternalin classAbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest> - Returns:
- Whether the request can be executed or is in an erroneous state.
-
getCaptureId
-
getRefundRequest
protected com.paypal.payments.RefundRequest getRefundRequest()
-