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 29/month, Enterprise 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 99 tied to each user ID”
“Add three tiers: Basic 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
- Go to Stripe.com and sign up
- Complete account setup
- Verify business details
- Activate the account (test mode is available immediately)
2. Get your API keys
In the Stripe Dashboard:- Go to Developers → API keys
- Copy your publishable key (
pk_test_orpk_live_) - Copy your secret key (
sk_test_orsk_live_) - Keep secrets safe — never expose them in client code
3. Configure Stripe in superun
Two ways to enable Stripe:Option 1: Skill Library (recommended)
- In your project, open Build
- Open Skill Library and select Stripe
- Paste your Stripe Secret Key in STRIPE_API_KEY (e.g.
sk_test_...orsk_live_...) - (Optional) Paste Webhook signing secret in STRIPE_WEBHOOK_SECRET (e.g.
whsec_...) if you use webhooks - Click Save Changes and wait until Stripe shows as enabled
Option 2: Enable via chat
Ask superun in chat: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:
- Go to Build → Skill Library
- Find superun Cloud and click Enable
- Follow the setup flow for your cloud project
- 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 Cloud → Functions → your webhook function
- Or ask in chat: “What is my Stripe webhook endpoint URL?”
3
Step 3: Configure webhooks in Stripe Dashboard
- Go to Stripe Dashboard → Developers → Webhooks → Add endpoint
- Enter the webhook URL from step 2
- Select events to listen for:
payment_intent.succeededpayment_intent.payment_failedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deleted
- 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_andsk_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
Check console logs
Check console logs
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.
View superun Cloud logs
View superun Cloud logs
1
Step 1
Go to Build → Skill Library → superun Cloud
2
Step 2
Open Logs or Functions → Logs
3
Step 3
Check webhook errors and payment processing issues.
Verify webhook events in Stripe
Verify webhook events in Stripe
1
Step 1
Go to Stripe Dashboard → Developers → Webhooks
2
Step 2
Click your webhook endpoint
3
Step 3
Open Events to confirm Stripe is sending data correctly.
Use superun free consultation
Use superun free consultation
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
- 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)
- Test API keys (
pk_test_andsk_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
- 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.

