Class PayPalCheckoutConfigurationImpl
- All Implemented Interfaces:
org.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration,PayPalCheckoutConfiguration
- Author:
- Elbert Bautista (elbertbautista)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected booleanprotected org.broadleafcommerce.common.config.service.SystemPropertiesServiceprotected org.broadleafcommerce.common.web.BaseUrlResolver -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSee the PayPal API to see what additional configs you can set: https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/The Paypal NVP API only allows a single field with custom logic in it: PAYMENTREQUEST_n_CUSTOM.URL to which the buyer is returned if the buyer does not approve the use of PayPal to pay you.intorg.broadleafcommerce.common.payment.PaymentGatewayTypeURL to which the buyer's browser is returned after choosing to pay with PayPal.For digital goods, this field is required and must be set to 1.Type declaration for the label to be displayed in MiniCart for UX.Gets the the property driven id of the WebProfile to be used when creating payments.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidsetFailureReportingThreshold(int failureReportingThreshold) voidsetPerformAuthorizeAndCapture(boolean performAuthorizeAndCapture)
-
Field Details
-
urlResolver
protected org.broadleafcommerce.common.web.BaseUrlResolver urlResolver -
propertiesService
@Autowired protected org.broadleafcommerce.common.config.service.SystemPropertiesService propertiesService -
failureReportingThreshold
protected int failureReportingThreshold -
performAuthorizeAndCapture
protected boolean performAuthorizeAndCapture
-
-
Constructor Details
-
PayPalCheckoutConfigurationImpl
public PayPalCheckoutConfigurationImpl()
-
-
Method Details
-
getReturnUrl
Description copied from interface:PayPalCheckoutConfigurationURL to which the buyer's browser is returned after choosing to pay with PayPal. For digital goods, you must add JavaScript to this page to close the in-context experience. Note: PayPal recommends that the value be the final review page on which the buyer confirms the order and payment or billing agreement. Character length and limitations: 2048 single-byte characters- Specified by:
getReturnUrlin interfacePayPalCheckoutConfiguration- Returns:
- String
-
getCancelUrl
Description copied from interface:PayPalCheckoutConfigurationURL to which the buyer is returned if the buyer does not approve the use of PayPal to pay you. For digital goods, you must add JavaScript to this page to close the in-context experience. Note: PayPal recommends that the value be the original page on which the buyer chose to pay with PayPal or establish a billing agreement. Character length and limitations: 2048 single-byte characters- Specified by:
getCancelUrlin interfacePayPalCheckoutConfiguration- Returns:
-
getWebProfileId
Description copied from interface:PayPalCheckoutConfigurationGets the the property driven id of the WebProfile to be used when creating payments. For more information on WebProfiles go to {@link https://developer.paypal.com/docs/integration/direct/payment-experience/}PayPalWebProfileService#getWebProfileId()should be used instead if you want to find the web profile id to create a payment since it has the ability to create new WebProfiles based on injected beans along with using this method- Specified by:
getWebProfileIdin interfacePayPalCheckoutConfiguration- Returns:
-
getPaymentDescription
- Specified by:
getPaymentDescriptionin interfacePayPalCheckoutConfiguration
-
getSmartPaymentEnvironment
- Specified by:
getSmartPaymentEnvironmentin interfacePayPalCheckoutConfiguration
-
getShippingDisplayType
Description copied from interface:PayPalCheckoutConfigurationFor digital goods, this field is required and must be set to 1. 0 - PayPal displays the shipping address passed in. 1 - PayPal does not display the shipping fields at all. (Default) 2 - PayPal will obtain the shipping address from the buyer's profile.- Specified by:
getShippingDisplayTypein interfacePayPalCheckoutConfiguration- Returns:
- PayPalShippingDisplayType
-
getTotalType
Description copied from interface:PayPalCheckoutConfigurationType declaration for the label to be displayed in MiniCart for UX. It is one of the following values: - Total - EstimatedTotal- Specified by:
getTotalTypein interfacePayPalCheckoutConfiguration- Returns:
- String
-
getAdditionalConfig
Description copied from interface:PayPalCheckoutConfigurationSee the PayPal API to see what additional configs you can set: https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/
e.g. Map<String, String> additionalConfigs = new HashMap<String, String>(); additionalConfigs.put("HDRBORDERCOLOR", "FFFFFF"); additionalConfigs.put("HDRBACKCOLOR", "FFFFFF"); additionalConfigs.put("PAYFLOWCOLOR", "FFFFFF");
This adds additional NVP items to the Paypal request that are ONLY pre-specified in the Paypal API docs. Any other fields will be ignored. If you want to use completely custom fields, see
PayPalCheckoutConfiguration.getAdditionalCustomFields()- Specified by:
getAdditionalConfigin interfacePayPalCheckoutConfiguration- Returns:
- Map
-
getAdditionalCustomFields
Description copied from interface:PayPalCheckoutConfigurationThe 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" where
trueis the value ofPaymentRequestDTO.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.
- Specified by:
getAdditionalCustomFieldsin interfacePayPalCheckoutConfiguration
-
getCheckoutRestClientId
- Specified by:
getCheckoutRestClientIdin interfacePayPalCheckoutConfiguration
-
getCheckoutRestSecret
- Specified by:
getCheckoutRestSecretin interfacePayPalCheckoutConfiguration
-
getCheckoutRestMode
- Specified by:
getCheckoutRestModein interfacePayPalCheckoutConfiguration
-
handlesAuthorize
public boolean handlesAuthorize()- Specified by:
handlesAuthorizein interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesAuthorizein classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesCapture
public boolean handlesCapture()- Specified by:
handlesCapturein interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesCapturein classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesAuthorizeAndCapture
public boolean handlesAuthorizeAndCapture()- Specified by:
handlesAuthorizeAndCapturein interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesAuthorizeAndCapturein classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesReverseAuthorize
public boolean handlesReverseAuthorize()- Specified by:
handlesReverseAuthorizein interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesReverseAuthorizein classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesVoid
public boolean handlesVoid()- Specified by:
handlesVoidin interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesVoidin classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesRefund
public boolean handlesRefund()- Specified by:
handlesRefundin interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesRefundin classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesPartialCapture
public boolean handlesPartialCapture()- Specified by:
handlesPartialCapturein interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesPartialCapturein classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesMultipleShipment
public boolean handlesMultipleShipment()- Specified by:
handlesMultipleShipmentin interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesMultipleShipmentin classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesRecurringPayment
public boolean handlesRecurringPayment()- Specified by:
handlesRecurringPaymentin interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesRecurringPaymentin classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesSavedCustomerPayment
public boolean handlesSavedCustomerPayment()- Specified by:
handlesSavedCustomerPaymentin interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesSavedCustomerPaymentin classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
isPerformAuthorizeAndCapture
public boolean isPerformAuthorizeAndCapture()- Specified by:
isPerformAuthorizeAndCapturein interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
isPerformAuthorizeAndCapturein classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
setPerformAuthorizeAndCapture
public void setPerformAuthorizeAndCapture(boolean performAuthorizeAndCapture) - Specified by:
setPerformAuthorizeAndCapturein interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
setPerformAuthorizeAndCapturein classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
getFailureReportingThreshold
public int getFailureReportingThreshold()- Specified by:
getFailureReportingThresholdin interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
getFailureReportingThresholdin classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
setFailureReportingThreshold
public void setFailureReportingThreshold(int failureReportingThreshold) - Specified by:
setFailureReportingThresholdin interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
setFailureReportingThresholdin classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
handlesMultiplePayments
public boolean handlesMultiplePayments()- Specified by:
handlesMultiplePaymentsin interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
handlesMultiplePaymentsin classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-
getGatewayType
public org.broadleafcommerce.common.payment.PaymentGatewayType getGatewayType()- Specified by:
getGatewayTypein interfaceorg.broadleafcommerce.common.payment.service.PaymentGatewayConfiguration- Overrides:
getGatewayTypein classorg.broadleafcommerce.common.payment.service.AbstractPaymentGatewayConfiguration
-