Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
retrieve customer email on stripe after checkout session node.js

I have this:

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

    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'],
    line_items: [
      {
        price_data: {
          currency: 'cad',
          product_data: {
            name: 'Giveaway Entry',
          },
          unit_amount: customer.price,
        },
        quantity: customer.quantity,
      },
    ],
    mode: 'payment',
    success_url: successurl,
    cancel_url: failedurl,
  });
  console.log(session)

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

it is working fantastic. Except that after the checkout session completes, it redirects me back to my page. But it doesn't store the email address that they type in (on the stripe checkout page) in the session object. so I logged it like this:

console.log(session)

and it returns:

customer_email: null

why is this happening and how can i fix it?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The Checkout Session's customer_email property is for creating a Checkout Session with an email pre-filled[1]. To see the email that your customer entered in to the Checkout form, check the Session's customer_details.email property[2].

[1] https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_email

[2] https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details-email

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda