Follow this complete guide to set up Stripe and start accepting $9.99 payments for 30-day yard sale listings. Choose between two easy methods!
Easiest method! No backend required. Just create a Payment Link in Stripe Dashboard and paste it into your code.
More control. Use Stripe's API with your own backend. Collect custom data and automate processes.
The easiest way to accept payments - no backend server required!
If you don't have one already:
Testing Mode: Stripe starts in "test mode" so you can test everything without real money. Switch to "live mode" when ready to accept real payments.
In your Stripe Dashboard:
https://yourdomain.com/list-your-yard-sale?payment=success
https://buy.stripe.com/XXXXXXXXXXXXX)
Tell your AI assistant:
// Message to send to your AI assistant:
"Please update the Stripe Payment Link in the how-it-works page JavaScript file. Replace the STRIPE_PAYMENT_LINK variable with my actual Stripe Payment Link URL: https://buy.stripe.com/XXXXXXXXXXXXX"
Important: Replace
https://buy.stripe.com/XXXXXXXXXXXXX with your
actual Payment Link URL from Step 2.
Make sure everything works:
4242 4242 4242 4242
Test Cards: Visit Stripe's testing documentation for more test card numbers.
When ready to accept real payments:
You're Done! Your website can now accept payments for yard sale listings. Stripe will deposit funds into your bank account automatically.
Stripe charges a standard processing fee:
2.9% + $0.30
Per successful card charge
$9.40
From each $9.99 listing sold
Use Stripe's API with your own backend for more control and automation
This method requires:
User clicks "Pay"
Your server creates session
Stripe processes payment
Webhook confirms & creates listing
Security: NEVER expose your Secret key in frontend JavaScript! Always keep it on your server.
Choose your backend language:
npm install stripe express
pip install stripe flask
composer require stripe/stripe-php
Example Node.js/Express endpoint:
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
const express = require('express');
const app = express();
app.use(express.json());
app.post('/api/create-checkout-session', async (req, res) => {
try {
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [
{
price_data: {
currency: 'usd',
product_data: {
name: '30-Day Yard Sale Listing',
description: 'Premium listing with photos and map placement',
},
unit_amount: 999, // $9.99 in cents
},
quantity: 1,
},
],
mode: 'payment',
success_url: `${req.headers.origin}/list-your-yard-sale?payment=success&session_id={CHECKOUT_SESSION_ID}`,
cancel_url: `${req.headers.origin}/list-your-yard-sale?payment=cancel`,
metadata: {
// Store custom data about the listing
userId: req.body.userId,
listingData: JSON.stringify(req.body.listingData),
},
});
res.json({ url: session.url });
} catch (error) {
res.status(500).json({ error: error.message });
}
});
app.listen(3000, () => console.log('Server running on port 3000'));
Tell your AI assistant to uncomment the "Option 2" code in the how-it-works page JavaScript and update the backend URL:
// Message to send to your AI assistant:
"Please update the how-it-works JavaScript file. Uncomment the 'Option 2' Checkout API code and replace 'https://your-backend.com' with my actual backend URL: https://myapi.example.com"
Webhooks ensure you're notified when payments succeed:
https://yourapi.com/webhook
checkout.session.completed
Example webhook handler:
app.post('/webhook', express.raw({type: 'application/json'}), (req, res) => {
const sig = req.headers['stripe-signature'];
try {
const event = stripe.webhooks.constructEvent(
req.body,
sig,
process.env.STRIPE_WEBHOOK_SECRET
);
if (event.type === 'checkout.session.completed') {
const session = event.data.object;
// Create the yard sale listing in your database
const listingData = JSON.parse(session.metadata.listingData);
// TODO: Save listing to database
// database.createListing(listingData);
console.log('Payment successful! Creating listing...');
}
res.json({received: true});
} catch (err) {
res.status(400).send(`Webhook Error: ${err.message}`);
}
});
Automatically create listings in your database when payment succeeds
Pass listing details directly through the payment flow
Send confirmation emails and notifications automatically
Track conversions, refunds, and customer behavior