Documentation Index
Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
Use this file to discover all available pages before exploring further.
(Facoltativo) Definisci il perimetro della codebase con Ask Devin
Se non sei sicuro di come la tua app gestisca attualmente i pagamenti — o quali file e pattern usare come riferimento nella tua specifica — usa Ask Devin per eseguire prima un’analisi:Usa le risposte per completare la tua specifica — fai riferimento a file specifici, nomi di tabelle e pattern, affinché Devin crei qualcosa che si integri in modo naturale nella tua codebase. Puoi anche avviare una sessione di Devin direttamente da Ask Devin, e userà tutto ciò che ha appreso come contesto.
Aggiungi le chiavi sandbox di Stripe
Devin ha bisogno delle chiavi Stripe in modalità test per creare le sessioni di checkout e verificare l’handler del webhook. Usa sempre le credenziali sandbox — non fornire mai a Devin le chiavi Stripe di produzione.L’approccio più semplice è memorizzarle come organization secrets prima di avviare la sessione:
- Vai su Settings > Secrets e aggiungi:
STRIPE_SECRET_KEY— la tua chiave segreta in modalità test dal Stripe DashboardSTRIPE_WEBHOOK_SECRET— il segreto di firma dalle impostazioni dell’endpoint webhook
- Devin accede a queste chiavi come variabili d’ambiente, così non finiscono mai inserite in modo statico nel tuo codice sorgente.
Gli organization secrets devono essere aggiunti prima di avviare la sessione — vengono iniettati all’avvio della sessione. In alternativa, puoi fornire i secrets durante la sessione tramite la chat, e Devin ti chiederà anche in modo proattivo tutte le credenziali necessarie quando rileva variabili d’ambiente mancanti.
Consegna le specifiche del tuo checkout
Incolla la tua specifica — da un PRD, un ticket Linear o un messaggio dettagliato su Slack — direttamente in Devin. Una buona specifica per il checkout copre i piani tariffari, il flusso di pagamento e cosa succede dopo un pagamento riuscito. Più è strutturata, meglio è.A good spec for Devin includes three things: what to build (pricing tiers, checkout flow, webhook handler), where it lives (routes, tables, files), and how it fits in (existing patterns to follow). You don’t need to specify every implementation detail — Devin investigates your codebase to fill in the gaps.
Devin builds and verifies in the browser
Devin reads your spec, explores the codebase for matching patterns, then implements across the full stack. Before opening a PR, it runs your app locally and opens its built-in browser to verify the checkout flow works end-to-end.Here’s what that looks like for the Stripe checkout example:
- Creates the migration — Adds the
subscriptionstable with columns foruser_id,stripe_subscription_id,plan,status, andcurrent_period_end - Builds the pricing page — Creates the three-tier pricing cards at
/pricing, each with a “Subscribe” button that posts to the checkout API - Implements checkout session creation — Builds
POST /api/checkout/sessionsthat creates a Stripe Checkout session with the correct price ID, customer email, and redirect URLs - Adds the webhook handler — Implements
POST /api/webhooks/stripewith signature verification,checkout.session.completedevent handling, and database updates - Builds the success page — Creates
/checkout/successthat fetches the Stripe session, displays the plan name, amount charged, and a “Go to Dashboard” link - Writes tests — Tests for webhook signature verification (valid, invalid, missing), checkout session creation, and the plan-update database logic
- Opens the browser — Starts the dev server, navigates to
/pricing, clicks “Subscribe” on the Pro tier, verifies the Stripe Checkout redirect works, and checks that the success page renders correctly after a test payment - Opens a PR — Delivers all changes with a summary of what was implemented and how it was verified
Iterate from the PR
Una volta aperta la PR, invia prompt di follow-up nella stessa sessione per estendere o modificare il flusso di checkout.
Review the PR with Devin Review
Once Devin opens the PR, use Devin Review to review the changes. Devin Review has full context of your codebase and can catch bugs, security issues, and style inconsistencies across the diff. You can ask follow-up questions in the review chat — for instance, “Does the webhook handler validate the event type before processing?” — and Devin will answer grounded in the actual code.
