top_up.rb
1form!
2title "Buy Account Credit"
3
4if @max_top_up_amount & @max_top_up_amount.positive?
5 instructions "Max amount: $#{@max_top_up_amount}"
6end
7
8field(
9 type: "fixed",
10 label: "Current balance",
11 value: "$#{'%.2f' % @balance}"
12)
13
14field(**@payment_methods.to_list_single)
15
16field(
17 datatype: "xs:decimal",
18 var: "amount",
19 label: "Amount of credit to buy",
20 prefix: "$",
21 required: true
22)