# Stripe payments in a Replit app

> Use either the Replit Stripe connector or your own Stripe keys in each environment, never both. Test with Stripe’s test cards, connect live payments for the published app, and mark orders as paid from Stripe’s confirmation, not from the browser reaching a success page.

Canonical: https://shipfast.online/rescue/replit/payments/
Last updated: 2026-10-25

By [Prayag Dalal](https://shipfast.online/about/). Checked against Replit's documentation on 2026-10-25.

## Symptoms

- Payments work in Preview but fail on the published app.
- You set up the connector and also added your own keys, and Stripe calls now conflict.
- A payment succeeds but the order or booking isn’t marked as paid.

## Why it happens

Replit supports two methods. With the Replit Stripe connector (paid plans), Agent sets up a Stripe sandbox and you connect your live account later. With your own keys, stored in Secrets, you manage the Stripe SDK and webhook endpoints yourself. Replit’s docs say to use one method per environment: combining them causes connection conflicts.

You can use different methods in different environments, such as the connector’s sandbox in development and your own live keys in production. Live payments then depend on the production setup being complete.

## What Replit already handles

- **Stripe connector:** Agent creates a Stripe sandbox with no keys to copy; you connect your live account from the Publish pane.
- **Your own keys:** Keys in Secrets, with full control over the SDK and webhooks.
- **Agent-built flows:** Checkout, deposits, balances and refund rules built from a prompt, with a test checklist.

## Fix it yourself

1. **Pick one method per environment.** Connector or your own keys, never both in the same environment.
2. **Start from sign-in and a database.** Every order or booking should store its payment status against a user.
3. **Test with Stripe’s test cards.** 4242 4242 4242 4242 for success and 4000 0000 0000 0002 for a decline. Test cancellations and refunds too.
4. **Connect live payments.** Connect your live Stripe account from the Publish pane (connector), or add live keys to the published app’s secrets (your own keys).
5. **Make one real purchase.** A low-cost real payment with your own card before you share the app.

## Where it still goes wrong

- With your own keys, the webhook endpoints are yours to build and secure. Verify Stripe’s signatures on every event.
- Refunds, taxes and failed renewals are business rules you need to decide and build.
- Mark an order paid from Stripe’s confirmation (a webhook or a server-side check), not from the browser landing on a success page.

## FAQ

### Do I need a paid Replit plan for Stripe?

The Replit Stripe connector is on paid plans. Your own Stripe keys in Secrets are the alternative.

### Why do payments fail only on the published app?

Usually production configuration: live keys or the connector aren’t set up for production, or the published app is missing a secret.

### Which test cards should I use?

4242 4242 4242 4242 with any future expiry and any 3-digit CVC for success, and 4000 0000 0000 0002 to test a decline.

## Sources

- [Replit docs: Accept payments with Stripe](https://docs.replit.com/use-cases/accept-payments-with-stripe)
- [Replit docs: Troubleshoot publishing](https://docs.replit.com/build/troubleshooting)
- [Stripe: receive events with webhooks](https://docs.stripe.com/webhooks)

## Get it fixed

App rescue, From $1,000, fixed price: [send your app](https://shipfast.online/contact/?service=app-rescue).

## Related

- [All Replit guides](https://shipfast.online/rescue/)
- [Free production readiness check](https://shipfast.online/tools/production-readiness-check/)
