Skip to content

Web-Based Order Ahead

Web-Based order ahead is available for partners who do not have a API available. The web application will be loaded inside a web-view in the customer application with a Javascript interface exposed for providing customer contact information and payment details.

Important: web applications must allow for a "guest checkout" experience to support web-based order ahead.

Web applications must also provide support for the Aston Club Web Payments Javascript API.

Ideally each site for a merchant should have a unique URL, for example: https://orderahead.com/merchant_x/site_y or https://orderahead.com/merchant_x?site=y. This improves the user experience for the customer by not having to reselect the site/location when the begin an order ahead flow.

In order to process a payment the web application needs to determine the Aston Club merchant ID. There are two methods for this:

  1. Pass the ID as a querystring param, for example: https://orderahead.com/merchant_x/site_y?aston=507f1f77bcf86cd799439011. In order for this to function correctly, the web application must prevent the user from browsing/selecting other stores/sites since this ID is tied to a specific store. If this cannot be prevented try options 2 or 3.
  2. Maintain a mapping of stores to Aston IDs locally in the order ahead application.
  3. Configure the local order ahead ID for each store in LOKE's back end, then use orderStoreId in the payment call, instead of merchantId. This is the least preferred option as it introduces an extra configuration point for each store, and also introduces an element of brittleness and poor UX where a configuration error will not occur until a customer reaches the final stages of an order (if the mapping is not configured).