Redeem a Reward

Add a simple list of ways to redeem, and link to a button with the reward id we want to redeem.

<h3>Ways to redeem</h3>
  {% for points_reward in shop.metafields.rivo.loy.points_program.points_rewards %}
    <li>{{ }} for {{ points_reward.points_amount }} points. <button class="redeem" data-reward-id="{{ }}">Redeem</button></li>
  {% endfor %}
<script type="text/javascript">
  document.addEventListener("DOMContentLoaded", function(){
    document.querySelectorAll('.redeem').forEach(function(element) {
      element.addEventListener('click', function(event) {
        // redeem the reward and expect a promise with the data
          alert("reward been redeemed");