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

    • urlResolver

      protected org.broadleafcommerce.common.web.BaseUrlResolver urlResolver
    • propertiesService

      @Autowired protected org.broadleafcommerce.common.config.service.SystemPropertiesService propertiesService
    • failureReportingThreshold

      protected int failureReportingThreshold
    • performAuthorizeAndCapture

      protected boolean performAuthorizeAndCapture
  • Constructor Details

    • PayPalCheckoutConfigurationImpl

      public PayPalCheckoutConfigurationImpl()
  • Method Details

    • getReturnUrl

      public String getReturnUrl()
      Description copied from interface: PayPalCheckoutConfiguration
      URL to which the buyer's browser is returned after choosing to pay with PayPal. For digital goods, you must add JavaScript to this page to close the in-context experience. Note: PayPal recommends that the value be the final review page on which the buyer confirms the order and payment or billing agreement. Character length and limitations: 2048 single-byte characters
      Specified by:
      getReturnUrl in interface PayPalCheckoutConfiguration
      Returns:
      String
    • getCancelUrl

      public String getCancelUrl()
      Description copied from interface: PayPalCheckoutConfiguration
      URL to which the buyer is returned if the buyer does not approve the use of PayPal to pay you. For digital goods, you must add JavaScript to this page to close the in-context experience. Note: PayPal recommends that the value be the original page on which the buyer chose to pay with PayPal or establish a billing agreement. Character length and limitations: 2048 single-byte characters
      Specified by:
      getCancelUrl in interface PayPalCheckoutConfiguration
      Returns:
    • getWebProfileId

      public String getWebProfileId()
      Description copied from interface: PayPalCheckoutConfiguration
      Gets the the property driven id of the WebProfile to be used when creating payments. For more information on WebProfiles go to {@link https://developer.paypal.com/docs/integration/direct/payment-experience/} PayPalWebProfileService#getWebProfileId() should be used instead if you want to find the web profile id to create a payment since it has the ability to create new WebProfiles based on injected beans along with using this method
      Specified by:
      getWebProfileId in interface PayPalCheckoutConfiguration
      Returns:
    • getPaymentDescription

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

      public String getSmartPaymentEnvironment()
      Specified by:
      getSmartPaymentEnvironment in interface PayPalCheckoutConfiguration
    • getShippingDisplayType

      public PayPalShippingDisplayType getShippingDisplayType()
      Description copied from interface: PayPalCheckoutConfiguration
      For digital goods, this field is required and must be set to 1. 0 - PayPal displays the shipping address passed in. 1 - PayPal does not display the shipping fields at all. (Default) 2 - PayPal will obtain the shipping address from the buyer's profile.
      Specified by:
      getShippingDisplayType in interface PayPalCheckoutConfiguration
      Returns:
      PayPalShippingDisplayType
    • 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
    • getCheckoutRestClientId

      public String getCheckoutRestClientId()
      Specified by:
      getCheckoutRestClientId in interface PayPalCheckoutConfiguration
    • getCheckoutRestSecret

      public String getCheckoutRestSecret()
      Specified by:
      getCheckoutRestSecret in interface PayPalCheckoutConfiguration
    • getCheckoutRestMode

      public String getCheckoutRestMode()
      Specified by:
      getCheckoutRestMode 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