Add debt system: track refunds/disputes, redirect payments until cleared
- Add nullable debt field to User entity with addDebt/reduceDebt helpers - On refund webhook: add refunded amount to organizer debt - On dispute webhook (charge.dispute.created): add disputed amount to debt - OrderController: if organizer has debt > 0, payment goes to main Stripe account instead of connected account, debt reduced on payment success - Display debt amount on organizer dashboard with warning message - Add dispute notification email template - Migration for debt column on user table Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,16 @@
|
||||
|
||||
{% else %}
|
||||
|
||||
{% if isOrganizer and app.user.debt is not null and app.user.debt > 0 %}
|
||||
<div class="card-brutal-error p-6 mb-8">
|
||||
<div class="flex items-center gap-3 mb-2">
|
||||
<span class="text-2xl">⚠</span>
|
||||
<h2 class="text-sm font-black uppercase tracking-widest text-red-800">Dette en cours</h2>
|
||||
</div>
|
||||
<p class="font-bold text-gray-700 text-sm">Suite a des remboursements ou litiges, votre compte presente une dette de <strong class="text-red-700">{{ (app.user.debt / 100)|number_format(2, ',', ' ') }} €</strong>. Les paiements de vos clients seront retenus jusqu'a l'apurement complet de cette dette.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if isOrganizer and app.user.billing and app.user.billingState != 'good' %}
|
||||
<div class="card-brutal-error p-8 text-center mb-8">
|
||||
<div class="text-4xl mb-4">⚠</div>
|
||||
|
||||
13
templates/email/dispute_created.html.twig
Normal file
13
templates/email/dispute_created.html.twig
Normal file
@@ -0,0 +1,13 @@
|
||||
{% extends 'email/base.html.twig' %}
|
||||
|
||||
{% block title %}Litige recu{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Bonjour {{ firstName }},</h2>
|
||||
<p>Un litige de <strong>{{ amount }} €</strong> a ete ouvert sur la commande <strong>{{ orderNumber }}</strong>.</p>
|
||||
<p>Ce montant a ete ajoute a votre dette. Les paiements de vos clients seront retenus jusqu'a l'apurement complet.</p>
|
||||
<div style="background:#fef2f2;border-left:4px solid #dc2626;padding:12px 16px;margin:16px 0;">
|
||||
<p style="font-weight:700;font-size:13px;color:#991b1b;margin:0;">Dette totale : {{ debt }} €</p>
|
||||
</div>
|
||||
<p>Contactez <a href="mailto:contact@e-cosplay.fr">contact@e-cosplay.fr</a> pour toute question.</p>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user