# Variables d'environnement nécessaires pour la fonctionnalité "Lancer facture" ## GoCardless API ```bash # URL de l'API GoCardless (sandbox ou live) GOCARDLESS_ENVIRONMENT=sandbox # ou "live" pour la production GOCARDLESS_ACCESS_TOKEN=your_gocardless_access_token_here ``` ## AWS SES (déjà configuré) ```bash AWS_SES_FROM="Odentas " AWS_REGION="eu-west-3" ``` ## URL du site (déjà configuré) ```bash NEXT_PUBLIC_SITE_URL="https://your-domain.com" ``` ## Instructions pour obtenir les tokens GoCardless 1. **Sandbox (développement)** : - Aller sur https://developer.gocardless.com/ - Créer un compte développeur - Générer un access token sandbox 2. **Live (production)** : - Créer un compte GoCardless business - Aller dans les paramètres API - Générer un access token live ## Colonnes Supabase nécessaires Assurez-vous que la table `invoices` contient les colonnes suivantes : - `payment_method` (text) - `due_date` (date) - `sepa_day` (date) - `invoice_type` (text) - `site_name` (text) - `notified` (boolean) - `gocardless_payment_id` (text) - `org_id` (uuid) - relation vers organizations Et que la table `organization_details` contient : - `email_notifs` (text) - email principal pour les notifications - `email_notifs_cc` (text) - email en copie (optionnel) - `id_mandat_sepa` (text) - ID du mandat SEPA dans GoCardless - `org_id` (uuid) - relation vers organizations **Structure des relations :** - `invoices.org_id` → `organizations.id` - `organization_details.org_id` → `organizations.id`