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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe Paypal NVP API only allows a single field with custom logic in it: PAYMENTREQUEST_n_CUSTOM.The attribution code to attach to each request against the PayPal REST APIs.getClientId
(String applicationId, String tenantId) Gathers the configured PayPal client id based on the provided context attributes.getClientSecret
(String applicationId, String tenantId) Gathers the configured PayPal client secret based on the provided context attributes.Identifies whether production ("live") or non-production/test ("sandbox") transactions should be made.The list of transaction failure codes that should be considered a form of payment method decline.getOAuth2ClientTokenUrl
(String applicationId, String tenantId) The list of transaction failure codes that should be considered a form of payment decline.getPaymentDescription
(String applicationId, String tenantId) Gathers the configured PayPal payment description based on the provided context attributes.Type declaration for the label to be displayed in MiniCart for UX.void
setAdditionalCustomFields
(Map<String, String> additionalCustomFields) The Paypal NVP API only allows a single field with custom logic in it: PAYMENTREQUEST_n_CUSTOM.void
The attribution code to attach to each request against the PayPal REST APIs.void
setClientId
(String clientId) The client id provided by PayPal that is used in API calls to identify the charging company/entity.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.void
setEnvironment
(String environment) Identifies whether production ("live") or non-production/test ("sandbox") transactions should be made.void
setInvalidPaymentMethodDeclineCodes
(List<String> invalidPaymentMethodDeclineCodes) The list of transaction failure codes that should be considered a form of payment method decline.void
setOauth2ClientTokenUrl
(String oauth2ClientTokenUrl) The URL to get the auth token.void
setPaymentDeclineCodes
(List<String> paymentDeclineCodes) The list of transaction failure codes that should be considered a form of payment decline.void
setPaymentDescription
(String paymentDescription) Simple description of the entity that is charging the customer.void
setTotalType
(String totalType) Type declaration for the label to be displayed in MiniCart for UX.Methods inherited from class com.broadleafcommerce.paymentgateway.properties.DiscriminatedProperties
getApplication, getField, getTenant, setApplication, setTenant
-
Constructor Details
-
PayPalCheckoutApiProperties
public PayPalCheckoutApiProperties()
-
-
Method Details
-
getClientId
Gathers the configured PayPal client id based on the provided context attributes.- Parameters:
applicationId
- the application IDtenantId
- the tenant ID- Returns:
- The configured PayPal client id
-
getClientSecret
Gathers the configured PayPal client secret based on the provided context attributes.- Parameters:
applicationId
- the application IDtenantId
- the tenant ID- Returns:
- The configured PayPal client secret
-
getOAuth2ClientTokenUrl
-
getPaymentDescription
Gathers the configured PayPal payment description based on the provided context attributes.- Parameters:
applicationId
- the application IDtenantId
- the tenant ID- Returns:
- The configured PayPal payment description
-
setEnvironment
Identifies whether production ("live") or non-production/test ("sandbox") transactions should be made.- See Also:
-
setClientId
The client id provided by PayPal that is used in API calls to identify the charging company/entity. -
setClientSecret
The client secret provided by PayPal that is used in API calls to verify the applications usage of the client id. -
setOauth2ClientTokenUrl
The URL to get the auth token. -
setBnCode
The attribution code to attach to each request against the PayPal REST APIs. -
setPaymentDescription
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
Type declaration for the label to be displayed in MiniCart for UX. It is one of the following values: - Total - EstimatedTotal -
setPaymentDeclineCodes
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
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
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" wheretrue
is the value ofPaymentRequest.isCompleteCheckoutOnCallback()
. So, the minimum string that will be contained in the custom field isccoc=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
Identifies whether production ("live") or non-production/test ("sandbox") transactions should be made.- See Also:
-
getBnCode
The attribution code to attach to each request against the PayPal REST APIs. -
getTotalType
Type declaration for the label to be displayed in MiniCart for UX. It is one of the following values: - Total - EstimatedTotal -
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
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
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" wheretrue
is the value ofPaymentRequest.isCompleteCheckoutOnCallback()
. So, the minimum string that will be contained in the custom field isccoc=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.
-