Skip to main content

Overview

Stripe is a payment platform for accepting money online. With superun’s Stripe integration, add payments to your app — one-time checkout, subscriptions, and marketplace flows.
⚠️ Important: For WeChat Pay or Alipay, use the dedicated guides — not Stripe. Stripe fits international payments (cards, digital wallets, etc.). For China-local methods, use the dedicated payment docs.
You can set up Stripe entirely through chat. Chat-driven setup (recommended) Connect superun Cloud (or Supabase), set Stripe credentials under Build → Skill Library → Stripe (see below), then describe what you need in chat: “Add three subscription tiers: Basic 9/month,Pro9/month, Pro 29/month, Enterprise 99/month""Createonetimecheckoutformyebookat99/month"* *"Create one-time checkout for my ebook at 29” “Add a payment form on my product page” superun generates checkout UI, database tables, and payment logic — no manual code or webhooks unless you ask.
  • For one-time sales, ensure cart or product pages work.
    • For subscriptions, enable auth on superun Cloud (or Supabase) so Stripe customers link to each user id.

Key points

  • Use the chat-driven flow for subscriptions and one-time payments.
  • Never paste Stripe secret keys in chat. Set STRIPE_API_KEY under Build → Skill Library → Stripe.
  • Webhooks are optional. If you use them, set STRIPE_WEBHOOK_SECRET so superun can verify events.
  • Debug in browser console → Network/Errors, superun Cloud → Logs, and Stripe Dashboard → Logs.
  • Always test in Stripe test mode before going live.

What is Stripe

Stripe provides payment APIs and tools:
  • Payment processing: Cards, digital wallets, local methods (Note: WeChat Pay and Alipay use dedicated guides)
  • Subscriptions: Recurring billing and subscription management
  • Marketplace: Multi-party payments and marketplace features
  • Connect: Platform payments for marketplaces
  • Billing: Invoices and billing management
  • Tax: Automatic tax calculation and compliance
💡 Tip: For WeChat Pay or Alipay, see the dedicated integration guides.

Key benefits

  • Global reach: Accept payments worldwide
  • Many payment methods: Cards, wallets, bank transfers, and more
  • Developer-friendly: Well-documented APIs and strong DX
  • Compliance: PCI DSS handling for sensitive payment data
  • Real-time: Instant processing and webhook notifications

Requirements

Before integrating Stripe:
  • Project must connect to superun Cloud (or Supabase). Learn about superun Cloud or Supabase integration
  • A Stripe account with products configured (for subscriptions)
  • A working frontend
  • For one-off products, cart and checkout must work.
  • For subscriptions, login and pricing tiers.
Please note Stripe does not work in Preview alone. Deploy the project to test. Use Stripe test mode when trying payments. Test card: 4242 4242 4242 4242, any future expiry, any 3-digit CVC.

Stripe setup (no-code chat flow)

superun generates Stripe logic for you. After STRIPE_API_KEY (and optional STRIPE_WEBHOOK_SECRET) are set under Build → Skill Library → Stripe and the project is on superun Cloud (or Supabase), describe needs in chat — no manual coding.
1

Step 1: Prepare your project

  • superun Cloud (or Supabase) connected
  • Stripe keys set under Build → Skill Library → Stripe
  • (Optional) Price or product IDs from the Stripe Dashboard
2

Step 2: Describe payments in chat

Examples:“Create one-time checkout for my ‘Digital course’ at 29""SetupanannualPremiumplanat29"* *"Set up an annual Premium plan at 99 tied to each user ID” “Add three tiers: Basic 9/mo,Pro9/mo, Pro 29/mo, Enterprise $99/mo” “Create a payment form on my product page”
3

Step 3: Review and apply

superun scaffolds payment components, database tables (with superun Cloud), and UI tied to user IDs. Review preview, then click Apply to deploy.
  • Subscriptions should link to authenticated user id in superun Cloud (or Supabase) for secure, role-based access.

Getting started

1. Create a Stripe account

  1. Go to Stripe.com and sign up
  2. Complete account setup
  3. Verify business details
  4. Activate the account (test mode is available immediately)

2. Get your API keys

In the Stripe Dashboard:
  1. Go to Developers → API keys
  2. Copy your publishable key (pk_test_ or pk_live_)
  3. Copy your secret key (sk_test_ or sk_live_)
  4. Keep secrets safe — never expose them in client code
Important security noticeNever paste your secret key into superun chat. Store it under Build → Skill Library → Stripe instead.

3. Configure Stripe in superun

Two ways to enable Stripe:
  1. In your project, open Build
  2. Open Skill Library and select Stripe
  3. Paste your Stripe Secret Key in STRIPE_API_KEY (e.g. sk_test_... or sk_live_...)
  4. (Optional) Paste Webhook signing secret in STRIPE_WEBHOOK_SECRET (e.g. whsec_...) if you use webhooks
  5. Click Save Changes and wait until Stripe shows as enabled
superun configures Stripe from these credentials.

Option 2: Enable via chat

Ask superun in chat:
Or:
superun walks you through setup. When prompted, add keys via Build → Skill Library.

Manual payment setup (advanced)

Recommended: Use the chat-driven flow above for the simplest path. The sections below are for advanced users who implement payments manually or customize generated code.

Install the Stripe SDK

Enabling Stripe in superun includes the SDK; you can also install manually:

Initialize Stripe

One-time payments

Create a PaymentIntent

Process payment

Subscriptions

Create a subscription

Subscription management

Customer management

Create a customer

Customer portal

Advanced integration: Webhooks and superun Cloud

For complex payment setups such as subscriptions and role-based access, superun recommends superun Cloud (or Supabase) to handle Stripe securely — webhooks, subscription state, and access by payment tier.
For basic payments, webhooks are optional. superun can process payments without them; webhooks improve realtime updates and subscription management.

Set up webhooks

1

Step 1: Connect superun Cloud

Getting started is straightforward:
  1. Go to Build → Skill Library
  2. Find superun Cloud and click Enable
  3. Follow the setup flow for your cloud project
  4. Once connected, superun Cloud supports secure payments, subscriptions, webhooks, customer storage, and error handling.
2

Step 2: Get the webhook endpoint URL

After superun generates a webhook handler, get the endpoint URL from:
  • superun CloudFunctions → your webhook function
  • Or ask in chat: “What is my Stripe webhook endpoint URL?”
3

Step 3: Configure webhooks in Stripe Dashboard

  1. Go to Stripe DashboardDevelopersWebhooksAdd endpoint
  2. Enter the webhook URL from step 2
  3. Select events to listen for:
  • payment_intent.succeeded
  • payment_intent.payment_failed
  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted
  1. Copy the webhook signing secret (whsec_...)
4

Step 4: Store the webhook secret securely

Save the signing secret in superun Cloud environment variables, or ask superun in chat to configure it safely.
If you are unsure how to name the secret, ask superun in free consultation mode.

Handle webhooks

Advanced features

Payment methods

Invoices

Marketplace payments

Test your integration

Test mode setup

  • Use Stripe test mode before going live
  • Switch to test mode in the Stripe Dashboard (toggle top-right)
  • Use test API keys (pk_test_ and sk_test_)

Test cards

Use these test card numbers:
  • Success: 4242 4242 4242 4242
    • Any future expiry (e.g. 12/25)
    • Any 3-digit CVC (e.g. 123)
  • Declined: 4000 0000 0000 0002
  • Requires authentication: 4000 0025 0000 3155
  • Insufficient funds: 4000 0000 0000 9995
Important: Stripe integration does not work in Preview alone. Deploy your app to test.

Test scenarios

Security best practices

Environment variables

Server-side validation

Webhook security

Common patterns

Payment form component

Subscription status component

Debugging and troubleshooting

1

Step 1

Open Developer Tools (Chrome: right-click → Inspect → Console).
2

Step 2

Look for errors and payment event logs.
3

Step 3

Copy error messages and ask superun in chat for help debugging.
1

Step 1

Go to Build → Skill Library → superun Cloud
2

Step 2

Open Logs or FunctionsLogs
3

Step 3

Check webhook errors and payment processing issues.
1

Step 1

Go to Stripe DashboardDevelopersWebhooks
2

Step 2

Click your webhook endpoint
3

Step 3

Open Events to confirm Stripe is sending data correctly.
1

Step 1

Switch to free consultation and ask follow-up questions.
2

Step 2

Describe the issue step by step: “My payment form does not show” “Subscription was not created” “Webhook is not working”
3

Step 3

Use the rubber duck approach — explain the problem aloud to clarify it.

Common issues

Q: Payment failed with “Your card was declined” A: This may be because:
  • Using test cards in live mode (or the reverse)
  • Insufficient funds (use test card 4242 4242 4242 4242)
  • Card not enabled for online payments
  • Incorrect card details
  • Bank blocked the transaction
Q: Webhook not received A: Check:
  • Webhook URL is reachable from the internet
  • Endpoint returns HTTP 200
  • Webhook signing secret is correct
  • Correct events selected in Stripe Dashboard
  • You are testing on a deployed build (not Preview only)
Q: Test payment does not work A: Ensure:
  • Test API keys (pk_test_ and sk_test_)
  • Correct test card (4242 4242 4242 4242)
  • Amount in cents (e.g. $10.00 = 1000)
  • App is deployed (Stripe does not work in Preview alone)
  • Stripe test mode is on in the Dashboard
Q: Subscription webhook did not fire A: Verify:
  • Subscription was created successfully
  • Webhook events include subscription types
  • Endpoint handles events correctly
  • Webhook secret is stored correctly in superun Cloud

Need help?

See our FAQ for common Stripe integration issues and troubleshooting tips.