Checkout Components
Overview
Bloomreach Commerce Accelerator includes components to implement a full checkout process using your e-commerce backend. The Boot application provides Cart, Shipment options, Payment registration, and Order placement components.
Note: Bloomreach Commerce Accelerator does not include integration examples with payment providers. For guidance on specific payment provider integrations, contact Bloomreach.
Components Overview
Checkout components and pages enable customers to add or remove products from their cart, select shipment options, make payments (via integration with payment providers), and place orders. These operations are standard in most e-commerce backends.
The checkout process described here reflects the default flow in the Bloomreach B2C Commerce Accelerator Boot application. This flow is an example and can be customized to fit your requirements. The following section explains how the Boot application uses e-commerce APIs. You can use this configuration as a reference to design your own checkout flow with BRIEF.
The cart component is available on pages with a product grid or product results. Customers can add products to their cart using the Add to Cart button. The cart status is available on the /carts page, where customers can update item quantities or remove items.
Customers can start the checkout process from the cart page by selecting the checkout button. If the customer is not authenticated, a login form appears. After authentication, the user is redirected to the Shipment Address page, where they can select a saved shipment address from their account.
The payment process consists of two separate operations:
- Transferring funds through the payment provider
- Registering the payment in the e-commerce backend
These steps are related but must be handled separately. Most e-commerce systems do not provide out-of-the-box integration with payment providers. System integrators must implement this integration, including in Bloomreach Accelerator: B2C Commerce. The Boot application supports payment registration in the e-commerce backend.
After completing payment, the system creates a new order in the e-commerce backend. Customers can view their orders in the account details section.
Components Details
The Checkout components in the Bloomreach B2C Commerce Accelerator Boot application are command chain delivery components. BRIEF supports the creation of RESTful JAX-RS resources to customize shipment and payment details during checkout. These custom REST endpoints can be called by applications outside the Bloomreach Commerce Accelerator, such as standalone JavaScript applications.
StarterStore JAX-RS resources extend the AbstractStarterStoreResource class. This class provides utilities for creating custom plain resources and supports BRIEF concepts like commerce and connector exchanges and commerce context.
The Boot application includes an HST component named CheckoutComponent, which manages the checkout process. This component ensures that customers are authenticated before starting checkout and enforces the checkout flow. It also retrieves user details, such as the default shipment address.
Note: Starting with Bloomreach Commerce Accelerator v2,
CheckoutResourceis deprecated and replaced byOrderResource. The new implementation uses the Commerce Connector SDK.
Cart
The Cart implementation uses a set of command chain delivery components. Each command uses the CartRepository interface defined in the Commerce Connector SDK API. For details, see the CartRepository table in the Connector SDK API Detail page.
Each cart operation has a dedicated command:
CartCreateCommandCartDeleteCommandCartProductAddCommandCartProductListCommandCartProductRemoveCommandCartProductUpdateCommand
These commands may behave differently depending on the Bloomreach Commerce Accelerator request phase (RESOURCE, ACTION, RENDERING).
Shipment
Shipment functionality is exposed as custom JAX-RS services in BRIEF. The definition is in the OrderResource class. The REST endpoints provided by this component include:
shipmentAddresses: Specify the shipment address to associate with the checkout. The commerce connector component used to update the cart shipment address iscartShipmentAddressUpdate.billingAddresses: Specify the billing address to use during checkout.shipmentOptions: Specify the shipment method for checkout. The commerce connector component used to update the cart shipment method iscartShipmentMethodUpdate.
Payment
The Payment component is a custom JAX-RS service in BRIEF. Its definition is in the OrderResource class. The available REST endpoint is:
paymentMethod: Registers the payment method to use during checkout.
Integration with a payment provider is not included in the Bloomreach Commerce Accelerator. You can implement this integration in the JAX-RS endpoint as a server-side integration. Client-side integrations are also possible, for example, using JavaScript callbacks.
Order
Order functionality is based on the Commerce Connector SDK API. The OrderRepository interface is documented in the Connector SDK API Detail page under the OrderRepository table. BRIEF provides REST endpoints that directly invoke the repository implementation:
confirmations: Handles final order placement. The REST endpoint uses theorderCreateconnector component.
Authenticated customers can retrieve a list of placed orders in the account section under My Orders. This component is a GenericCommandChainComponent that uses the orderQuery connector component.