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 Constructor Description PayPalCheckoutApiProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getAdditionalCustomFields()
The Paypal NVP API only allows a single field with custom logic in it: PAYMENTREQUEST_n_CUSTOM.String
getBnCode()
The attribution code to attach to each request against the PayPal REST APIs.String
getClientId(String applicationId, String tenantId)
Gathers the configured PayPal client id based on the provided context attributes.String
getClientSecret(String applicationId, String tenantId)
Gathers the configured PayPal client secret based on the provided context attributes.String
getEnvironment()
Identifies whether production ("live") or non-production/test ("sandbox") transactions should be made.List<String>
getInvalidPaymentMethodDeclineCodes()
The list of transaction failure codes that should be considered a form of payment method decline.String
getOAuth2ClientTokenUrl(String applicationId, String tenantId)
List<String>
getPaymentDeclineCodes()
The list of transaction failure codes that should be considered a form of payment decline.String
getPaymentDescription(String applicationId, String tenantId)
Gathers the configured PayPal payment description based on the provided context attributes.String
getTotalType()
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
setBnCode(String bnCode)
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.
-
-
-
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 IDtenantId
- 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 IDtenantId
- 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 IDtenantId
- 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" 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
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" 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.
-
-