Giter Site home page Giter Site logo

stripe-angular's People

Contributors

bitdeli-chef avatar bsiddiqui avatar gtramontina avatar seibar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar

stripe-angular's Issues

the stripe API gets called even when a non "submit" button into the form is pressed

I have a form with various steps, the last one is the "review order" one with the confirm button, that charges the user.
this section is accessible only if the user has already a stripe single-use token generated for him in the previous step, where the form gets submitted and the response is handled.
By the way, even if the button in the final step isn't a submit button, the form gets submitted again, the stripe's api gets called with i don't know what values and the api respondes with a 400(Bad Request) status code.

EDIT(workaround)
changing the button to an a fixes the problem and the form doesn't get submitted again.

previous:

<button class="btn btn-primary" ng-click="charge()">Confirm</button>

edited:

<a class="btn btn-primary" ng-click="charge()">Confirm</a>

Have an error on javascript console about stripe network

I got following error on javascript console:

m.stripe.network/inner.html#referrer=http%3A%2F%2Flocalhost%3A3000%2Fcampai…c78-d54be95e7fe1&sid=50ce770d-87a4-434c-a162-0da7cb878503&preview=false&:1 Uncaught (in promise) undefined

But all process like downgrade, upgrade plan is working fine. Don't know what is this issue is about.

Failed to instantiate due to Unknown Provider

I get this error Failed to instantiate module myApp due to: Error: [$injector:unpr] Unknown provider: Stripe

When I try to include the library as follows:

angular.module('myApp', ['stripe]).config(function (Stripe) { Stripe.setPublishableKey('my_key'); })

Both uppercase and lowercase fail.

This was installed with bower and I see stripe-angular in my bower_components folder.

TypeError: Cannot read property 'apply' of undefined

angular.module('stripe', []).directive('stripeForm', ['$window',
function($window) {

  var directive = { restrict: 'A' };
  directive.link = function(scope, element, attributes) {
    if(!$window.Stripe){
      throw 'stripeForm is not included in the HTML.';
    }
    var form = angular.element(element);
    form.bind('submit', function() {
      var button = form.find('button');
      button.prop('disabled', true);

      // can either pass an object or can parse a form with data-stripe attributes
      $window.Stripe.createToken(form[0], function() {
        // after getting token, reenable form
        button.prop('disabled', false);
        console.log(scope[attributes.stripeForm]);console.log(scope);
        var args = arguments;
        scope.$apply(function() {
          scope[attributes.stripeForm].apply(scope, args);
        });
      });
    });
  };
  return directive;
}]);

Here is the full error:

TypeError: Cannot read property 'apply' of undefined
at http://localhost:8100/lib/stripe-angular/stripe-angular.js:22:39
at Scope.$eval (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20326:28)
at Scope.$apply (http://localhost:8100/lib/ionic/js/ionic.bundle.js:20424:23)
at http://localhost:8100/lib/stripe-angular/stripe-angular.js:21:15
at Object.e.request.success (https://js.stripe.com/v2/:1:1697)
at window.(anonymous function) (https://js.stripe.com/v2/:1:10496)
at https://api.stripe.com/v1/tokens?card[number]=4242424242424242&card[cvc]=12…er_agent=stripe.js%2F4871079&callback=sjsonp1418772119600&_method=POST:1:1

This code is exactly the same as what exists in your stripe-angular.js file as far as I can tell. What would cause this issue to happen?

There were also a few gaps in the setup of stripe-angular in my project. Not sure if this is an error on my part of if there is something else missing from the docs here.

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.