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

248
Vistas
Cannot charge a customer that has no active card

So I am getting the error in Stripe that "Cannot charge a customer that has no active cards". I am using node js for this

Payment Code is given below

try {
    const customer = await stripe.customers.create({
      email: req.body.email,
      source: req.body.id,
    });

    const payment = await stripe.charges.create(
      {
        amount: req.body.totalAmount * 100,
        currency: "inr",
        customer: customer.id,
        receipt_email: req.body.email,
        confirm: true,
        off_session: true,
      },
      {
        idempotencyKey: uuidv4(),
      }
    );

And I am getting the following error

type: 'StripeCardError',
  raw: {
    code: 'missing',
    doc_url: 'https://stripe.com/docs/error-codes/missing',
    message: 'Cannot charge a customer that has no active card',
    param: 'card',
    type: 'card_error',
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Log out req.body.id as that might be null and then investigate why your frontend is not passing that parameter to your backend.

Second, confirm and off_session are not supported parameters on the /v1/charges endpoint.

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