// Example server endpoint (Node.js)
const stripe = require('stripe')('sk_test_...');
app.post('/create-checkout-session', async (req, res) => {
const session = await stripe.checkout.sessions.create({
ui_mode: 'hosted', // or 'embedded' for embedded checkout
line_items: [
{
price: 'price_1T4QhLKBFZ7YuY8uru1onpSo', // Vintage Yester-Logo Tote
quantity: 1,
adjustable_quantity: {
enabled: true,
minimum: 0,
maximum: 99
}
},
{
price: 'price_1T4QeeKBFZ7YuY8ugoEs8TSa', // Tote Bag
quantity: 1,
adjustable_quantity: {
enabled: true,
minimum: 0,
maximum: 99
}
},
{
price: 'price_1T4QWfKBFZ7YuY8u4YCNfkqN', // Yestermorrow T-Shirt
quantity: 1,
adjustable_quantity: {
enabled: true,
minimum: 0,
maximum: 99
}
},
{
price: 'price_1T4QULKBFZ7YuY8u69uOa7A7', // Vintage Yester-Logo Shirt
quantity: 1,
adjustable_quantity: {
enabled: true,
minimum: 0,
maximum: 99
}
}
],
mode: 'payment',
success_url: 'https://yoursite.com/success',
cancel_url: 'https://yoursite.com/cancel',
});
res.json({ url: session.url });
});