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

206
Views
collect user inputs using Nodejs and Stripe

I'm new with Node.js I want to collect user data like name, phone number, Gmail, city ...etc using nodejs & stripe. So that I can know the user from stripe dashboard with all their information.

server side

app.post("/charge", (req, res) => {
    try {
        stripe.customers
            .create({
                name: req.body.name,
                email: req.body.email,
                source: req.body.stripeToken
            })
            .then(() => res.render("succ.html"))
            .catch(err => console.log(err));
    } catch (err) {
        res.send(err);
    }
});

when I use this code I just take the name and Gmail from user...IDK what elements can I use to take phone number and city ...etc.

scripts.js

const stripeTokenHandler = token => {
    const hiddenInput = document.createElement('input');
    hiddenInput.setAttribute('type', 'hidden');
    hiddenInput.setAttribute('name', 'stripeToken');
    hiddenInput.setAttribute('value', token.id);
    form.appendChild(hiddenInput);

    form.submit();
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you can save the phone number and address in customer object's shipping property. See https://stripe.com/docs/api/customers/object#customer_object-shipping

You might also want to check out Stripe Checkout. The Checkout page provides built-in input elements to collect customer info, including phone number and billing/shipping address. See https://stripe.com/docs/payments/checkout/phone-numbers

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!