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
    • getServiceName

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

      public <T extends PayPalResponse> T call(PayPalRequest paymentRequest, Class<T> responseType) 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 dependent on which implementation of PayPalRequest is sent
      responseType - The type of the response expected
      Returns:
      the respective PayPalResponse that corresponds to the given responseType
      Throws:
      org.broadleafcommerce.common.vendor.service.exception.PaymentException - if the PayPalRequest returns an exception once executed. This could be because the initial request is configured invalidly or because the PayPal APIs responded with an error.
    • 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>