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.getMerchantId(String applicationId, String tenantId) Gathers the configured PayPal merchant ID based on the provided context attributes.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.booleanisPopulateItemsOnOrder(String applicationId, String tenantId) Whether thePurchaseUnit.getItems()should be populated if they're already known when the PayPalOrderis created or updated.booleanisPopulateShippingOnOrder(String applicationId, String tenantId) Whether thePurchaseUnit.getShippingDetail()should be populated if it's already known when the PayPalOrderis created or updated.voidsetAdditionalCustomFields(Map<String, String> additionalCustomFields) The Paypal NVP API only allows a single field with custom logic in it: PAYMENTREQUEST_n_CUSTOM.voidThe attribution code to attach to each request against the PayPal REST APIs.voidsetClientId(String clientId) The client id provided by PayPal that is used in API calls to identify the charging company/entity.voidsetClientSecret(String clientSecret) The client secret provided by PayPal that is used in API calls to verify the applications usage of the client id.voidsetEnvironment(String environment) Identifies whether production ("live") or non-production/test ("sandbox") transactions should be made.voidsetInvalidPaymentMethodDeclineCodes(List<String> invalidPaymentMethodDeclineCodes) The list of transaction failure codes that should be considered a form of payment method decline.voidsetMerchantId(String merchantId) The Account ID, also known as the Partner-Merchant-Id or PayPal Merchant ID in the PayPal dashboard.voidsetOauth2ClientTokenUrl(String oauth2ClientTokenUrl) The URL to get the auth token.voidsetPaymentDeclineCodes(List<String> paymentDeclineCodes) The list of transaction failure codes that should be considered a form of payment decline.voidsetPaymentDescription(String paymentDescription) Simple description of the entity that is charging the customer.voidsetPopulateItemsOnOrder(boolean populateItemsOnOrder) Whether thePurchaseUnit.getItems()should be populated if they're already known when the PayPalOrderis created or updated.This should be true if settingshipping_preferencetoSET_PROVIDED_ADDRESSin the frontend.voidsetPopulateShippingOnOrder(boolean populateShippingOnOrder) Whether thePurchaseUnit.getShippingDetail()should be populated if it's already known when the PayPalOrderis created or updated.voidsetTotalType(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
-
getMerchantId
Gathers the configured PayPal merchant ID based on the provided context attributes.- Parameters:
applicationId- the application IDtenantId- the tenant ID- Returns:
- The configured PayPal merchant ID
-
isPopulateShippingOnOrder
Whether thePurchaseUnit.getShippingDetail()should be populated if it's already known when the PayPalOrderis created or updated.- Parameters:
applicationId- the application IDtenantId- 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
Whether thePurchaseUnit.getItems()should be populated if they're already known when the PayPalOrderis created or updated.- Parameters:
applicationId- the application IDtenantId- 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
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. -
setMerchantId
The Account ID, also known as the Partner-Merchant-Id or PayPal Merchant ID in the PayPal dashboard. -
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
-
setPopulateShippingOnOrder
public void setPopulateShippingOnOrder(boolean populateShippingOnOrder) Whether thePurchaseUnit.getShippingDetail()should be populated if it's already known when the PayPalOrderis created or updated. This should be true if settingshipping_preferencetoSET_PROVIDED_ADDRESSin the frontend.- Since:
- PayPal 3.0.3, Release Train 2.2.2
-
setPopulateItemsOnOrder
public void setPopulateItemsOnOrder(boolean populateItemsOnOrder) Whether thePurchaseUnit.getItems()should be populated if they're already known when the PayPalOrderis created or updated.This should be true if settingshipping_preferencetoSET_PROVIDED_ADDRESSin the frontend.- Since:
- PayPal 3.0.3, Release Train 2.2.2
-
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=value3Note 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" wheretrueis 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=value3Note 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" wheretrueis 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.
-