Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Globally Settings BT Settings #23

Open
patrickml opened this issue Dec 10, 2015 · 0 comments
Open

Globally Settings BT Settings #23

patrickml opened this issue Dec 10, 2015 · 0 comments

Comments

@patrickml
Copy link
Owner

Instead of settings the config each and everytime you want to make an API call we could have an option for globally settings them by doing something like this.

Meteor.startup(function () {
   BrainTreeConnect.setConfig({
      environment: process.env.PRODUCTION && Braintree.Environment.Production || Braintree.Environment.Sandbox,
      merchantId: Meteor.settings.BRAIN_TREE.MERCHANT_ID,
      publicKey:  Meteor.settings.BRAIN_TREE.PUBLIC_KEY,
      privateKey: Meteor.settings.BRAIN_TREE.PRIVATE_KEY
    });
});

and then in the constructor we could check for a config like so

BrainTreeConnect = function (key) {
key = key || BraintreeConnect.getConfig()
//Remaining Code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant