Giter VIP home page Giter VIP logo

ember-stripe-service's People

Contributors

andrasio avatar asgaroth avatar begedin avatar borwahs avatar buritica avatar dasnixon avatar ember-tomster avatar joshsmith avatar nicollejimenez avatar rileytaylor avatar runspired avatar ryanto avatar samselikoff avatar snewcomer 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

Watchers

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

ember-stripe-service's Issues

Add Inch-CI

Inch CI can crawl documentation and keep us updated on the state of documentation across the project. This is an issue for tracking the steps needed to integrate ember-stripe-service with inch-ci

  • Add inch.json and configure to crawl the correct folders
  • Add badge to README
  • Add CI web hook

FastBoot support; ReferenceError: Stripe is not defined

Injecting the stripe service into a controller that is rendered by FastBoot currently throws an exception:

Ember FastBoot running at http://[::]:4200
ReferenceError: Stripe is not defined
    at Object.initialize (/.../dist/fastboot/ui.js:903:5)

stripe v3 support?

Are there any plans to support the stripe v3 api?

the stripe docs currently state:

Starting September 2019, a new regulation called Strong Customer Authentication (SCA) will require businesses in Europe to request additional authentication for online payments. To be ready for these rule changes, we recommend that all European businesses start building their Stripe integration with either our PaymentIntents API or our new Checkout.

Migrating your Stripe integration
If your Stripe integration does not yet use Stripe.js v3 and Elements, you may wish to first update your integration accordingly before adopting PaymentIntents. It is, however, still possible to use PaymentIntents without Elements by creating a source on the client side and attaching it to the PaymentIntent.

I am not 100% sure yet if this really requires the use of v3, but still it might be a good idea to support. I noticed that there also is ember-stripe-elements which uses v3, however that appears to be no longer maintained? how is that project related to this repo?

Feature request: fetch stripe.js on demand

Most of our users and most pages in the app don't have anything to do with billing. I'd really like to be able to do something like

// route:billing
export default Ember.Route.extend({
  stripe: Ember.inject.service(),

  beforeModel: function() {
    return this.get('stripe').fetchJS();
  }
});

Where fetchJS would (a) return a resolved promise if window.Stripe is already defined, or (b) fetch and evaluate stripe.js and return a pending Promise that resolves when the library becomes available.

This would let us save a network request and some JS evaluation time for most users.

Checkout.js?

Is there any easy way to use Stripe's checkout.js with this? I'm just getting started with Stripe.

Cannot test failure modes

See emberjs/ember.js#11469

Ember's default Promise.on('error') hook causes the current test to fail if it ever encounters a reject({ anything: "here" }). Because this library uses reject to indicate that the update failed, I can't write a test that asserts that I show an appropriate error message in case of failure.

I think this should be changed in Ember, but if they're going to hold firm, we should probably change it here.

Cannot read property 'assert' of undefined during acceptance test of my app...

My process works fine when I run it normally but fails during Acceptance test.
Is it possible for you to help me figure out what I'm doing wrong?
I'm kind of new to Ember Acceptance tests so I'm probably missing something simple.

Uncaught TypeError: Cannot read property 'assert' of undefined
    at Class.asyncStart (adapter.js:10)
    at Object.asyncStart (ember.debug.js:38454)
    at Object.async (ember.debug.js:37626)
    at fulfill (ember.debug.js:58105)
    at handleMaybeThenable (ember.debug.js:58067)
    at resolve (ember.debug.js:58080)
    at resolvePromise (ember.debug.js:58216)
    at stripe.js:46
    at Object.success ((index):2)
    at Object.<anonymous> ((index):3)

make stripe.publishableKey changable via interface

use-case

we want to be able to change between testing and production based on the REST-interface we are currently using. therefore, our REST-interface should set the STRIPE_CLIENT_KEY.

workarounds

we lack a good solution to the problem, a simple interface which lets us set that value on runtime.

proposal

i could extend the library so that the key can also be set/changed during runtime. what about that?

Travis failing, latest version not in CI

Hola @buritica! ๐Ÿ˜„

I found your this stripe wrapper through emberobserver

I see that the latest build version 4.0.0 is failing: https://travis-ci.org/ride/ember-stripe-service/builds

I can see it's failing with recent versions of Ember only: https://travis-ci.org/ride/ember-stripe-service/builds/71610063

Nevertheless I see the latests version you pushed 4.1.0, although no build was triggered.

Is the build fixed in that version? Is it possible if you trigger latest build, or is there a way I can help you?

Thanks in advance! Cheers! ๐Ÿ˜ธ

Support Editing Customer Credit Cards

While this library works for creating a Stripe token for a card, there's no way to edit a credit card. I need this feature for allowing users to correct expired/failing credit cards

Cannot use in (offline) tests

In test mode (at least in environments without networking), the <script> tag that this addon injects won't run and Stripe won't be defined. That means Stripe.setPublishableKey won't exist and the initializer will fail.

The smallest change I can think of that would work (which I've used locally successfully) is

// app/services/stripe.js
function createToken (card) {
  Ember.assert("Cannot create Stripe token in test environment", config.environment !== 'test');
  // ...
}

// app/initializers/stripe-service.js
export function initialize() {
  if (config.environment === 'test') { return; }
  // ...
}

This isn't perfect, but it's pretty good. I end up stubbing out stripe.createToken whenever I need to actually run that function, with without a standard stubbing library, I can't think of a good way of doing this here.

Test error in new versions of Ember

trying to run STRIPE_PUBLISHABLE_KEY="TEST_KEY" ember try:one "ember-beta" test --skip-cleanup in a fresh environment after cloning the repo in my local machine gives me an error on the following test

Acceptance | Publishable Key: it throws an error if config.stripe.publishableKey is not set
not ok 4 PhantomJS 2.1 - Acceptance | Publishable Key: it throws an error if config.stripe.publishableKey is not set
  ---
      actual: >
          false
      expected: >
          true
      stack: >
          exception@http://localhost:7357/assets/test-support.js:13640:49
          adapterDispatch@http://localhost:7357/assets/vendor.js:52173:22
          dispatchError@http://localhost:7357/assets/vendor.js:30366:23
          invokeWithOnError@http://localhost:7357/assets/vendor.js:12778:14
          flush@http://localhost:7357/assets/vendor.js:12834:15
          flush@http://localhost:7357/assets/vendor.js:12958:20
          end@http://localhost:7357/assets/vendor.js:13028:28
          run@http://localhost:7357/assets/vendor.js:13142:19
          run@http://localhost:7357/assets/vendor.js:34994:32
          startApp@http://localhost:7357/assets/tests.js:231:26
          http://localhost:7357/assets/tests.js:54:49
          throws@http://localhost:7357/assets/test-support.js:4138:17
          http://localhost:7357/assets/tests.js:53:18
          runTest@http://localhost:7357/assets/test-support.js:3292:34
          run@http://localhost:7357/assets/test-support.js:3278:13
          http://localhost:7357/assets/test-support.js:3454:15
          advance@http://localhost:7357/assets/test-support.js:2963:26
          begin@http://localhost:7357/assets/test-support.js:4613:27
          http://localhost:7357/assets/test-support.js:4573:11
      message: >
          Error: StripeService: Missing Stripe key, please set `ENV.stripe.publishableKey` in config.environment.js
      Log: |
          { type: 'info', text: '\'StripeService: initialize\'\n' }
          { type: 'error', text: 'null\n' }
          { type: 'error', text: 'null\n' }
  ...

you can see the test failing because of that in recent versions of Ember: #55
and also in this pull request also fails because of that #54

do you have any hint how to solve that?, I tried different approaches but they didn't worked, I tried to read ember's new deprecations and new release notes but they didn't say anything related to that, maybe you people know what to do

Why all the manual run loops?

in stripe.js you call Ember.run.begin(); and Ember.run.end() and I was wondering why you'd want to do that? Isn't that a bit unusual?

function createCardToken (card) {

  // manually start Ember loop
  Ember.run.begin();

  return new Ember.RSVP.Promise(function (resolve, reject) {
    Stripe.card.createToken(card, function (status, response) {

      if (response.error) {
        reject(response);
        return Ember.run.end();
      }

      resolve(response);

      Ember.run.end();
    });
  });
}


function createBankAccountToken(bankAccount) {

  // manually start Ember loop
  Ember.run.begin();

  return new Ember.RSVP.Promise(function (resolve, reject) {
    Stripe.bankAccount.createToken(bankAccount, function (status, response) {

      if (response.error) {
        reject(response);
        return Ember.run.end();
      }

      resolve(response);

      Ember.run.end();
    });
  });
}

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.