Class PayPalCheckoutApiProperties

java.lang.Object
com.broadleafcommerce.paymentgateway.properties.DiscriminatedProperties<PayPalCheckoutApiProperties>
com.broadleafcommerce.paypal.micro.gateway.autoconfigure.PayPalCheckoutApiProperties

@ConfigurationProperties("broadleaf.paypal-checkout.api") public class PayPalCheckoutApiProperties extends com.broadleafcommerce.paymentgateway.properties.DiscriminatedProperties<PayPalCheckoutApiProperties>
Author:
Elbert Bautista (elbertbautista), Chris Kittrell
  • Constructor Details

    • PayPalCheckoutApiProperties

      public PayPalCheckoutApiProperties()
  • Method Details

    • getClientId

      public String getClientId(@Nullable String applicationId, @Nullable String tenantId)
      Gathers the configured PayPal client id based on the provided context attributes.
      Parameters:
      applicationId - the application ID
      tenantId - the tenant ID
      Returns:
      The configured PayPal client id
    • getClientSecret

      public String getClientSecret(@Nullable String applicationId, @Nullable String tenantId)
      Gathers the configured PayPal client secret based on the provided context attributes.
      Parameters:
      applicationId - the application ID
      tenantId - the tenant ID
      Returns:
      The configured PayPal client secret
    • getOAuth2ClientTokenUrl

      public String getOAuth2ClientTokenUrl(@Nullable String applicationId, @Nullable String tenantId)
    • getPaymentDescription

      public String getPaymentDescription(@Nullable String applicationId, @Nullable String tenantId)
      Gathers the configured PayPal payment description based on the provided context attributes.
      Parameters:
      applicationId - the application ID
      tenantId - the tenant ID
      Returns:
      The configured PayPal payment description
    • getMerchantId

      public String getMerchantId(@Nullable String applicationId, @Nullable String tenantId)
      Gathers the configured PayPal merchant ID based on the provided context attributes.
      Parameters:
      applicationId - the application ID
      tenantId - the tenant ID
      Returns:
      The configured PayPal merchant ID
    • isPopulateShippingOnOrder

      public boolean isPopulateShippingOnOrder(@Nullable String applicationId, @Nullable String tenantId)
      Whether the PurchaseUnit.getShippingDetail() should be populated if it's already known when the PayPal Order is created or updated.
      Parameters:
      applicationId - the application ID
      tenantId - the tenant ID
      Returns:
      true if PurchaseUnit.getShippingDetail() should be populated and false otherwise
      Since:
      PayPal 3.0.3, Release Train 2.2.2
    • isPopulateItemsOnOrder

      public boolean isPopulateItemsOnOrder(@Nullable String applicationId, @Nullable String tenantId)
      Whether the PurchaseUnit.getItems() should be populated if they're already known when the PayPal Order is created or updated.
      Parameters:
      applicationId - the application ID
      tenantId - the tenant ID
      Returns:
      true if PurchaseUnit.getItems() should be populated and false otherwise
      Since:
      PayPal 3.0.3, Release Train 2.2.2
    • setEnvironment

      public void setEnvironment(String environment)
      Identifies whether production ("live") or non-production/test ("sandbox") transactions should be made.
      See Also:
    • setClientId

      public void setClientId(String clientId)
      The client id provided by PayPal that is used in API calls to identify the charging company/entity.
    • setClientSecret

      public void setClientSecret(String clientSecret)
      The client secret provided by PayPal that is used in API calls to verify the applications usage of the client id.
    • setOauth2ClientTokenUrl

      public void setOauth2ClientTokenUrl(String oauth2ClientTokenUrl)
      The URL to get the auth token.
    • setBnCode

      public void setBnCode(String bnCode)
      The attribution code to attach to each request against the PayPal REST APIs.
    • setMerchantId

      public void setMerchantId(String merchantId)
      The Account ID, also known as the Partner-Merchant-Id or PayPal Merchant ID in the PayPal dashboard.
    • setPaymentDescription

      public void setPaymentDescription(String paymentDescription)
      Simple description of the entity that is charging the customer. For example, this may read as "My Test Store". Note, this is the transaction description that will be listed on the customer's credit card statement.
    • setTotalType

      public void setTotalType(String totalType)
      Type declaration for the label to be displayed in MiniCart for UX. It is one of the following values: - Total - EstimatedTotal
    • setPaymentDeclineCodes

      public void setPaymentDeclineCodes(List<String> paymentDeclineCodes)
      The list of transaction failure codes that should be considered a form of payment decline. Note: Some failure codes are unclear whether they should be in this list or not. Our intention is that this list represents payment processing failures (ie the transaction was declined by the bank, credit card company, etc.) instead of PayPal's validation errors which would represent a malformed request.
    • setInvalidPaymentMethodDeclineCodes

      public void setInvalidPaymentMethodDeclineCodes(List<String> invalidPaymentMethodDeclineCodes)
      The list of transaction failure codes that should be considered a form of payment method decline. Note: Some failure codes are unclear whether they should be in this list or not. Our intention is that this list represents payment method processing failures (an incorrect card number, expiration date, etc.) instead of PayPal's validation errors which would represent a malformed request.
      See Also:
      • DefaultTransactionFailureTypes.INVALID_PAYMENT_METHOD
    • setPopulateShippingOnOrder

      public void setPopulateShippingOnOrder(boolean populateShippingOnOrder)
      Whether the PurchaseUnit.getShippingDetail() should be populated if it's already known when the PayPal Order is created or updated. This should be true if setting shipping_preference to SET_PROVIDED_ADDRESS in the frontend.
      Since:
      PayPal 3.0.3, Release Train 2.2.2
    • setPopulateItemsOnOrder

      public void setPopulateItemsOnOrder(boolean populateItemsOnOrder)
      Whether the PurchaseUnit.getItems() should be populated if they're already known when the PayPal Order is created or updated.This should be true if setting shipping_preference to SET_PROVIDED_ADDRESS in the frontend.
      Since:
      PayPal 3.0.3, Release Train 2.2.2
    • setAdditionalCustomFields

      public void setAdditionalCustomFields(Map<String,String> additionalCustomFields)
      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 PaymentRequest.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.
    • getEnvironment

      public String getEnvironment()
      Identifies whether production ("live") or non-production/test ("sandbox") transactions should be made.
      See Also:
    • getBnCode

      public String getBnCode()
      The attribution code to attach to each request against the PayPal REST APIs.
    • getTotalType

      public String getTotalType()
      Type declaration for the label to be displayed in MiniCart for UX. It is one of the following values: - Total - EstimatedTotal
    • getPaymentDeclineCodes

      public List<String> getPaymentDeclineCodes()
      The list of transaction failure codes that should be considered a form of payment decline. Note: Some failure codes are unclear whether they should be in this list or not. Our intention is that this list represents payment processing failures (ie the transaction was declined by the bank, credit card company, etc.) instead of PayPal's validation errors which would represent a malformed request.
    • getInvalidPaymentMethodDeclineCodes

      public List<String> getInvalidPaymentMethodDeclineCodes()
      The list of transaction failure codes that should be considered a form of payment method decline. Note: Some failure codes are unclear whether they should be in this list or not. Our intention is that this list represents payment method processing failures (an incorrect card number, expiration date, etc.) instead of PayPal's validation errors which would represent a malformed request.
      See Also:
      • DefaultTransactionFailureTypes.INVALID_PAYMENT_METHOD
    • getAdditionalCustomFields

      public Map<String,String> getAdditionalCustomFields()
      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 PaymentRequest.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.