-
Notifications
You must be signed in to change notification settings - Fork 72
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
Mean-Sean Stack. #7
Comments
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. |
Thanks - I am muddling thru it it, kinda of... I am just not sure how to set the published key, |
I can give you access to my repo. From: Ben Drucker <notifications@github.commailto:notifications@github.com> Reply to this email directly or view it on GitHubhttps://github.com//issues/7#event-237613309. |
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. |
It is on BitBucket...is that still ok? From: Ben Drucker <notifications@github.commailto:notifications@github.com> 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. |
I don't maintain an account there. If you can post code here I can help. |
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 From: Ben Drucker <notifications@github.commailto:notifications@github.com> 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. |
Sorry but I don't have time to dissect someone's enormous boilerplate project. You inject |
Thanks ben! From: Ben Drucker <notifications@github.commailto:notifications@github.com> 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. |
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) { |
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. |
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... Thanks for the education.....I sometimes have a hard time wrapping my head around this stuff! |
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. |
Hey @bendrucker, I'm getting the same error mentioned at the beginning of this thread.
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 |
@benjamincharity Sounds a lot like |
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! |
@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> |
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. |
I am using the sean-generator, I keep getting:
Error: [$injector:modulerr] Failed to instantiate module angular-stripe due to:
TypeError: Cannot read property 'setPublishableKey' of undefined
at new module.exports (http://localhost/lib/angular-stripe/release/angular-stripe.js:18:34)
I am not just learning angular can someone explain how I can fix this.. with that platform. Would be greatley appreciated.
The text was updated successfully, but these errors were encountered: