Create the gated discount function

In this tutorial, you'll use Shopify Functions to apply the discount specified in the GateConfiguration. The server-side validation that's implemented in this tutorial prevents users from receiving applicable gated discounts without passing the gate.

This is the last part of a tutorial series to build a tokengating app. Complete the previous tutorials before starting this tutorial: