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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      com.paypal.orders.Order createPayPalOrder​(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, boolean performCheckoutOnReturn, boolean capture)
      Creates a PayPal Order.
      void updateOrderCustomId​(String orderId, String customId, com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Updates the PayPal Order to include the provided custom ID value.
      void updatePayPalOrderForFulfillment​(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
      Updates the PayPal Order to be in sync with the Broadleaf order.
    • Method Detail

      • createPayPalOrder

        com.paypal.orders.Order createPayPalOrder​(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest,
                                                  boolean performCheckoutOnReturn,
                                                  boolean capture)
        Creates a PayPal Order.
        Parameters:
        paymentRequest - The gateway PaymentRequest containing the information necessary to construct the order
        performCheckoutOnReturn - 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 the PayPalCreateOrderRequest returns an exception once executed. This could be because the initial request is configured invalidly or because the PayPal APIs responded with an error.
      • updatePayPalOrderForFulfillment

        void updatePayPalOrderForFulfillment​(com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest)
        Updates the PayPal Order to be in sync with the Broadleaf order. This method should be used when fulfillment or pricing information changes after Order creation. For creating an order use #createPayPalOrder(PaymentRequest, boolean)
        Parameters:
        paymentRequest - The gateway PaymentRequest
        Throws:
        com.broadleafcommerce.paymentgateway.service.exception.PaymentException - if the PayPalUpdateOrderRequest returns 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 PayPal Order to include the provided custom ID value.
        Parameters:
        orderId - the primary identifier of the PayPal Order
        customId - the value that is to be stored on the PayPal Order object
        paymentRequest - The originating PaymentRequest
        Throws:
        com.broadleafcommerce.paymentgateway.service.exception.PaymentException - if the PayPalUpdateOrderRequest returns an exception once executed. This could be because the initial request is configured invalidly or because the PayPal APIs responded with an error.