dd2021-09-13T18:53:11+00:00

const stripe = require(‘stripe’)(‘sk_test_51JUySLCYFIaPxavqHjjKEiYM2HPivt38FcgTYBsdsjA8h7mMnzkjwMxTiwwaBJu90s4RdM3KeAkGYre0jOE4kMOp006ZpGbuAM’);
const express = require(‘express’);
const app = express();
app.use(express.static(‘public’));

const YOUR_DOMAIN = ‘https://skytopdigitalservices.com/’;

app.post(‘/create-checkout-session’, async (req, res) => {
const session = await stripe.checkout.sessions.create({
line_items: [
{
// TODO: replace this with the `price` of the product you want to sell
price: ‘{{PRICE_ID}}’,
quantity: 1,
},
],
payment_method_types: [
‘card’,
],
mode: ‘payment’,
success_url: `${YOUR_DOMAIN}/success.html`,
cancel_url: `${YOUR_DOMAIN}/cancel.html`,
});

res.redirect(303, session.url)
});

app.listen(4242, () => console.log(‘Running on port 4242’));

Go to Top