form!
title "Buy Account Credit"

if @max_top_up_amount&.positive?
	instructions "Max amount: $#{@max_top_up_amount}"
end

field(
	type: "fixed",
	label: "Current balance",
	value: "$#{'%.2f' % @balance}"
)

field(**@payment_methods.to_list_single)

field(
	datatype: "xs:decimal",
	var: "amount",
	label: "Amount of credit to buy",
	prefix: "$",
	required: true
)
