-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
_form.html.erb
38 lines (36 loc) · 1.31 KB
/
_form.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<div data-hook="admin_payment_form_fields">
<div class="row">
<div class="col-4">
<div class="field">
<%= f.label :amount %>
<%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :amount, currency: @order.currency %>
</div>
</div>
</div>
<div>
<div class="field">
<label><%= Spree::PaymentMethod.model_name.human %></label>
<ul>
<% @payment_methods.each do |method| %>
<li>
<label data-hook="payment_method_field">
<%= radio_button_tag 'payment[payment_method_id]', method.id, method == @payment_method, { class: "payment_methods_radios" } %>
<%= method.name %>
</label>
</li>
<% end %>
</ul>
<div class="payment-method-settings">
<% @payment_methods.each do |method| %>
<div class="payment-methods" id="payment_method_<%= method.id %>" data-payment-method-id="<%= method.id %>">
<% if method.source_required? %>
<br>
<%= render partial: "spree/admin/payments/source_forms/#{method.partial_name}",
locals: { payment_method: method, previous_cards: method.reusable_sources(@order) } %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
</div>