bitcoin with stripe Error: The source you provided is not in a chargeable state in node.js -


bitcoin stripe error: source provided not in chargeable state in node.js... m new in node.js , using payment bitcoin using stripe.. , how go chargeable state , chargeable state works on sandbox mode

 stripe.sources.create({                      type: "bitcoin",                      amount: amount,                      currency: "usd",                      owner: {                          email: req.body.stripeemail                      }                  }).then(function(source){                      console.log("inside source");                      console.log(source);                       return stripe.charges.create({                          amount: source.amount,                          currency: source.currency,                          source: source.id                      }).then(function(charge) {                          console.log("inside charge");                          console.log(charge);                          return res.redirect('/user');                      }).catch(function(err){                          next(err);                      });                    }).catch(function(err){                          next(err);                      });  

i didn't test bitcoins, worked stripe. https://stripe.com/docs/sources/bitcoin - @ page can find "step 3: charge source". think have setup webhook , wait event "source.chargeable". after getting event can make charge.

regarding source code: think code broken 2 parts. 1 make source , action url1, another, available url2 - handle event "source.chargeable".

hope :)


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -