make braintree.js work on frontend and backend