/* global Stripe */
import config from '../config/environment';
import Ember from 'ember';
var debug = config.LOG_STRIPE_SERVICE;

function createToken (card) {
  if (debug) {
    Ember.Logger.info('StripeService: getStripeToken - card:', card);
  }

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

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

      if (debug) {
        Ember.Logger.info('StripeService: createToken handler - status %s, response:', status, response);
      }

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

      resolve(response);

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

export default Ember.Object.extend({
  createToken: createToken
});

@@ -718,16 +718,666 @@
  %7D);%0A%7D%0A%0A
+function createBankAccountToken(bankAccount) %7B%0A  if (debug) %7B%0A    Ember.Logger.info('StripeService: getStripeToken - bankAccount:', bankAccount);%0A  %7D%0A%0A  // manually start Ember loop%0A  Ember.run.begin();%0A%0A  return new Ember.RSVP.Promise(function (resolve, reject) %7B%0A    Stripe.bankAccount.createToken(bankAccount, function (status, response) %7B%0A%0A      if (debug) %7B%0A        Ember.Logger.info('StripeService: createBankAccountToken handler - status %25s, response:', status, response);%0A      %7D%0A%0A      if (response.error) %7B%0A        reject(response);%0A        return Ember.run.end();%0A      %7D%0A%0A      resolve(response);%0A%0A      Ember.run.end();%0A    %7D);%0A  %7D);%0A%7D%0A%0A
 export d
@@ -1431,13 +1431,64 @@
 ateToken
+,%0A  createBankAccountToken: createBankAccountToken,
 %0A%7D);%0A

Add a create bank account token method to the service