feat: Add manual payout system for countries without Stripe Global Payouts
This commit is contained in:
@@ -57,6 +57,11 @@
|
||||
<%= button_to "Process", admin_payout_path(payout), method: :post,
|
||||
class: "text-indigo-600 hover:text-indigo-900 bg-indigo-100 hover:bg-indigo-200 px-3 py-1 rounded" %>
|
||||
<% end %>
|
||||
<% if payout.pending? || payout.processing? %>
|
||||
<%= button_to "Mark as Manually Processed", mark_as_manually_processed_admin_payout_path(payout), method: :post,
|
||||
class: "text-green-600 hover:text-green-900 bg-green-100 hover:bg-green-200 px-3 py-1 rounded ml-2",
|
||||
data: { confirm: "Are you sure you want to mark this payout as manually processed? This will notify the promoter that the bank transfer is being processed." } %>
|
||||
<% end %>
|
||||
<%= link_to "View", promoter_payout_path(payout), class: "text-indigo-600 hover:text-indigo-900 ml-2" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,2 +1,122 @@
|
||||
<h1>Admin::Payouts#show</h1>
|
||||
<p>Find me in app/views/admin/payouts/show.html.erb</p>
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h1 class="text-3xl font-bold text-gray-900">Payout Details</h1>
|
||||
<%= link_to "Back to Payouts", admin_payouts_path, class: "text-indigo-600 hover:text-indigo-900" %>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-lg shadow overflow-hidden">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h2 class="text-xl font-semibold text-gray-800">Payout #<%= @payout.id %></h2>
|
||||
</div>
|
||||
|
||||
<div class="p-6">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Event Information</h3>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Event Name</p>
|
||||
<p class="text-sm text-gray-900"><%= @payout.event.name %></p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Event Date</p>
|
||||
<p class="text-sm text-gray-900"><%= @payout.event.start_time.strftime("%B %d, %Y") %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Promoter Information</h3>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Name</p>
|
||||
<p class="text-sm text-gray-900"><%= @payout.user.name.presence || @payout.user.email %></p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Email</p>
|
||||
<p class="text-sm text-gray-900"><%= @payout.user.email %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Financial Details</h3>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Gross Amount</p>
|
||||
<p class="text-sm text-gray-900">€<%= @payout.amount_euros %></p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Platform Fees</p>
|
||||
<p class="text-sm text-gray-900">€<%= @payout.fee_euros %></p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Net Amount</p>
|
||||
<p class="text-sm text-gray-900">€<%= @payout.net_amount_euros %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-4">Payout Information</h3>
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Status</p>
|
||||
<p class="text-sm text-gray-900">
|
||||
<% case @payout.status %>
|
||||
<% when 'pending' %>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">
|
||||
Pending
|
||||
</span>
|
||||
<% when 'processing' %>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">
|
||||
Processing
|
||||
</span>
|
||||
<% when 'completed' %>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">
|
||||
Completed
|
||||
</span>
|
||||
<% when 'failed' %>
|
||||
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">
|
||||
Failed
|
||||
</span>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Created At</p>
|
||||
<p class="text-sm text-gray-900"><%= @payout.created_at.strftime("%B %d, %Y at %H:%M") %></p>
|
||||
</div>
|
||||
<% if @payout.stripe_payout_id.present? %>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Payout ID</p>
|
||||
<p class="text-sm text-gray-900">
|
||||
<% if @payout.manual_payout? %>
|
||||
Manual Transfer - <%= @payout.stripe_payout_id %>
|
||||
<% else %>
|
||||
<%= @payout.stripe_payout_id %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 flex space-x-4">
|
||||
<% if @payout.can_process? %>
|
||||
<%= button_to "Process Payout", admin_payout_path(@payout), method: :post,
|
||||
class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" %>
|
||||
<% end %>
|
||||
|
||||
<% if @payout.pending? || @payout.processing? %>
|
||||
<%= button_to "Mark as Manually Processed", mark_as_manually_processed_admin_payout_path(@payout), method: :post,
|
||||
class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500",
|
||||
data: { confirm: "Are you sure you want to mark this payout as manually processed? This will notify the promoter that the bank transfer is being processed." } %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to "View as Promoter", promoter_payout_path(@payout), class: "inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md shadow-sm text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -159,7 +159,11 @@
|
||||
<% when 'completed' %>
|
||||
<span class="payout-status-badge completed">
|
||||
<i data-lucide="check-circle" class="w-3 h-3 mr-1"></i>
|
||||
Completed
|
||||
<% if payout.manual_payout? %>
|
||||
Manually Processed
|
||||
<% else %>
|
||||
Completed
|
||||
<% end %>
|
||||
</span>
|
||||
<% when 'failed' %>
|
||||
<span class="payout-status-badge failed">
|
||||
|
||||
@@ -162,8 +162,41 @@
|
||||
|
||||
<% if @payout.stripe_payout_id.present? %>
|
||||
<div class="px-4 py-5 sm:px-6 payout-detail-item">
|
||||
<dt class="payout-detail-label">Stripe Payout ID</dt>
|
||||
<dd class="payout-detail-value font-mono text-xs break-all"><%= @payout.stripe_payout_id %></dd>
|
||||
<dt class="payout-detail-label">
|
||||
<% if @payout.manual_payout? %>
|
||||
Manual Payout ID
|
||||
<% else %>
|
||||
Stripe Payout ID
|
||||
<% end %>
|
||||
</dt>
|
||||
<dd class="payout-detail-value font-mono text-xs break-all">
|
||||
<% if @payout.manual_payout? %>
|
||||
Manual Transfer - <%= @payout.stripe_payout_id %>
|
||||
<% else %>
|
||||
<%= @payout.stripe_payout_id %>
|
||||
<% end %>
|
||||
</dd>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @payout.manual_payout? && @payout.completed? %>
|
||||
<div class="px-4 py-5 sm:px-6 payout-detail-item">
|
||||
<dt class="payout-detail-label">Manual Processing Note</dt>
|
||||
<dd class="payout-detail-value">
|
||||
<div class="bg-blue-50 border border-blue-200 rounded-md p-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<i data-lucide="info" class="h-5 w-5 text-blue-400"></i>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-blue-800">Bank Transfer Initiated</h3>
|
||||
<div class="mt-2 text-sm text-blue-700">
|
||||
<p>Your payout is being processed via bank transfer. Please allow 1-3 business days for the funds to appear in your account.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</dd>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user