简体   繁体   中英

Stripe create Token bank account

I'm trying to add a token to create a bank account with stripe.

tokenAccount: async (req, res) => {
    Serveur.findOne({ _id: req.user._id }, async (err, user) => {
      try {
        await stripe.tokens.create({
          bank_account: {
            country: req.body.country,
            currency: req.body.currency,
            account_number: req.body.account_number,
            routing_number: req.body.routing_number,
          },
        });
      } catch (error) {
        return res.status("402").send({ error: { message: error.message } });
      }
    });
  },

and when i test the back end with postman with a "test" bank details from stripe i have this error :

{
    "error": {
        "message": "You cannot use a live bank account number when making transfers or debits in test mode"
    }
}

Which is weird because i used the test stripe's bank details. Do you have any idea what the problem could be ???

Each Stripe account offers both live and test keys. When you use their fake test accounts (for banks, MasterCards, and the like) you must also use their test keys. Don't try to use the live keys for testing; and, honestly, be happy they caught this for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM