From c1907ef46c8946c2c88a70d3f2ff2a70b3b810df Mon Sep 17 00:00:00 2001 From: Juan Pablo Buritica Date: Sat, 18 Jul 2015 23:08:05 -0400 Subject: [PATCH] [remmove] deprecated method `Stripe.createtoken` --- app/services/stripe.js | 14 -------------- tests/integration/stripe-test.js | 2 -- tests/unit/services/stripe-test.js | 18 ------------------ 3 files changed, 34 deletions(-) diff --git a/app/services/stripe.js b/app/services/stripe.js index 70258f3..da86737 100644 --- a/app/services/stripe.js +++ b/app/services/stripe.js @@ -46,19 +46,6 @@ function createCardToken (card) { }); } -/** - * Alias to `card.createToken`, exposed as `createCardToken` - * @deprecated please see `card.createToken` for usage - */ -function createCardTokenDeprecated(card) { - Ember.deprecate( - '`EmberStripeService.createToken` has been deprecated in ' + - 'favor of `EmberStripeService.card.createToken` to match ' + - 'the Stripe API.' - ); - return createCardToken(card); -} - /** * Creates a BankAccout token using Stripe.js API, exposed as `bankAccount.createToken` * @param {ojbect} bankAccount @@ -87,7 +74,6 @@ function createBankAccountToken(bankAccount) { * Expose module */ export default Ember.Service.extend({ - createToken: createCardTokenDeprecated, card: { createToken: createCardToken, }, diff --git a/tests/integration/stripe-test.js b/tests/integration/stripe-test.js index 98d1a47..85505c7 100644 --- a/tests/integration/stripe-test.js +++ b/tests/integration/stripe-test.js @@ -29,7 +29,6 @@ test('card.createToken sets the token and returns a promise', function(assert) { return service.card.createToken(cc) .then(function(res) { - console.log('res', res); assert.ok(res.id, 'correct token set'); }); }); @@ -39,7 +38,6 @@ test('bankAccount.createToken sets the token and returns a promise', function(as return service.bankAccount.createToken(bankAccount) .then(function(res) { - console.log('res', res); assert.ok(res.id, 'correct token set'); }); }); diff --git a/tests/unit/services/stripe-test.js b/tests/unit/services/stripe-test.js index 80dca09..e200f02 100644 --- a/tests/unit/services/stripe-test.js +++ b/tests/unit/services/stripe-test.js @@ -58,24 +58,6 @@ test('card.createToken rejects the promise if Stripe errors', function(assert) { }); }); -test('createToken syntax is still supported', function(assert) { - var service = this.subject(); - var response = { - id: 'the_token' - }; - - var createToken = sinon.stub(Stripe.card, 'createToken', function(card, cb) { - assert.equal(card, cc, 'called with sample creditcard'); - cb(200, response); - }); - - return service.createToken(cc) - .then(function(res) { - assert.equal(res.id, 'the_token'); - createToken.restore(); - }); -}); - // Bank accounts var ba = {