You’ll need a Stripe account to follow this tutorial. Free to create - no charges until you process real payments.
What you’ll set up
By the end of this tutorial, your app will have:- A pricing page with plan options
- A Stripe Checkout flow for processing payments
- Webhook handling for payment events (successful charges, subscription changes)
- Test mode verification before going live
Connect Stripe
Get your Stripe API keys
Log into your Stripe Dashboard and copy your publishable key and secret key. Make sure you’re in test mode (toggle in the top-right of the Stripe dashboard).You’ll have two pairs of keys:
- Test keys - for development and testing (start with
pk_test_andsk_test_) - Live keys - for real payments (start with
pk_live_andsk_live_)
Add keys to your Rocket app
Ask Rocket to set up Stripe integration with your keys:Rocket will store your secret key securely as an environment variable and configure the Stripe SDK in your app.
Build a pricing page
Ask Rocket to create a pricing page that displays your plans and links to Stripe Checkout.Set up Stripe Checkout
Stripe Checkout is a hosted payment page that handles card input, validation, and compliance for you. Ask Rocket to wire up the checkout flow:- User clicks a plan on your pricing page
- Your app creates a Stripe Checkout session on the server
- User is redirected to Stripe’s hosted payment page
- After payment, user returns to your success page
Stripe Checkout handles PCI compliance, card validation, 3D Secure, and local payment methods automatically. You don’t need to build a custom payment form.
Handle webhooks
Webhooks let Stripe notify your app when payment events happen - a charge succeeds, a subscription renews, or a payment fails.Get your webhook secret
In the Stripe Dashboard, go to Developers → Webhooks and add an endpoint pointing to your app’s webhook URL. Stripe will give you a webhook signing secret (starts with
whsec_).Add this secret as an environment variable in your Rocket app.Test your payment flow
Before going live, test everything end-to-end in Stripe’s test mode.Use test card numbers
Stripe provides test card numbers for different scenarios:
Use any future expiration date, any 3-digit CVC, and any billing zip code.
| Card number | Scenario |
|---|---|
4242 4242 4242 4242 | Successful payment |
4000 0000 0000 3220 | Requires 3D Secure authentication |
4000 0000 0000 9995 | Payment declined |
Test the full flow
Walk through the complete payment path:
- Go to your pricing page
- Click a plan’s checkout button
- Complete payment with a test card
- Verify you land on the success page
- Check the Stripe Dashboard to confirm the payment appears
Test webhooks locally
Use the Stripe CLI to forward webhook events to your staging environment for testing:Trigger a test event and verify your webhook handler processes it correctly.
What’s next?
Security checklist
Ensure API keys and payment flows are locked down.
Launch your site
Test payment flows in staging before going live.
Deploy to the web
Publish your app with payments to a live URL.
Prompting for Build
Write better prompts for app features and integrations.

