Class PayPalCaptureOrderRequest
- java.lang.Object
-
- com.broadleafcommerce.paypal.micro.domain.api.AbstractPayPalRequest<com.paypal.orders.Order,com.paypal.orders.OrdersCaptureRequest>
-
- com.broadleafcommerce.paypal.micro.domain.api.PayPalCaptureOrderRequest
-
- All Implemented Interfaces:
PayPalRequest
public class PayPalCaptureOrderRequest extends AbstractPayPalRequest<com.paypal.orders.Order,com.paypal.orders.OrdersCaptureRequest>
Request object used to capture an order immediately. To auth the order immediately but capture it later, usePayPalCaptureAuthRequest
.- Author:
- Nathan Moore (nathandmoore)
-
-
Constructor Summary
Constructors Constructor Description PayPalCaptureOrderRequest(PayPalClientProvider clientProvider, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, String orderId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.paypal.orders.OrdersCaptureRequest
buildRequest()
Method to build outAbstractPayPalRequest.request
and provide it the implementation-specific configuration such as headers and request body.protected AbstractPayPalResponse<com.paypal.orders.Order>
executeInternal(String applicationId, String tenantId)
Executes the configuredAbstractPayPalRequest.request
using theAbstractPayPalRequest.getClient(String, String)
PayPalHttpClient}.protected String
getOrderId()
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
-
PayPalCaptureOrderRequest
public PayPalCaptureOrderRequest(PayPalClientProvider clientProvider, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, String orderId)
-
-
Method Detail
-
buildRequest
protected com.paypal.orders.OrdersCaptureRequest 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.orders.Order,com.paypal.orders.OrdersCaptureRequest>
- Returns:
- The configured request
-
executeInternal
protected AbstractPayPalResponse<com.paypal.orders.Order> 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.orders.Order,com.paypal.orders.OrdersCaptureRequest>
- 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.orders.Order,com.paypal.orders.OrdersCaptureRequest>
- Returns:
- Whether the request can be executed or is in an erroneous state.
-
getOrderId
protected String getOrderId()
-
-