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 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: AbstractPayPalRequest
      Method to build out AbstractPayPalRequest.request and provide it the implementation-specific configuration such as headers and request body.
      Specified by:
      buildRequest in class AbstractPayPalRequest<com.paypal.payments.Refund,com.paypal.payments.CapturesRefundRequest>
      Returns:
      The configured request
    • executeInternal

      protected AbstractPayPalResponse<com.paypal.payments.Refund> executeInternal() throws IOException
      Description copied from class: AbstractPayPalRequest
      Executes the configured AbstractPayPalRequest.request using the PayPalHttpClient.
      Specified by:
      executeInternal in class AbstractPayPalRequest<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: AbstractPayPalRequest
      Implementation specific determination of whether the request can be executed.
      Specified by:
      isValidInternal in class AbstractPayPalRequest<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()