Test in preview mode

This guide details how to preview and test your integration with Order with Google.

Preview Tool

You can use the Preview Tool to manually test your Order with Google integration. The tool lets you preview your inventory defined in your data feeds and send Checkout and Submit Order requests to your fulfillment endpoint.

  1. In the Actions console, go to Develop > Data feeds.
  2. On the Test your app with feeds card, click Get started.
  3. From the drop-down menu, select the data feed environment of the inventory you want to preview.
    • Preview: Uses the inventory from the data feed file you upload in the Upload test feed card.
    • Sandbox: Uses the inventory from the Sandbox data feeds.
    • Production: Uses the inventory from the Production data feeds.
  4. To test an online payment in sandbox mode with your payment processor, select Use transaction sandbox.
    • Online payment in sandbox mode calls your payment processor, but your credit card isn't charged.
  5. Click Launch Test. The Preview Tool launches a new tab.
    • The Preview Tool uses the fulfillment endpoint URL configured in your Actions Console. Make sure that the URL that you want to test is correct.
    • If you want to test time-based scenarios, such as opening hours, you can simulate the time if you append the _cs=hoursh parameter in the Preview Tool URL.

      Example: http://orderfood.google.com/browserestaurant?_cs=-6h

  6. Go through the Order with Google flow and build a cart.
  7. Click Checkout to test the checkout action of your fulfillment endpoint.
  8. Click Place order to test the submit order action of your fulfillment endpoint.
  9. If the order successfully submits, the Preview Tool displays a confirmation page that contains your order details.
  10. Click the confirmation dialog to view the order details. If you see HTTP 404 errors, append sandbox=1.
  11. Push an async order update for the newly created order.
  12. Refresh the order details page to see updates to the order.

Turn off test mode

After you successfully complete the test, follow these steps to turn off the testing mode:

  1. Go to Test > Simulator > Settings.
  2. Disable On device testing.

Additional resources

In addition to the steps outlined in this guide, you can use console tools to further test and troubleshoot your order fulfillment.

Refer to the following tools for additional guidance:

  • The Chrome DevTools Console outputs request and response JSON between the console and your fulfillment. Refer to this output when you perform a manual test to troubleshoot specific issues.
  • Your fulfillment outputs its Stackdriver logs to the Google Cloud console. If you're troubleshooting issues with your fulfillment code, refer to these logs for detailed error messages.