Write gate context to cart attributes

This is the fourth and final part of a tutorial series for building a tokengated storefront. Read the overview page before starting this tutorial.

In this tutorial, you'll create a function that generates a hash-based message authentication code (HMAC). The HMAC you create will be an encrypted version of the gateConfiguration.id that your customer has unlocking tokens for. With this, you can leverage Shopify Functions at checkout to apply automatic discounts