I'm using Braintree nodejs Sdk for one of my project,
I have problem to use customer.find()
function.
origina link is here
when I passed a user id like '207' directly in this way, it's working.
var braintree = require("braintree");
var gateway = require("./bt");
gateway.customer.find('207', function(err, customer) {
console.log("customer:",customer);
});
but when I tried to pass dynamic id, it's not working;
btuserID = data.userId;
gateway.customer.find(btuserID, function(err, customer) {
console.log("customer:",customer);
});
I think it's argument type is string, so how I can pass argument without double quote?
Complete error:
/home/api/node_modules/loopback-connector-mysql/node_modules/mysql/lib/protocol/Parser.js:82
throw err;
^
TypeError: undefined is not a function
at CustomerGateway.find (/home/api/node_modules/braintree/lib/braintree/customer_gateway.js:37:20)
console.log(btuserID)
on the line before thegateway.customer.find
, just to make surebtuserID
is the user id you expect it to be? – Chris DiverbtuserID
to a string before passing it tofind
. Based on the error you are getting, however, there may be another issue. Please reach out to braintree support (perhaps providing more of your server-side code) for further assistance. – cdeist