Extension Point: Order Hold Strategy
Basics
Parameter | Value |
---|---|
Extension Point Key | ORDER_HOLD_STRATEGY |
Extension Point Name | Order Hold Strategy |
Extension Interface | OrderHoldStrategy |
Supports Multiple Extensions? | Yes |
Selector Type | Store |
Available Since | 1.0.0 |
Use Cases
Extensions implementing this Extension Point can optionally return an XPFOrderHold
object indicating the reason why the order relating to the details passed in the context should be held. This will cause the order to go into an ON_HOLD
state until a business user either releases or rejects the order in Commerce Manager.
Methods
evaluate
The evaluate
method is invoked during checkout. It can use data from the context to determine if the order should be held.
Extension Sample
@Extension
@XPFAssignment(extensionPoint = XPFExtensionPointEnum.ORDER_HOLD_STRATEGY, priority = 50)
public class HoldAllOrdersOrderHoldStrategyImpl extends XPFExtensionPointImpl implements OrderHoldStrategy {
private static final String ALL_ORDERS_ARE_CONFIGURED_FOR_HOLD_PROCESSING = "All orders are configured for hold processing";
@Override
public Optional<XPFOrderHold> evaluate(final XPFOrderHoldStrategyContext context) {
return Optional.of(new XPFOrderHold(getPermission(context), ALL_ORDERS_ARE_CONFIGURED_FOR_HOLD_PROCESSING));
}
}