Balanced Payments Account debit not working with Node.js -
i trying account credit request node.js using following example. fails when use sample code without change. https://docs.balancedpayments.com/current/overview.html?language=node#charge-a-credit-card
balanced.accounts.get("/v1/marketplaces/test-mp60c88vnfhzgzeyzgcbmkic/accounts/ac1a77avbmvtut8pciwdlmjw/debits", function(err, result) { var user = balanced.accounts.nbalanced(result); user.debits.create({ amount: 1000 }, function(err, result) { /* . . . */ });
});
it fails after statement executed...
var user = balanced.accounts.nbalanced(result);
the error message is...
the following properties required , missing or null (id).
here full stack trace...
c:\users\nabeel\groupfund\node\node_modules\balanced-official\lib\nbalanced\validate.js:112 if (!callback) throw error; ^ following properties required , missing or null (id).
the original issue, yes, example supplied account debits uri when should have been account uri.
these examples have been updated in balanced documentation use customer resource. should self-contained runnable examples. see https://docs.balancedpayments.com/current/?language=node#charge-a-credit-card
Comments
Post a Comment