LaraCopilot
LaraCopilot
Integrations

Payment Gateways

Connect Stripe to your team and ship apps that take real payments — with a one-click switch between test and live mode

LaraCopilot can build apps that take real payments. Connect a payment gateway once at the team level, and every project you generate gets a working checkout flow, webhooks, and a Go Live switch in the IDE.

Stripe is fully supported today. PayPal, Razorpay, Paddle, Adyen, Square, Braintree, Lemon Squeezy, Mollie, Mercado Pago, Paystack, Klarna, Komoju, and Polar are listed as Coming Soon.

Connections are per team, not per user. Switching the active team in the IDE switches which Stripe account future generations will use.


Connecting Stripe

Step 1 — Open the Payment Gateways page

In the sidebar, click Payment Gateways. You'll see a grid of every supported provider. Stripe shows an Active badge; others show Coming Soon.

Click the Stripe card to open its detail page.

Step 2 — Paste your Stripe secret keys

You'll be asked for:

FieldRequiredFormat
Test secret keyYesMust start with sk_test_
Live secret keyNo (but required to go live later)Must start with sk_live_

You can find both keys in your Stripe Dashboard under Developers → API keys.

Only team owners can connect or disconnect a payment gateway. Keys are stored encrypted and are never exposed to the AI agent or to clients — they only travel server-to-server when needed.

Step 3 — Save

Click Connect. LaraCopilot validates the key against Stripe and, on success, shows your connected account's name (or email, or account ID) along with a Connected badge.

You don't need to provide a webhook signing secret — LaraCopilot registers webhooks automatically per project (see below).


What happens when you generate a project

Once your team has a connected gateway, every new project the AI generates gets payments wired up automatically. You don't need to ask for it in the prompt — LaraCopilot detects payment-style apps and sets them up.

You'll find the following in your generated project:

  • Routes/checkout, /payments/success, /payments/cancel, and /webhooks/stripe
  • Controllers — a checkout controller and a webhook controller with HMAC signature verification
  • Migrationsstripe_events and stripe_subscriptions tables (run automatically)
  • Configconfig/stripe.php exposing mode, key, secret, webhook secret, and currency
  • Environment variablesSTRIPE_KEY, STRIPE_SECRET, STRIPE_WEBHOOK_SECRET, STRIPE_MODE are written to your project's .env
  • A registered webhook in your Stripe account, pointing to your project's public URL and listening for the events you'd typically want (checkout.session.completed, customer.subscription.*, invoice.paid, invoice.payment_failed)

Two app shapes

ShapeWhat it looks likeHow payments work
CartOne-off purchases (e.g. a shop, a menu, a hotel booking)Each request creates a Stripe Checkout Session on the fly using your app's own products in the database. No pre-created Stripe products needed.
SubscriptionRecurring plans (e.g. SaaS tiers)The AI creates real Products, Prices, and Payment Links in your Stripe account during generation, and references the resulting buy.stripe.com URLs in your code.

LaraCopilot picks the right shape based on what you asked for. Both start in test mode by default — you can take real payments only after going live.


The Go Live toggle

Every payment-enabled project starts in test mode (amber dot, label Go Live). When you're ready to take real payments, flip the switch from inside the IDE.

Where to find it

Open the project in the IDE. The Go Live button sits in the workbench toolbar.

The button only appears when the project actually has payment integration. Projects without payments never see the button.

Switching to live

  1. Click Go Live
  2. Read the confirmation modal — it explains what will happen and reminds you that real charges will start once active
  3. Click Confirm

For cart apps, the switch is instant. Your project's .env is rewritten with your live keys, the live webhook is registered, and the button flips to a green dot reading Switch to test.

For subscription apps, the same env/webhook swap happens, plus a regeneration prompt is automatically sent to the chat panel. The AI then recreates the products, prices, and payment links inside your live Stripe account so the app's catalogue exists there too. You don't need to click anything else — just watch the chat finish.

The Go Live button is disabled until you've added a sk_live_ key to your team's Stripe connection. The tooltip points you back to Payment Gateways if it's missing.

Switching back to test

Click Switch to test. The same flow runs in reverse with a lighter confirmation (no risk of real charges). Different projects on the same team can be in different modes at the same time — switching one doesn't touch the others.


Pre-conditions for going live

Before flipping a project live, make sure:

  • A live secret key (sk_live_...) is saved on your team's Stripe connection
  • The project's container is running, so configuration changes can be applied
  • For subscription apps, you're comfortable with the AI recreating your product/price catalogue in the live Stripe account

Reversibility and safety

  • The Go Live switch is fully reversible in both directions.
  • Cart-mode switches don't touch your data or migrations.
  • Subscription-mode switches only rewrite the source files that hold buy.stripe.com URLs (controllers and seeders). Existing customer subscriptions in Stripe are not migrated automatically — moving live customers between Stripe accounts is a manual operation in the Stripe Dashboard and isn't something LaraCopilot does for you.
  • All credentials are stored encrypted at rest. The AI agent never sees your raw keys directly.

Always run a real test payment in test mode before going live. Use Stripe's test card 4242 4242 4242 4242 with any future expiry and any CVC.


Disconnecting a gateway

On the Stripe detail page, click Disconnect to remove the connection. New project generations on that team will no longer include payment scaffolding, but existing projects keep working — their .env keys and code remain in place until you change them.

If you re-connect later with a different Stripe account, future projects will use the new account; existing projects keep pointing to their original keys until you regenerate or edit them.

On this page