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

243
Views
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 answers
Answer question

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 Report
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!