virtual CartExtension.CheckoutPlaceOrder
Entry point for the Cart validations during the Place Order Actions API. The Salesforce app will call the validate method when starting Place Order Actions API validations. To implement custom validation orchestration and handling logic, extend this class and override the validate method.
Default constructor
Calls specific validation that validates the given cart. Can be overridden with custom logic. To access the overridden method, call super.validate(). Returns PlaceOrderResponse.
| Param | Description |
|---|---|
PlaceOrderRequest | The CartExtension.PlaceOrderRequest to act on. |
domainList | A list of domain names to validate against. Supported values are: TAXES, PRICING, PROMOTIONS, SHIPPING. |
Key considerations for using the CheckoutPlaceOrder extension:
- Trigger Custom Validation Messages — To display a validation message to a buyer, merchants must throw a custom exception whose class name includes
PlaceOrderValidationExceptionand provide the corresponding message in the exception. The message is displayed to the buyer exactly as defined. Merchants are expected to handle localization, ensuring that the message is translated appropriately for the buyer’s locale. - Single Callout Restriction — Only one external HTTP callout is supported per Apex transaction.
- Supported APIs — This implementation is supported only with the enhanced Place Order Actions API. It isn’t supported with the Checkout Orders API.
- No DML or Asynchronous Processing — DML operations and asynchronous processing mechanisms, including @future, Queueable, and other async Apex calls, aren't permitted due to Apex runtime constraints.
- Cart Validation Only — This implementation supports validation of the specified cart only. Modifications to the Cart (WebCart) object within the Apex execution context aren't supported, including INSERT, UPDATE, and DELETE operations.
See Also