Giter VIP home page Giter VIP logo

braintree's People

Contributors

maxjgoldberg12 avatar patrickml avatar pem-- avatar sam-kamerer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

braintree's Issues

Meteor 1.3

Thank you for taking the time to wrap the braintree library. But now that you can use the npm package directly, you should put a note in the README.md to advice new users to use the npm package directly.

Do we also need the client SDK along with this package?

I am a little confused looking at the Braintree documentation and matching it with this package. According to Braintree, we need a client SDK and server SDK for the payment features. Also not sure how to get the nonceFromTheClient.

Does this package include both? If not, do you recommend any client package with this?

Thanks

TypeError: undefined is not a function

Hi,

I keep getting the following error when I run this bit of code:

"TypeError: undefined is not a function
at app/test-braintree.js:3:31 at app/test-braintree.js:23:3"

I'm a bit new to meteor, but I think the error has to do with defining BrainTreeConnect. How do I do that (if that is the actual source of the error)?

 if (Meteor.isServer) {

   var BrainTreeConnect = BrainTreeConnect({
     environment: Braintree.Environment.Sandbox,
     merchantId: "merchantId",
     publicKey:  "publicKey",
     privateKey: "privateKey"
   });

   return BrainTreeConnect.customer.create({
      firstName: "Jen",
       lastName: "Smith",
       company: "Braintree",
       email: "[email protected]",
       phone: "312.555.1234",
       fax: "614.555.5678",
       website: "www.example.com"
   });


}

Cannot call method 'baseUrl' of undefined

Hi Patrick,

Just added your package trying to get some API calls going. However, when doing the BrainTreeConnect = BrainTreeConnect(key) call from your example I get an error:

TypeError: Cannot call method 'baseUrl' of undefined
    at Config.baseUrl (/Users/Ricardo/.meteor/packages/patrickml_braintree/.1.0.2.g562y++os+web.browser+web.cordova/npm/node_modules/braintree/lib/braintree/config.js:36:29)
    at Config.baseMerchantUrl (/Users/Ricardo/.meteor/packages/patrickml_braintree/.1.0.2.g562y++os+web.browser+web.cordova/npm/node_modules/braintree/lib/braintree/config.js:40:17)
    at new TransparentRedirectGateway (/Users/Ricardo/.meteor/packages/patrickml_braintree/.1.0.2.g562y++os+web.browser+web.cordova/npm/node_modules/braintree/lib/braintree/transparent_redirect_gateway.js:39:34)
    at new BraintreeGateway (/Users/Ricardo/.meteor/packages/patrickml_braintree/.1.0.2.g562y++os+web.browser+web.cordova/npm/node_modules/braintree/lib/braintree/braintree_gateway.js:66:32)
    at new connect (/Users/Ricardo/.meteor/packages/patrickml_braintree/.1.0.2.g562y++os+web.browser+web.cordova/npm/node_modules/braintree/lib/braintree.js:40:10)
    at BrainTreeConnect (packages/patrickml:braintree/braintree.js:16:1)
    at repl:1:21
    at /Users/Ricardo/Desktop/Meteor/relogo/.meteor/local/build/programs/server/shell-server.js:243:23

I run the app from localhost.

Any idea what causes this?

BrainTreeConnect is undefined

Hi there-

I am having trouble implementing this set of code into my app. I keep getting two errors:

"ReferenceError: BrainTreeConnect is not defined"
&
"'ReferenceError: Braintree is not defined"

Any help? Here is the code from my server, located in braintree-config.js.

if (Meteor.isServer) {
Meteor.methods({
    createClientToken: function() {

        var bt = BrainTreeConnect({
            environment: /*process.env.PRODUCTION && Braintree.Environment.Production || */ Braintree.Environment.Sandbox,
            merchantId: merchantId,
            publicKey: publicKey,
            privateKey: privateKey
        });

        console.log(bt);

        return bt.clientToken.generate({
            customerId: Meteor.users.findOne(this.userId).profile.billing.customerId
        }).clientToken;
    }
});
}

Thank you very much!

Error: braintree is not defined

Hi, maybe this is just a documentation issue, but I am getting a Error: braintree is not defined. Do I need to install Braintree? It is not clear if that is my issue or perhaps there is something else going on. Here is the code (keys removed) and the error:
var customer;
try{
var bt = BrainTreeConnect({

    environment:  braintree.Environment.Sandbox,
    merchantId:   '...',
    publicKey:    '...',
    privateKey:   '...'
});
customer = bt.customer.create(config);
console.log("customer:",customer);

} catch(error){
throw new Meteor.Error(1001, error.message);
}

W20150913-23:13:01.481(-5)? (STDERR) Error: braintree is not defined [1001]
W20150913-23:13:01.481(-5)? (STDERR) at app/server/braintree.js:21:11
W20150913-23:13:01.481(-5)? (STDERR) at app/server/braintree.js:24:3
W20150913-23:13:01.481(-5)? (STDERR) at /Users/turbogeek/work/q_again/quantum/.meteor/local/build/programs/server/boot.js:222:10
W20150913-23:13:01.481(-5)? (STDERR) at Array.forEach (native)
W20150913-23:13:01.481(-5)? (STDERR) at Function..each..forEach (/Users/turbogeek/.meteor/packages/meteor-tool/.1.1.3.96aw17++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150913-23:13:01.481(-5)? (STDERR) at /Users/turbogeek/work/q_again/quantum/.meteor/local/build/programs/server/boot.js:117:5

Passing client token back into the form

Hi,

I'm trying to interpolate the client token with the client javascript after I generate it server side.

The client token is generated properly, using the following code:

getClientToken: function(){
   var token = bt.clientToken.generate({});
   console.log(token.clientToken);
   return token.clientToken;
}

What do I do with token.clientToken to pass it into the client side?

Globally Settings BT Settings

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
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.