Closed nstuyvesant closed 3 years ago
👋 hey @nstuyvesant, thanks for reaching out. We're aware the code snippets in our docs use the now removed connect
method. Our docs will be updated soon calling out these changes, but in the meantime I'll leave this issue open so folks are aware.
Same issue here, dropped a request to the support team. Is there a place where explain how to connect
the new way? Thanks!
Here's an example I was able to get working by looking at one of Braintree's tests...
import braintree from 'braintree';
import config from '../../config/environment';
// Gets a token from Braintree
export async function index(req, res) {
const gateway = new braintree.BraintreeGateway(config.gateway); // synchronous call
// Generate the client token
const { clientToken } = await gateway.clientToken.generate({});
res.status(200).send(clientToken);
return clientToken;
}
The readme also has an example. https://github.com/braintree/braintree_node#quick-start
If everything goes as normal, the main docs site should be updated today with the new method of instantiating a Braintree gateway object.
The docs are now updated: https://developers.braintreepayments.com/start/hello-server/node#install-and-configure
Here's a migration guide for going from v2 to v3: https://developers.braintreepayments.com/reference/general/server-sdk-migration-guide/node
General information
Issue description
On https://developers.braintreepayments.com/start/hello-server/node, the example given is:
But in 3.0.0, you deprecated the connect() method according to the CHANGELOG. The CHANGELOG also doesn't state the method that replaced it.
Can you improve your documentation? Deprecating a method like this without any advance warning creates some risk.