Skip to content

Commit

Permalink
[remmove] deprecated method Stripe.createtoken
Browse files Browse the repository at this point in the history
  • Loading branch information
buritica committed Jul 19, 2015
1 parent e8bd03d commit c1907ef
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
14 changes: 0 additions & 14 deletions app/services/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,7 +74,6 @@ function createBankAccountToken(bankAccount) {
* Expose module
*/
export default Ember.Service.extend({
createToken: createCardTokenDeprecated,
card: {
createToken: createCardToken,
},
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/stripe-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
Expand All @@ -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');
});
});
Expand Down
18 changes: 0 additions & 18 deletions tests/unit/services/stripe-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit c1907ef

Please sign in to comment.