Actions
<% if @payout.can_approve? %>
<%= button_to "✅ Approve Payout", approve_admin_payout_path(@payout), method: :post,
class: "bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md font-medium",
data: { confirm: "Approve this payout for manual bank transfer?" } %>
<% end %>
<% if @payout.can_reject? %>
<%= form_with url: reject_admin_payout_path(@payout), method: :post, local: true, class: "flex gap-2" do |form| %>
<%= form.text_field :rejection_reason, placeholder: "Rejection reason...", required: true,
class: "border border-gray-300 rounded-md px-3 py-2" %>
<%= form.submit "❌ Reject", class: "bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-md font-medium",
data: { confirm: "Reject this payout?" } %>
<% end %>
<% end %>
<% if @payout.can_process? %>
<%= form_with url: mark_processing_admin_payout_path(@payout), method: :post, local: true, class: "flex gap-2" do |form| %>
<%= form.text_field :bank_transfer_reference, placeholder: "Transfer reference (optional)",
class: "border border-gray-300 rounded-md px-3 py-2" %>
<%= form.submit "🔄 Mark as Processing", class: "bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md font-medium",
data: { confirm: "Mark as processing (bank transfer initiated)?" } %>
<% end %>
<% end %>
<% if @payout.processing? %>
<%= form_with url: mark_completed_admin_payout_path(@payout), method: :post, local: true, class: "flex gap-2" do |form| %>
<%= form.text_field :bank_transfer_reference, placeholder: "Final transfer reference",
value: @payout.bank_transfer_reference,
class: "border border-gray-300 rounded-md px-3 py-2" %>
<%= form.submit "✅ Mark as Completed", class: "bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md font-medium",
data: { confirm: "Confirm transfer completion?" } %>
<% end %>
<%= form_with url: mark_failed_admin_payout_path(@payout), method: :post, local: true, class: "flex gap-2" do |form| %>
<%= form.text_field :failure_reason, placeholder: "Failure reason...", required: true,
class: "border border-gray-300 rounded-md px-3 py-2" %>
<%= form.submit "❌ Mark as Failed", class: "bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-md font-medium",
data: { confirm: "Mark transfer as failed?" } %>
<% end %>
<% end %>