feat: Add manual payout system for countries without Stripe Global Payouts

This commit is contained in:
kbe
2025-09-17 08:35:20 +02:00
parent 3c1e17c2af
commit c74140c431
12 changed files with 375 additions and 28 deletions

View File

@@ -25,12 +25,28 @@ class Admin::PayoutsController < ApplicationController
end
end
# Mark a payout as manually processed (for SEPA transfers, etc.)
def mark_as_manually_processed
@payout = Payout.find(params[:id])
if @payout.pending? || @payout.processing?
begin
@payout.mark_as_manually_processed!
redirect_to admin_payouts_path, notice: "Payout marked as manually processed. Please complete the bank transfer."
rescue => e
redirect_to admin_payouts_path, alert: "Failed to mark payout as manually processed: #{e.message}"
end
else
redirect_to admin_payouts_path, alert: "Cannot mark this payout as manually processed."
end
end
private
def ensure_admin!
# For now, we'll just check if the user has a stripe account
# For now, we'll just check if the user is a professional user
# In a real app, you'd have an admin role check
unless current_user.has_stripe_account?
unless current_user.promoter?
redirect_to dashboard_path, alert: "Access denied."
end
end