Comments (18)
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.
Thanks - I am muddling thru it it, kinda of...
I am just not sure how to set the published key,
from angularjs-stripe.
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)
Reply to this email directly or view it on GitHubhttps://github.com//issues/7#event-237613309.
from angularjs-stripe.
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.
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.
I don't maintain an account there. If you can post code here I can help.
from angularjs-stripe.
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.
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.
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.
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.
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.
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.
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.
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.
@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.
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.
@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.
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)
- npm install angular-stripe doesn't build angular-stripe.js HOT 1
- Card type when user finished to add the Card Number HOT 1
- Card formatting, unable to press the backspace/delete key to edit this field HOT 1
- how to use this library into webpack+angular2+typescript project HOT 2
- Stripe v3 HOT 4
- piiData undefined HOT 1
- Version 5.0.0 doesn't export main javascript file in .bower.json HOT 1
- 5.0 change log HOT 1
- stripe.card.validateCardNumber not working
- Support with Stripe v3 HOT 1
- v5 doesn't include bower.json export of release/angular-stripe.js HOT 1
- release folder and js not included in NPM HOT 1
- Support for stripe.js v3 paymentRequest method HOT 4
- [gdpr] [lazy-load] Conditionally include Stripe.js HOT 4
- Facing an Issue in integrating angular-stripe HOT 1
- Action required: Greenkeeper could not be activated 🚨
- promise not triggered back while created token anuglar-stripe.js
- This is AngularJs not Angular HOT 1
- [question] Seems there is no possibility to set apiVersion?
- The naming of the library is misleading HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angularjs-stripe.