Class PayPalCheckoutApiProperties


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

      • PayPalCheckoutApiProperties

        public PayPalCheckoutApiProperties()
    • Method Detail

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

        public void setEnvironment​(String environment)
        Identifies whether production ("live") or non-production/test ("sandbox") transactions should be made.
        See Also:
        PayPalCheckoutEnvironmentType
      • 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.
      • 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
      • 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:
        PayPalCheckoutEnvironmentType
      • 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.