One-click Checkout Development Guide
Learn how to develop one-click checkout extension.
Follow these development best practices before starting extension development to ensure a smooth, efficient, and maintainable process.
📄️ Inject Scripts
This page explains the concepts and patterns used to intercept and handle the AddToCart mutation flow in a generic, reusable way. This covers the optional approach for intercepting Buy Now button from the PDP. For the mandatory Checkout button on the Cart page, use Storefront Bindings instead.
📄️ Controllers
Controllers are server-side modules that handle HTTP requests, orchestrate business logic, and coordinate between different services (platform APIs, payment gateways, databases). In extensions, controllers manage the critical flow of order creation, payment verification, and checkout completion.
📄️ Payment Handler
A payment handler is a client-side function that processes payment responses from payment gateways after a user completes payment. It handles the critical post-payment flow: verifying payment authenticity, completing platform checkout, updating payment status, and redirecting users to success/failure pages.
📄️ Verify Payment
The verify endpoint is responsible for processing payment responses from payment gateways, verifying payment authenticity, extracting customer addresses, completing platform checkout, and updating payment status. This endpoint is called by the frontend Payment Handler after a user completes payment in the payment gateway modal.
📄️ Redirection
Redirection is the process of navigating users to a different page after completing a payment. In payment gateway integrations, redirection occurs after payment verification and checkout completion, sending users to success or failure pages with relevant order information.