espace-paie-odentas/GOCARDLESS_SETUP.md

1.5 KiB

Variables d'environnement nécessaires pour la fonctionnalité "Lancer facture"

GoCardless API

# 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é)

AWS_SES_FROM="Odentas <paie@odentas.fr>"
AWS_REGION="eu-west-3"

URL du site (déjà configuré)

NEXT_PUBLIC_SITE_URL="https://your-domain.com"

Instructions pour obtenir les tokens GoCardless

  1. Sandbox (développement) :

  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_idorganizations.id
  • organization_details.org_idorganizations.id