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