Checkout flow
In this guide, we will provide a high-level overview of the checkout process, as implemented in Afosto's Hosted Checkout. Understanding this flow will be invaluable when building your own checkout or integrating with the Afosto platform.
Collecting Customer Data
The checkout process starts with the collection of customer data, specifically the shipping and billing addresses. This information is crucial as it not only enables the delivery of the purchased items but also influences subsequent steps of the checkout process. After these details are added to the cart, the shipping method options are requested, filtered based on the provided shipping address.
Selecting a Shipping Method
Once a customer selects their preferred shipping method and moves to the next step, the available payment methods are retrieved. It's important to note that these payment options are filtered based on the information previously provided, including the selected shipping method and the shipping and billing addresses.
Choosing a Payment Method
After a payment method has been chosen, a summary of the cart's contents and the cost breakdown is fetched. This step serves as a final review for customers, allowing them to ensure their order is correct and understand the cost composition before proceeding to payment.
Confirming the Cart and Initiating Payment
With all the necessary information added and the order reviewed, the cart can be confirmed, transforming it into an order. At this stage, a URL is retrieved to redirect the customer to the Payment Service Provider's page. This is where the customer will finalize their payment, thus completing their order.
Successful or failed payment
After the payment is fulfilled the customer is redirected to a success page. This page again shows their information and products they just ordered.
If a payment fails, the customer will be redirected to a page where they can select a different method or try again.
Understanding this flow will enable you to build a robust and efficient checkout process. While this flow represents the steps in the Afosto Hosted Checkout, it can be adapted or extended according to your specific business needs and customer requirements.
In the following guides we will guide you through all the steps and actions needed to create your own checkout.