Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
pass metadata through stripe checkout session node.js

I have this below:

app.get('/create-checkout-session', async (req, res) => {
    let customer = {
        price: req.query.price,
        quantity: req.query.quantity,
        page: req.query.page,
        email: req.query.email,
        name: req.query.name
    }


    let successurl = 'http://localhost:1111/' + customer.page + ''
    let failedurl = 'http://localhost:1111/' + customer.page + ''
  const session = await stripe.checkout.sessions.create({
    payment_method_types: ['card'],
    customer_email: customer.email,
    line_items: [
      {
        price_data: {
          currency: 'cad',
          product_data: {
            name: customer.page
          },
          unit_amount: customer.price,
        },
        quantity: customer.quantity,
      },
    ],
    payment_intent_data: {
      metadata: {
        'desc': customer.page
      }
    },
    mode: 'payment',
    success_url: successurl,
    cancel_url: failedurl,
  })

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

I tried to pass the metadata, but it doesn't work at all. It says empty when i get the object back after. i've never had this before, and can't really figure out what's wrong. Any ideas?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!