I need to create a payment web form where the purchaser can select one of three prices instead of having one price hard-wired into the Accept Payment input field. The default code for the payment input field is:
<input type="hidden" name="paymentData"/>
<label for="Amount">Amount</label>
{% if paymentAmount == null %}
{% assign paymentAmount = params.price | default: 0 %}
{% endif %}
<input type="text" id="Amount" name="Amount" value="{{paymentAmount}}" data-trp_price="{{paymentAmount}}"/>
When there is just one price, I’ve replaced {{paymentAmount}} with that price and the form works well. But if I replace this field with a field, I can’t work out how to pass on the price of the selected item. This code does not work:
<select name="Amount" data-trp_price="{{paymentAmount}}">
<option value="50.00">$50 Gift voucher</option>
<option value="95.00">$95 Gift voucher</option>
<option value="190.00">$190 Gift voucher</option>
</select>