Class PayPalCreateOrderRequest
- java.lang.Object
-
- com.broadleafcommerce.paypal.micro.domain.api.AbstractPayPalRequest<com.paypal.orders.Order,com.paypal.orders.OrdersCreateRequest>
-
- com.broadleafcommerce.paypal.micro.domain.api.PayPalCreateOrderRequest
-
- All Implemented Interfaces:
PayPalRequest
public class PayPalCreateOrderRequest extends AbstractPayPalRequest<com.paypal.orders.Order,com.paypal.orders.OrdersCreateRequest>
-
-
Constructor Summary
Constructors Constructor Description PayPalCreateOrderRequest(PayPalClientProvider clientProvider, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.paypal.orders.OrderRequest orderRequest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.paypal.orders.OrdersCreateRequest
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 com.paypal.orders.OrderRequest
getOrderRequest()
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
-
PayPalCreateOrderRequest
public PayPalCreateOrderRequest(PayPalClientProvider clientProvider, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.paypal.orders.OrderRequest orderRequest)
-
-
Method Detail
-
buildRequest
protected com.paypal.orders.OrdersCreateRequest 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.OrdersCreateRequest>
- 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.OrdersCreateRequest>
- 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.OrdersCreateRequest>
- Returns:
- Whether the request can be executed or is in an erroneous state.
-
getOrderRequest
protected com.paypal.orders.OrderRequest getOrderRequest()
-
-