Class PayPalCheckoutConfigurationImpl

java.lang.Object
org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
org.broadleafcommerce.payment.service.gateway.PayPalCheckoutConfigurationImpl
All Implemented Interfaces:
org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration, PayPalCheckoutConfiguration

@Service("blPayPalCheckoutConfiguration") public class PayPalCheckoutConfigurationImpl extends org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration implements PayPalCheckoutConfiguration
Author:
Elbert Bautista (elbertbautista)
  • Field Details

    • env

      @Autowired protected org.springframework.core.env.Environment env
    • failureReportingThreshold

      protected int failureReportingThreshold
    • performAuthorizeAndCapture

      protected boolean performAuthorizeAndCapture
  • Constructor Details

    • PayPalCheckoutConfigurationImpl

      public PayPalCheckoutConfigurationImpl()
  • Method Details

    • getPaymentDescription

      public String getPaymentDescription()
      Specified by:
      getPaymentDescription in interface PayPalCheckoutConfiguration
    • getEnvironment

      public String getEnvironment()
      Specified by:
      getEnvironment in interface PayPalCheckoutConfiguration
    • getTotalType

      public String getTotalType()
      Description copied from interface: PayPalCheckoutConfiguration
      Type declaration for the label to be displayed in MiniCart for UX. It is one of the following values: - Total - EstimatedTotal
      Specified by:
      getTotalType in interface PayPalCheckoutConfiguration
      Returns:
      String
    • getAdditionalConfig

      public Map<String,String> getAdditionalConfig()
      Description copied from interface: PayPalCheckoutConfiguration

      See the PayPal API to see what additional configs you can set: https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/

      e.g. Map<String, String> additionalConfigs = new HashMap<String, String>(); additionalConfigs.put("HDRBORDERCOLOR", "FFFFFF"); additionalConfigs.put("HDRBACKCOLOR", "FFFFFF"); additionalConfigs.put("PAYFLOWCOLOR", "FFFFFF");

      This adds additional NVP items to the Paypal request that are ONLY pre-specified in the Paypal API docs. Any other fields will be ignored. If you want to use completely custom fields, see PayPalCheckoutConfiguration.getAdditionalCustomFields()

      Specified by:
      getAdditionalConfig in interface PayPalCheckoutConfiguration
      Returns:
      Map
    • getAdditionalCustomFields

      public Map<String,String> getAdditionalCustomFields()
      Description copied from interface: PayPalCheckoutConfiguration

      The Paypal NVP API only allows a single field with custom logic in it: PAYMENTREQUEST_n_CUSTOM. Because of this, all of the fields returned here are serialized together like so:

       ccoc=true_12345|key1=value1|key2=value2|key3=value3
       

      Note that Broadleaf uses a piece of this to determine if we should complete checkout on callback or not. This is done as "ccoc=true_12345" where true is the value of PaymentRequestDTO.isCompleteCheckoutOnCallback(). So, the minimum string that will be contained in the custom field is ccoc=true_12345, plus whatever other fields you have.

      Also note that the entire custom field string after serialization is 256 characters. An IllegalArgumentException will be thrown otherwise.

      Specified by:
      getAdditionalCustomFields in interface PayPalCheckoutConfiguration
    • getClientId

      public String getClientId()
      Specified by:
      getClientId in interface PayPalCheckoutConfiguration
    • getClientSecret

      public String getClientSecret()
      Specified by:
      getClientSecret in interface PayPalCheckoutConfiguration
    • handlesAuthorize

      public boolean handlesAuthorize()
      Specified by:
      handlesAuthorize in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesAuthorize in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesCapture

      public boolean handlesCapture()
      Specified by:
      handlesCapture in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesCapture in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesAuthorizeAndCapture

      public boolean handlesAuthorizeAndCapture()
      Specified by:
      handlesAuthorizeAndCapture in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesAuthorizeAndCapture in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesReverseAuthorize

      public boolean handlesReverseAuthorize()
      Specified by:
      handlesReverseAuthorize in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesReverseAuthorize in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesVoid

      public boolean handlesVoid()
      Specified by:
      handlesVoid in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesVoid in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesRefund

      public boolean handlesRefund()
      Specified by:
      handlesRefund in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesRefund in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesPartialCapture

      public boolean handlesPartialCapture()
      Specified by:
      handlesPartialCapture in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesPartialCapture in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesMultipleShipment

      public boolean handlesMultipleShipment()
      Specified by:
      handlesMultipleShipment in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesMultipleShipment in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesRecurringPayment

      public boolean handlesRecurringPayment()
      Specified by:
      handlesRecurringPayment in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesRecurringPayment in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesSavedCustomerPayment

      public boolean handlesSavedCustomerPayment()
      Specified by:
      handlesSavedCustomerPayment in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesSavedCustomerPayment in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • isPerformAuthorizeAndCapture

      public boolean isPerformAuthorizeAndCapture()
      Specified by:
      isPerformAuthorizeAndCapture in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      isPerformAuthorizeAndCapture in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • setPerformAuthorizeAndCapture

      public void setPerformAuthorizeAndCapture(boolean performAuthorizeAndCapture)
      Specified by:
      setPerformAuthorizeAndCapture in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      setPerformAuthorizeAndCapture in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • getFailureReportingThreshold

      public int getFailureReportingThreshold()
      Specified by:
      getFailureReportingThreshold in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      getFailureReportingThreshold in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • setFailureReportingThreshold

      public void setFailureReportingThreshold(int failureReportingThreshold)
      Specified by:
      setFailureReportingThreshold in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      setFailureReportingThreshold in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • handlesMultiplePayments

      public boolean handlesMultiplePayments()
      Specified by:
      handlesMultiplePayments in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      handlesMultiplePayments in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
    • getGatewayType

      public org.broadleafcommerce.common.payment.PaymentGatewayType getGatewayType()
      Specified by:
      getGatewayType in interface org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration
      Overrides:
      getGatewayType in class org.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration