Git Product home page Git Product logo

Comments (18)

bendrucker avatar bendrucker commented on June 8, 2024

I really need to see code here since that error doesn't tell me anything. Happy to help here but I'm going to go ahead and close this since it's not an angular-stripe issue.

from angularjs-stripe.

countrdd avatar countrdd commented on June 8, 2024

Thanks - I am muddling thru it it, kinda of...

I am just not sure how to set the published key,

from angularjs-stripe.

countrdd avatar countrdd commented on June 8, 2024

I can give you access to my repo.

From: Ben Drucker <[email protected]mailto:[email protected]>
Reply-To: bendrucker/angular-stripe <[email protected]mailto:[email protected]>
Date: Wednesday, February 18, 2015 at 7:18 AM
To: bendrucker/angular-stripe <[email protected]mailto:[email protected]>
Cc: Dusty Countryman <[email protected]mailto:[email protected]>
Subject: Re: [angular-stripe] Mean-Sean Stack. (#7)

Closed #7#7.

Reply to this email directly or view it on GitHubhttps://github.com//issues/7#event-237613309.

from angularjs-stripe.

bendrucker avatar bendrucker commented on June 8, 2024

If it's on GH I'm willing to spend a few minutes helping you diagnose this. Do whatever you need to do and let's keep the discussion in this thread.

from angularjs-stripe.

countrdd avatar countrdd commented on June 8, 2024

It is on BitBucket...is that still ok?

From: Ben Drucker <[email protected]mailto:[email protected]>
Reply-To: bendrucker/angular-stripe <[email protected]mailto:[email protected]>
Date: Wednesday, February 18, 2015 at 7:39 AM
To: bendrucker/angular-stripe <[email protected]mailto:[email protected]>
Cc: Dusty Countryman <[email protected]mailto:[email protected]>
Subject: Re: [angular-stripe] Mean-Sean Stack. (#7)

If it's on GH I'm willing to spend a few minutes helping you diagnose this. Do whatever you need to do and let's keep the discussion in this thread.

Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-74857444.

from angularjs-stripe.

bendrucker avatar bendrucker commented on June 8, 2024

I don't maintain an account there. If you can post code here I can help.

from angularjs-stripe.

countrdd avatar countrdd commented on June 8, 2024

This is probably the easiest explanation - this is the boilerplate I used....https://github.com/meanjs/mean

I was adding angular-stripe into the applicationModuleVendorDependencies of the config.js
I think that is the problem, because I did not know where or how to set the key.

From: Ben Drucker <[email protected]mailto:[email protected]>
Reply-To: bendrucker/angular-stripe <[email protected]mailto:[email protected]>
Date: Wednesday, February 18, 2015 at 7:43 AM
To: bendrucker/angular-stripe <[email protected]mailto:[email protected]>
Cc: Dusty Countryman <[email protected]mailto:[email protected]>
Subject: Re: [angular-stripe] Mean-Sean Stack. (#7)

I don't maintain an account there. If you can post code here I can help.

Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-74857814.

from angularjs-stripe.

bendrucker avatar bendrucker commented on June 8, 2024

Sorry but I don't have time to dissect someone's enormous boilerplate project. You inject stripeProvider and call stripeProvider.setPublishableKey. Not sure what else to tell you.

from angularjs-stripe.

countrdd avatar countrdd commented on June 8, 2024

Thanks ben!

From: Ben Drucker <[email protected]mailto:[email protected]>
Reply-To: bendrucker/angular-stripe <[email protected]mailto:[email protected]>
Date: Wednesday, February 18, 2015 at 9:09 AM
To: bendrucker/angular-stripe <[email protected]mailto:[email protected]>
Cc: Dusty Countryman <[email protected]mailto:[email protected]>
Subject: Re: [angular-stripe] Mean-Sean Stack. (#7)

Sorry but I don't have time to dissect someone's enormous boilerplate project. You inject stripeProvider and call stripeProvider.setPublishableKey. Not sure what else to tell you.

Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-74868873.

from angularjs-stripe.

countrdd avatar countrdd commented on June 8, 2024

Ben. Sorry to keep bugging you, guesing I am misunderstanding the module.

is it possible to do this from this module or is it limted to the helper functions at the end of the readme.

stripe.customers.list({ limit: 3 }, function(err, customers) {
// asynchronously called
});

from angularjs-stripe.

bendrucker avatar bendrucker commented on June 8, 2024

This is a wrapper against Stripe.js which is strictly intended for tokenizing cards and bank accounts so they don't touch your server.

You're trying to call Stripe's API for application data. While you could theoretically use stripe-node via Browserify, this isn't something you should be trying to do. In order to do what you want, you'd have let the browser have access to your Stripe secret key which opens up a number of easy attack vectors for someone to get full access to your account.

from angularjs-stripe.

countrdd avatar countrdd commented on June 8, 2024

OK. Gotcha. Thanks for the explanation.

I was getting confused...

So this I just want to submit the information to stripe, grab the token returned and then send it to my restfull api server to store the token for future billing, and then on the rest side is where I Would want to implement the stripe.js to actually talk to stripe...
Correct?

Thanks for the education.....I sometimes have a hard time wrapping my head around this stuff!

from angularjs-stripe.

bendrucker avatar bendrucker commented on June 8, 2024

on the rest side is where I Would want to implement the stripe.js to actually talk to stripe

Exactly. Your client's job is to use angular-stripe to turn cards / bank accounts into tokens. Then you make charges, add customers, list customers, etc. on your server.

from angularjs-stripe.

benjamincharity avatar benjamincharity commented on June 8, 2024

Hey @bendrucker, I'm getting the same error mentioned at the beginning of this thread.

Uncaught Error: [$injector:modulerr] Failed to instantiate module clientApp due to:
Error: [$injector:modulerr] Failed to instantiate module angular-stripe due to:
TypeError: Cannot read property 'setPublishableKey' of undefined at new module.exports (http://localhost:9000/bower_components/angular-stripe/release/angular-stripe.js:18:34)

My app.js looks like this (edited for space):

angular.module('clientApp', [
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'ui.router',
  'ngStorage',
  'angular-stripe'
])

.config(function($urlRouterProvider, $locationProvider, stripeProvider) {

  //
  // UI Router
  $urlRouterProvider.otherwise('/');
  $locationProvider.html5Mode(true);

  //
  // Stripe
  stripeProvider.setPublishableKey('my_key_was_here');
})

// etc...

I also tried setting the key in a controller when that didn't work:

angular.module('clientApp')
.controller('RegisterCtrl', function($scope, stripe) {
  'use strict';

  //
  // Stripe
  //stripe.setPublishableKey('pk_test_4KOAFDT9AawsCcEBxS2GdLYJ');

// etc...

I know your original response indicated that this is not an issue with the library, but I was hoping you could point me in the correct direction since the OP didn't post how he solved it. Thanks

from angularjs-stripe.

bendrucker avatar bendrucker commented on June 8, 2024

@benjamincharity Sounds a lot like Stripe is not defined — you need to make sure to include Stripe.js before loading angular-stripe. I can put a more descriptive warning in if we can confirm that's your issue.

from angularjs-stripe.

benjamincharity avatar benjamincharity commented on June 8, 2024

Spot on @bendrucker. Grunt was apparently choking during the concat/compile phase because of the non-local resource and was just blowing away the Stripe library.

Thanks for pointing my ship in the correct direction!

from angularjs-stripe.

maxmalynowsky avatar maxmalynowsky commented on June 8, 2024

@bendrucker It's not explicitly obvious to include Stripe.js before loading angular-stripe. Can you update the readme to make this very obvious?

Example:

<script src="https://js.stripe.com/v2/"></script>
<script src="libs/angular/angular.js"></script>
<script src="libs/angular-stripe/release/angular-stripe.js"></script>

from angularjs-stripe.

bendrucker avatar bendrucker commented on June 8, 2024

angular-stripe expects Stripe.js to be available as window.Stripe

I think that's adequate. If you can think of a clearer way to phrase that I'd welcome a PR. I won't use an example that makes use of code since it assumes you're loading your scripts via tags and I don't want to encourage that.

from angularjs-stripe.

Related Issues (20)

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.