Class PayPalPaymentServiceImpl

java.lang.Object
org.broadleafcommerce.vendor.paypal.service.PayPalPaymentServiceImpl
All Implemented Interfaces:
PayPalPaymentService

@Service("blPayPalPaymentService") public class PayPalPaymentServiceImpl extends Object implements PayPalPaymentService
  • Field Details

    • externalCallService

      protected ExternalCallPayPalCheckoutService externalCallService
    • webProfileService

      protected PayPalWebProfileService webProfileService
    • currentOrderPaymentRequestService

      @Autowired(required=false) protected org.broadleafcommerce.common.payment.service.CurrentOrderPaymentRequestService currentOrderPaymentRequestService
    • shouldPopulateShippingOnPaymentCreation

      @Value("${gateway.paypal.checkout.rest.populate.shipping.create.payment:true}") protected boolean shouldPopulateShippingOnPaymentCreation
  • Constructor Details

    • PayPalPaymentServiceImpl

      public PayPalPaymentServiceImpl()
  • Method Details

    • createPayPalPaymentForCurrentOrder

      public com.paypal.api.payments.Payment createPayPalPaymentForCurrentOrder(boolean performCheckoutOnReturn) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Description copied from interface: PayPalPaymentService
      Creates a PayPal payment
      Specified by:
      createPayPalPaymentForCurrentOrder in interface PayPalPaymentService
      Parameters:
      performCheckoutOnReturn - Indicates if we should start checkout after the user has authorized the payment
      Returns:
      The new payment
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • constructPayer

      protected com.paypal.api.payments.Payer constructPayer(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO)
    • updatePayPalPaymentForFulfillment

      public void updatePayPalPaymentForFulfillment() throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Description copied from interface: PayPalPaymentService
      Updates the PayPal payment to be in sync with the order. This method should be used when fulfillment or pricing information changes after Payment creation. For creating payment use PayPalPaymentService.createPayPalPaymentForCurrentOrder(boolean)
      Specified by:
      updatePayPalPaymentForFulfillment in interface PayPalPaymentService
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • createPayment

      protected com.paypal.api.payments.Payment createPayment(com.paypal.api.payments.Payment payment, org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • updatePayment

      protected void updatePayment(com.paypal.api.payments.Payment payment, List<com.paypal.api.payments.Patch> patches, org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • getPaymentRequestForCurrentOrder

      protected org.broadleafcommerce.common.payment.dto.PaymentRequestDTO getPaymentRequestForCurrentOrder() throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • getPayPalPaymentIdFromCurrentOrder

      public String getPayPalPaymentIdFromCurrentOrder() throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Specified by:
      getPayPalPaymentIdFromCurrentOrder in interface PayPalPaymentService
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • getPayPalPayerIdFromCurrentOrder

      public String getPayPalPayerIdFromCurrentOrder() throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Specified by:
      getPayPalPayerIdFromCurrentOrder in interface PayPalPaymentService
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • setPayPalPaymentIdOnCurrentOrder

      public void setPayPalPaymentIdOnCurrentOrder(String paymentId) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Specified by:
      setPayPalPaymentIdOnCurrentOrder in interface PayPalPaymentService
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • setPayPalPayerIdOnCurrentOrder

      public void setPayPalPayerIdOnCurrentOrder(String payerId) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Specified by:
      setPayPalPayerIdOnCurrentOrder in interface PayPalPaymentService
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • getIntent

      public String getIntent(boolean performCheckoutOnReturn)