Overview
Stripe is a payment processing platform that allows you to accept payments online. With Superun’s Stripe integration, you can easily add payment functionality to your applications, including one-time payments, subscriptions, and marketplace features. Superun now lets you set up Stripe entirely through chat. Chat‑driven auto‑setup (recommended)After you connect Superun Cloud (or Supabase) and save your Stripe Secret Key via Build tab → Service section, just describe what you need:
- “Add three subscription tiers: Basic at 29/month, and Enterprise at $99/month”
- “Create a one‑time checkout for my e‑book at $29”
- “Set up a payment form for my product page”
- For one‑off sales, be sure your cart or product page already works.
- For subscriptions, confirm Superun Cloud (or Supabase) Auth is in place so Superun can link Stripe customers to each user’s id
Key takeaways
- Use the chat‑driven flow for both subscriptions and one‑off payments.
- Never paste your Stripe Secret Key in chat. Configure it via Build tab → Service section → Stripe → Enable.
- Webhooks are opt‑in. Superun can handle payments without webhooks, but you can set them up for advanced use cases.
- Debug in Browser Console → Network/Errors, Superun Cloud → Logs, and Stripe Dashboard → Logs.
- Always test in Stripe Test Mode, then deploy.
What is Stripe
Stripe provides a comprehensive suite of payment APIs and tools:- Payment Processing: Accept credit cards, digital wallets, and local payment methods
- Subscriptions: Recurring billing and subscription management
- Marketplace: Multi-party payments and marketplace functionality
- Connect: Platform payments for marketplaces and platforms
- Billing: Invoicing and billing management
- Tax: Automatic tax calculation and compliance
Key Benefits
- Global Reach: Accept payments from customers worldwide
- Multiple Payment Methods: Credit cards, digital wallets, bank transfers, and more
- Developer-Friendly: Well-documented APIs and excellent developer experience
- Compliance: PCI DSS compliant, handles sensitive payment data securely
- Real-time: Instant payment processing and webhook notifications
Requirements
Before integrating Stripe, ensure the following prerequisites are met:- The project must be connected to Superun Cloud (or Supabase). Learn more about Superun Cloud or Supabase integration
- A Stripe account with properly configured products (for subscriptions)
- A working frontend:
- For individual product sales, ensure a shopping cart and checkout page are functional.
- For subscriptions, set up login functionalities and different pricing tiers.
Please note
Stripe integration doesn’t work in preview. To test the integration, make sure to deploy your project. You should also make sure to be in test mode in Stripe when trying out the functionality. When testing payment, use test card number:
4242 4242 4242 4242, any 3 digits as CVC, and any future date.Stripe payment setup (No‑code chat flow)
Superun now generates all Stripe logic for you. Once your Stripe Secret Key is configured via Build tab → Service section and your project is connected to Superun Cloud (or Supabase), simply tell Superun what you need in chat—no manual coding required.1
Step 1: Prep your project
- Superun Cloud (or Supabase) connected
- Stripe Secret Key added via Build tab → Service section → Stripe → Enable
- (Optional) Prices or product IDs handy from Stripe Dashboard
2
Step 2: Describe your payment needs in chat
Examples:
- “Create a one-time checkout for my ‘Digital Course’ at $29”
- “Set up an annual Premium plan for $99, tied to each user’s id”
- “Add three subscription tiers: Basic at 29/month, and Enterprise at $99/month”
- “Create a payment form for my product page”
3
Step 3: Review & apply
Superun auto‑scaffolds the payment components, database tables (if using Superun Cloud), and UI elements (all tied to the user’s id). Check the preview, then click Apply to deploy.
- Subscriptions should always be linked to the authenticated user’s
idin Superun Cloud (or Supabase) for secure, role‑based access.
Getting Started
1. Create a Stripe Account
- Go to stripe.com and sign up
- Complete the account setup process
- Verify your business information
- Activate your account (test mode is available immediately)
2. Get Your API Keys
In your Stripe dashboard:- Go to Developers → API Keys
- Copy your Publishable Key (starts with
pk_test_orpk_live_) - Copy your Secret Key (starts with
sk_test_orsk_live_) - Keep your secret key secure and never expose it in client-side code
3. Configure Stripe in Superun
You can enable Stripe integration in two ways:Option 1: Enable via Build Service (Recommended)
- In your Superun project, go to the Build tab
- Scroll to the Service section
- Find Stripe and click Enable
- Enter your Publishable Key and Secret Key when prompted
- Choose your environment (Test or Live)
Option 2: Enable via Chat
You can also enable Stripe by asking Superun in the chat:Manual Payment Setup (Advanced)
Recommended: Use the chat-driven flow described above for the easiest setup. The following sections are for advanced users who want to implement payments manually or customize the generated code.
Install Stripe SDK
Superun automatically includes the Stripe SDK when you enable Stripe integration, but you can also install it manually:Initialize Stripe
One-Time Payments
Creating a Payment Intent
Processing Payment
Subscriptions
Creating a Subscription
Subscription Management
Customer Management
Creating Customers
Customer Portal
Advanced integration: Webhooks & Superun Cloud
For complex payment structures such as subscriptions and role-based access, Superun recommends using Superun Cloud (or Supabase) to securely handle Stripe integration. This allows for proper webhook handling, subscription management, and role-based access control based on payment tiers.Webhooks are optional for basic payment flows. Superun can handle payments without webhooks, but setting them up enables real-time updates and better subscription management.
Setting Up Webhooks
1
Step 1: Connect Superun Cloud
Getting started is simple. Superun makes connecting Superun Cloud effortless:
- Go to Build tab → Service section
- Find Superun Cloud and click Enable
- Follow the instructions to set up your cloud project
- Once connected, Superun Cloud enables secure payment processing, subscription management, webhook handling, customer data storage, and error handling.
2
Step 2: Retrieve the Webhook Endpoint URL
After Superun generates the webhook handler, retrieve the endpoint URL from:
- Superun Cloud → Functions → Your webhook function
- Or ask Superun in chat: “What’s my Stripe webhook endpoint URL?”
3
Step 3: Configure Webhook in Stripe Dashboard
- Go to Stripe Dashboard → Developers → Webhooks → Add endpoint
- Enter your webhook URL from Step 2
- Select the events you want to listen for:
payment_intent.succeededpayment_intent.payment_failedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deleted
- Copy the Webhook Signing Secret (starts with
whsec_)
4
Step 4: Store Webhook Secret Securely
Store the webhook signing secret in your Superun Cloud environment variables or ask Superun in chat to help you configure it securely.
If unsure about naming the secret, ask Superun in chat mode for guidance.
Processing Webhooks
Advanced Features
Payment Methods
Invoicing
Marketplace Payments
Testing Your Integration
Test Mode Setup
- Use Stripe’s Test Mode to safely test payments before going live
- Switch to Test Mode in Stripe Dashboard (toggle in the top right)
- Use test API keys (starts with
pk_test_andsk_test_)
Test Cards
Use these test card numbers for testing:- Successful payment:
4242 4242 4242 4242- Any future expiration date (e.g., 12/25)
- Any 3-digit CVC (e.g., 123)
- Declined payment:
4000 0000 0000 0002 - Requires authentication:
4000 0025 0000 3155 - Insufficient funds:
4000 0000 0000 9995
Important: Stripe integration does not work in preview mode. Make sure to deploy your app to test the integration.
Test Scenarios
Security Best Practices
Environment Variables
Server-Side Validation
Webhook Security
Common Patterns
Payment Form Component
Subscription Status Component
Debugging & Troubleshooting
Check Console Logs
Check Console Logs
1
Step 1
Open Developer Tools (Right-click → Inspect → Console in Chrome).
2
Step 2
Look for errors and review payment event logs.
3
Step 3
Copy error messages and ask Superun in chat for debugging assistance.
Review Superun Cloud Logs
Review Superun Cloud Logs
1
Step 1
Go to Build tab → Service section → Superun Cloud
2
Step 2
Navigate to Logs or Functions → Logs
3
Step 3
Check for webhook errors and payment processing issues.
Verify Webhook Events in Stripe
Verify Webhook Events in Stripe
1
Step 1
Navigate to Stripe Dashboard → Developers → Webhooks
2
Step 2
Click on your webhook endpoint
3
Step 3
Review the Events tab to confirm that Stripe is sending data correctly.
Use Superun Chat Mode
Use Superun Chat Mode
1
Step 1
Switch to chat mode and ask Superun follow-up questions.
2
Step 2
Describe your issue step by step:
- “My payment form isn’t showing up”
- “The subscription isn’t being created”
- “Webhooks aren’t working”
3
Step 3
Use the Rubber Duck Method & explain your issue step by step to clarify the problem.
Common Issues
Q: Payment is failing with “Your card was declined” A: This could be due to:- Using a test card in live mode (or vice versa)
- Insufficient funds (for test cards, use
4242 4242 4242 4242) - Card not supported for online payments
- Incorrect card details
- Bank blocking the transaction
- Webhook URL is accessible from the internet
- Webhook endpoint is returning 200 status
- Webhook signing secret is correct
- Events are properly selected in Stripe dashboard
- You’re testing in deployed mode (not preview)
- You’re using test API keys (
pk_test_andsk_test_) - Test card numbers are correct (
4242 4242 4242 4242) - Amount is in cents (e.g., $10.00 = 1000 cents)
- Your app is deployed (Stripe doesn’t work in preview mode)
- You’re in Test Mode in Stripe Dashboard
- Subscription is created successfully
- Webhook events are selected for subscription events
- Webhook endpoint is handling the events properly
- Webhook secret is correctly stored in Superun Cloud
Need Help?
Check our FAQ for common Stripe integration questions and troubleshooting tips.

