Extension Point Framework Release Notes
Learn about Extension Point Framework releases.
1.3.2.af519b3d67
Released: June 2024
New in this release
Shopping Cart Events extension point
A new extension point has been added that notifies an extension when shopping cart events occur.
For more information, see Shopping Cart Events extension point.
Shopping Cart Line Item Events extension point
A new extension point has been added that notifies an extension when shopping cart line item events occur.
For more information, see Shopping Cart Item Events extension point
Customer Events extension point
A new extension point has been added that notifies an extension when customer events occur.
For more information, see Customer Events extension point.
Order Release Events extension point
A new extension point has been added that notifies an extension when an order is released and ready to be sent to the fulfillment system.
For more information, see Order Release Events extension point.
Lazy loaded fields are now excluded from all equals, hashcode, and toString methods on XPF entity classes
All lazy loaded fields (those with the @LazyLoaded annotation) are now configured to be excluded from the equals, hashcode, and toString implementations generated by Lombok. This means that lazy loaded fields won't be unintentionally invoked when these methods are called.
Added new convenience method for retrieving a single setting value
Often Extension Point Framework plugins will have single-valued settings that need to be retrieved within the plugin implementation. These setting values are defined in extensions.json or plugins.json.
A lot of boilerplate code can be required to retrieve these setting values because developers need to verify that the setting exists, that the setting value exists, and then retrieve the first value from the collection. Now, this is all taken care of automatically by the new getSingleSettingValue(String settingKey) method on the plugin context. See the following example:
Optional<XPFPluginSettingValue> apiKeySettingValue = SegmentPlugin.getInstance().getContext().getSingleSettingValue("api_key");
Added payment details to order hold strategies context so hold decisions can be made based on payment details
The XPFOrderHoldStrategyContext class now contains a set of XPFPayment objects so order hold strategy extensions can access details about the payment reservations and make decisions about whether to hold the order. A common use case for this is to use fraud score details from the payment gateway to decide if the order should be held for manual review.
As an example, if the payment plugins populate a data field called fraudScore, then an extension class could implement OrderHoldStrategy as follows:
@Override
public Optional<XPFOrderHold> evaluate(final XPFOrderHoldStrategyContext context) {
Optional<Double> fraudScore = context.getPayments().stream()
.map(xpfPayment -> Double.valueOf(xpfPayment.getPaymentData().get("fraudScore")))
.findFirst();
if (fraudScore.isPresent() && fraudScore.get() > FRAUD_THRESHOLD) {
XPFOrderHold orderHold = new XPFOrderHold();
orderHold.setHoldDescription("Fraud score of " + fraudScore.get() + " exceeds threshold of " + FRAUD_THRESHOLD);
return Optional.of(orderHold);
}
return Optional.empty();
}