Class ExternalCallPayPalCheckoutServiceImpl

java.lang.Object
org.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall<PayPalRequest,PayPalResponse>
org.broadleafcommerce.payment.service.gateway.ExternalCallPayPalCheckoutServiceImpl
All Implemented Interfaces:
org.broadleafcommerce.common.payment.service.FailureCountExposable, org.broadleafcommerce.common.vendor.service.monitor.ServiceStatusDetectable<PayPalRequest>, ExternalCallPayPalCheckoutService

@Service("blExternalCallPayPalCheckoutService") public class ExternalCallPayPalCheckoutServiceImpl extends org.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall<PayPalRequest,PayPalResponse> implements ExternalCallPayPalCheckoutService
Author:
Elbert Bautista (elbertbautista)
  • Field Details

  • Constructor Details

    • ExternalCallPayPalCheckoutServiceImpl

      public ExternalCallPayPalCheckoutServiceImpl()
  • Method Details

    • getConfiguration

      public PayPalCheckoutConfiguration getConfiguration()
      Specified by:
      getConfiguration in interface ExternalCallPayPalCheckoutService
    • setCommonDetailsResponse

      public void setCommonDetailsResponse(AgreementToken response, org.broadleafcommerce.common.payment.dto.PaymentResponseDTO responseDTO, org.broadleafcommerce.common.money.Money amount, String orderId, boolean checkoutComplete)
      Specified by:
      setCommonDetailsResponse in interface ExternalCallPayPalCheckoutService
    • setCommonDetailsResponse

      public void setCommonDetailsResponse(com.paypal.api.payments.Payment response, org.broadleafcommerce.common.payment.dto.PaymentResponseDTO responseDTO)
      Description copied from interface: ExternalCallPayPalCheckoutService
      Converts a PayPal payment into a PaymentResponseDTO
      Specified by:
      setCommonDetailsResponse in interface ExternalCallPayPalCheckoutService
      Parameters:
      response - A PayPal payment that should be used to be converted into a PaymentResponseDTO
      responseDTO - The response dto that should be used to copy information from the PayPal payment
    • getPayPalShippingAddress

      public com.paypal.api.payments.ShippingAddress getPayPalShippingAddress(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO)
      Specified by:
      getPayPalShippingAddress in interface ExternalCallPayPalCheckoutService
    • getPayPalItemListFromOrder

      public com.paypal.api.payments.ItemList getPayPalItemListFromOrder(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO, boolean shouldPopulateShipping)
      Specified by:
      getPayPalItemListFromOrder in interface ExternalCallPayPalCheckoutService
    • getPayPalAmountFromOrder

      public com.paypal.api.payments.Amount getPayPalAmountFromOrder(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO)
      Specified by:
      getPayPalAmountFromOrder in interface ExternalCallPayPalCheckoutService
    • getServiceName

      public String getServiceName()
      Specified by:
      getServiceName in interface org.broadleafcommerce.common.vendor.service.monitor.ServiceStatusDetectable<PayPalRequest>
    • call

      public PayPalResponse call(PayPalRequest paymentRequest) throws org.broadleafcommerce.common.vendor.service.exception.PaymentException
      Description copied from interface: ExternalCallPayPalCheckoutService
      Makes a request to PayPal
      Specified by:
      call in interface ExternalCallPayPalCheckoutService
      Parameters:
      paymentRequest - The payment request that should be executed. The operation that is executed is depedent on which implementation of PayPalRequest is sent
      Returns:
      the respective PayPalResponse that corresponds to the given PayPalRequest
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException
    • communicateWithVendor

      public PayPalResponse communicateWithVendor(PayPalRequest paymentRequest) throws Exception
      Specified by:
      communicateWithVendor in class org.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall<PayPalRequest,PayPalResponse>
      Throws:
      Exception
    • getFailureReportingThreshold

      public Integer getFailureReportingThreshold()
      Specified by:
      getFailureReportingThreshold in interface org.broadleafcommerce.common.payment.service.FailureCountExposable
      Specified by:
      getFailureReportingThreshold in class org.broadleafcommerce.common.payment.service.AbstractExternalPaymentGatewayCall<PayPalRequest,PayPalResponse>
    • constructAPIContext

      public com.paypal.base.rest.APIContext constructAPIContext(org.broadleafcommerce.common.payment.dto.PaymentRequestDTO paymentRequestDTO)
      Specified by:
      constructAPIContext in interface ExternalCallPayPalCheckoutService