Interface PayPalOrderService
- All Known Implementing Classes:
DefaultPayPalOrderService
public interface PayPalOrderService
Defines a service as supporting create and update actions for
Orders.- Author:
- Nathan Moore
-
Method Summary
Modifier and TypeMethodDescriptioncreatePayPalOrder(@NonNull OrderRequest order, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Creates a PayPalOrder.createPayPalOrder(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, boolean performCheckoutOnReturn, boolean capture) Creates a PayPalOrder.fetchPayPalOrder(@NonNull String payPalOrderId, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Fetches a PayPalOrder.voidupdateOrderCustomId(String orderId, String customId, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Updates the PayPalOrderto include the provided custom ID value.voidupdatePayPalOrder(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Updates the PayPalOrderto be in sync with the Broadleaf order.
-
Method Details
-
createPayPalOrder
Order createPayPalOrder(@NonNull @NonNull OrderRequest order, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Creates a PayPalOrder.- Parameters:
order- TheOrderRequestcontaining the information to send to PayPalpaymentRequest- The gatewayPaymentRequestcontaining the information necessary to help build the order- Returns:
- The new
Order - Throws:
com.broadleafcommerce.paymentgateway.service.exception.PaymentException- if thePayPalCreateOrderRequestreturns an exception once executed. This could be because the initial request is configured invalidly or because the PayPal APIs responded with an error.- Since:
- Micro PayPal 3.0.2
-
fetchPayPalOrder
Order fetchPayPalOrder(@NonNull @NonNull String payPalOrderId, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Fetches a PayPalOrder.- Parameters:
payPalOrderId- PayPal's order IDpaymentRequest- The gatewayPaymentRequestcontaining the information necessary to retrieve the order- Returns:
- The existing
Order - Throws:
com.broadleafcommerce.paymentgateway.service.exception.PaymentException- if the request returns an exception once executed. This could be because the PayPal APIs responded with an error.- Since:
- Micro PayPal 3.0.2
-
createPayPalOrder
Order createPayPalOrder(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, boolean performCheckoutOnReturn, boolean capture) Creates a PayPalOrder.- Parameters:
paymentRequest- The gatewayPaymentRequestcontaining the information necessary to construct the orderperformCheckoutOnReturn- Indicates if we should start checkout after the user has authorized the order- Returns:
- The new
Order - Throws:
com.broadleafcommerce.paymentgateway.service.exception.PaymentException- if thePayPalCreateOrderRequestreturns an exception once executed. This could be because the initial request is configured invalidly or because the PayPal APIs responded with an error.
-
updatePayPalOrder
void updatePayPalOrder(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Updates the PayPalOrderto be in sync with the Broadleaf order.Our default implementation of this method updates the pricing information in the PayPal order after
Ordercreation to keep both order representations in sync. For creating an order usecreatePayPalOrder(PaymentRequest, boolean, boolean).- Parameters:
paymentRequest- The gatewayPaymentRequest- Throws:
com.broadleafcommerce.paymentgateway.service.exception.PaymentException- if thePayPalUpdateOrderRequestreturns an exception once executed. This could be because the initial request is configured invalidly or because the PayPal APIs responded with an error.
-
updateOrderCustomId
void updateOrderCustomId(String orderId, String customId, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) Updates the PayPalOrderto include the provided custom ID value.- Parameters:
orderId- the primary identifier of the PayPalOrdercustomId- the value that is to be stored on the PayPalOrderobjectpaymentRequest- The originatingPaymentRequest- Throws:
com.broadleafcommerce.paymentgateway.service.exception.PaymentException- if thePayPalUpdateOrderRequestreturns an exception once executed. This could be because the initial request is configured invalidly or because the PayPal APIs responded with an error.
-