Skip to content

Globally Settings BT Settings #23

@patrickml

Description

@patrickml

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
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions