Birch logo Built with Birch - Build and sell agents without coding
\n","// Python - Create a customer\nimport stripe\nstripe.api_key = 'sk_test_your_secret_key'\n\ncustomer = stripe.Customer.create(\n email='customer@example.com',\n description='My First Customer'\n)","// Node.js - Handle webhook\nconst express = require('express');\nconst app = express();\n\napp.post('/webhook', express.raw({type: 'application/json'}), (req, res) => {\n const sig = req.headers['stripe-signature'];\n let event;\n try {\n event = stripe.webhooks.constructEvent(req.body, sig, 'whsec_your_webhook_secret');\n } catch (err) {\n return res.status(400).send(`Webhook Error: ${err.message}`);\n }\n if (event.type === 'payment_intent.succeeded') {\n const paymentIntent = event.data.ob... (100 more characters)","// React - Stripe Checkout integration\nimport { loadStripe } from '@stripe/stripe-js';\nconst stripePromise = loadStripe('pk_test_your_publishable_key');\n\nconst handleCheckout = async () => {\n const stripe = await stripePromise;\n const response = await fetch('/create-checkout-session', { method: 'POST' });\n const session = await response.json();\n await stripe.redirectToCheckout({ sessionId: session.id });\n};"],"integrationSteps":["Create a Stripe account at stripe.com and verify your email address","Navigate to the Developers section in your Stripe Dashboard","Obtain your API keys (Publishable key and Secret key) from the API keys page","Install the Stripe library for your programming language (e.g., npm install stripe for Node.js, pip install stripe for Python)","Initialize the Stripe SDK in your application using your Secret key","Set up your product catalog and pricing in the Stripe Dashboard or via API","Implement the payment flow on your frontend using Stripe Elements or Checkout","Create a backend endpoint to handle payment intent creation and confirmation","Set up webhooks to receive real-time payment notifications","Configure webhook endpoints in your Stripe Dashboard","... 5 more items"],"testingChecklist":["Test successful payment with test card 4242 4242 4242 4242","Test declined payment with test card 4000 0000 0000 0002","Test authentication required (3D Secure) with card 4000 0025 0000 3155","Verify webhook endpoint receives and processes events correctly","Test refund functionality for completed payments","Verify payment intent creation with correct amount and currency","Test handling of insufficient funds with card 4000 0000 0000 9995","Verify customer creation and retrieval","Test subscription creation and cancellation flows","Verify proper error handling for network failures and API errors","... 10 more items"],"securityBestPractices":["Never expose your Secret API key in client-side code or public repositories","Store API keys as environment variables and use secure secret management systems","Always verify webhook signatures to ensure requests are from Stripe","Use HTTPS for all communication between your server and Stripe","Implement idempotency keys for POST requests to prevent duplicate charges","Validate all payment amounts and currency on the server-side, never trust client input","Use Stripe's built-in fraud detection tools like Radar","Implement proper authentication and authorization before processing payments","Log and monitor all payment transactions for suspicious activity","Keep your Stripe SDK and dependencies up to date with security patches","... 6 more items"],"paymentIntegrationWalkthrough":"STRIPE PAYMENT INTEGRATION GUIDE:\n\n1. SETUP & CONFIGURATION:\n- Create Stripe account at stripe.com and verify business details\n- Obtain API keys from Stripe Dashboard: Publishable Key (frontend) and Secret Key (backend)\n- Install Stripe libraries: 'npm install @stripe/stripe-js @stripe/react-stripe-js' (frontend) and 'npm install stripe' (backend)\n- Store Secret Key in backend environment variables, never expose in frontend code\n\n2. BACKEND IMPLEMENTATION:\n- Initialize Stripe with secret key: co... (2532 more characters)"}}},"actions":[{"id":"run","path":"/run","method":"POST","stream":false,"bodyTemplate":{"websitePurpose":"{{websitePurpose}}","monetizationModel":"{{monetizationModel}}","preferredPaymentSystem":"{{preferredPaymentSystem}}"}}],"runtime":{}}};