Created
October 22, 2017 18:44
-
-
Save adamjstevenson/8565ee430ae60a55b465fd832efd7ad9 to your computer and use it in GitHub Desktop.
A rails payments view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<div class="col-md-12"> | |
<table class="table table-bordered table-striped table-hover"> | |
<thead> | |
<tr> | |
<th>Payment ID</th> | |
<th>Amount</th> | |
<th>Net</th> | |
<th>Created</th> | |
<th>Actions</th> | |
</tr> | |
</thead> | |
<tbody> | |
<% @payments.each do |payment| %> | |
<tr> | |
<td><%= link_to payment.source_transfer.source_transaction, charge_path(payment.source_transfer.source_transaction) %></td> | |
<td><%= number_to_currency(payment.amount/100) %></td> | |
<td><%= format_amount(payment.amount - payment.application_fee.amount) %></td> | |
<td><%= format_date(payment.created) %></td> | |
<td class="text-center"> | |
<% if payment.refunded %> | |
<span class="text-danger"> | |
<span class="fa fa-undo"></span> Refunded | |
</span> | |
<% else %> | |
<%= link_to "Refund", charge_path(payment.source_transfer.source_transaction), method: :delete, data: { confirm: "Are you sure you want to refund this charge?", disable_with: "<i class='fa fa-spinner fa-spin'></i> Refunding charge..." }, class: "btn btn-sm btn-block btn-custom btn-danger" %> | |
<% end %> | |
</td> | |
</tr> | |
<% end %> | |
</tbody> | |
</table> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment