Checkout Components
Synopsis
Bloomreach Commerce Accelerator provides all the functionalities required to implement your checkout process using your e-commerce backend. The Boot application includes components like Cart, Shipment options, Payments registration, and Order placement.
Components Overview
The Checkout components and pages allow customers to add/remove products to their cart, select shipment options, make a payment (through integration with payment providers), and place the order. These operations are available in almost every e-commerce backend.
This paragraph describes the checkout process designed in the Bloomreach B2C Commerce Accelerator Boot application. Please consider that this represents just an example of the checkout flow: it can be customized to meet your requirements. In the next paragraph we will see how the e-commerce APIs are used by the boot application: using this configuration as an example, you will be able to use BRIEF to design your own flow.
The cart component is used directly in pages containing a products grid (or more generally, a products result): you can use the Add to Cart button allowing this operation. In addition, in the Bloomreach B2C Commerce Accelerator Boot application, the status of the cart is available under the /carts page: there you can change the number of the items or delete them.
Once customers decide to proceed with checkout, they can start this process directly from the cart page, using the checkout button. If the customer is not authenticated, the login form will appear. After the login, the user will be redirected to the Shipment Address page: based on the shipment address saved in the account configuration, the user will be able to select only one of them.
The next phase is related to the Payment process. It is important to understand that the payment in this specific case consists of two important operations:
- Transferring money via the payment provider,
- Registration of the payment in your e-commerce backend.
These two concepts are connected with each other but must be considered as two different steps. Most of the e-commerce systems don't support OOTB integration with payment providers, this needs to be designed and implemented by system integrators. This effort is required in Bloomreach Accelerator: B2C Commerce as well.
On the other hand, the Bloomreach B2C Commerce Accelerator boot application fully supports payment registration in the e-commerce backend.
Once the payment process is completed, a new order will be created in the e-commerce backend. The list of orders is available directly in your account details section.
Components Details
The Checkout components used in the Bloomreach B2C Commerce Accelerator Boot application are command chain delivery components. In addition, BRIEF enables the creation of RESTful JAX-RS resources needed to customise the Shipment and Payment details during the checkout process: those custom REST endpoints can be invoked by application not part of Bloomreach Commerce Accelerator (e.g. standalone JS application).
StarterStorore JAX-RS resources are extending the AbstractStarterStoreResource: this class offers all the utilities you need in order to create your custom plain resource and at the same time, use all the concepts provided by BRIEF, like commerce and connector exchanges, commerce context etc.
In addition, the Bloomreach B2C Commerce Accelerator Boot application provides a built-in HST component, called CheckoutComponent, that's actually responsible for the checkout process. This will ensure that customers are authenticated before starting the checkout and that this follows a specific flow. It's also responsible for retrieving user details, like customer default shipment address.
Cart
The Cart implementation consists of a set of command chain delivery component. Every command has been upgraded to use the CartRepository interface defined with the Commerce Connector SDK API: you can have a look a the CartRepository table defined in the Connector SDK API Detail page.
A specific command has been created for each cart operation:
- CartCreateCommand
- CartDeleteCommand
- CartProductAddCommand
- CartProductListCommand
- CartProductRemoveCommand
- CartProductUpdateCommand
Is important to mention that, based on the Bloomreach Commerce Accelerator request phase (RESOURCE, ACTION, RENDERING), those commands can behave differently.
Shipment
Shipment has been exposed as a custom JAX-RS services available in BRIEF. You can find its definition in the OrderResource class. The REST endpoints made available by this component are:
- shipmentAddresses, where is possible to specify the shipment address to associate during checkout. The commerce connector component used to update cart shipment address is cartShipmentAddressUpdate.
- billingAddresses, where is possible to specify the shipment method to use during checkout.
- shipmentOptions, where is possible to specify the shipment method to use during checkout. The commerce connector component used to update cart shipment method is cartShipmentMethodUpdate
Payment
The Payment component is a custom JAX-RS service included in BRIEF. You can find the related definition in the OrderResource class. The REST endpoint available are
- paymentMethod: this endpoint will only register the payment method to use during the checkout
As mentioned before, the integration with a payment provider is not part of the Bloomreach Commerce Accelerator. However, the related implementation can be part of the JAX-RS endpoint definition: this can be considered as a server side integration. Client side integrations with payment providers are also possible, e.g. using javascript callbacks.
Order
Order functionality is fully based on the Commerce Connector SDK API. An interface, called OrderRepository has been defined and documented in the Connector SDK API Detail page, under the OrderRepository table : more details can be found there. BRIEF defines a set of REST endpoints directly invoking the repository implementation. Those endpoints are:
- confirmations, responsible for the final order placement. The related REST endpoint definition uses the orderCreate connector component.
In addition, authenticated customers can also retrieve a list of placed orders. This option is available in the account section, under My orders. This component is just a GenericCommandChainComponent using the orderQuery connector component.