Permalink
Browse files

remove legacy support. fix validate-coupon-by-code.

  • Loading branch information...
1 parent d052627 commit 2e87b5c17dd37493d21754b4c69a0ccad0536108 @chjj committed Jan 11, 2013
Showing with 4 additions and 14 deletions.
  1. +4 −14 lib/charged.js
View
@@ -259,18 +259,9 @@ Charged.prototype.getStatementIds = function(name, options, callback) {
Charged.prototype.migrateSubscription = function(name, options, callback) {
var path = '/subscriptions/' + escape(name) + '/migrations';
return this.post(path, options, function(err, result) {
- if (err) return callback(err);
-
- // XXX Legacy support.
- if (result.subscription && !result.subscription.subscription) {
- Object.defineProperty(result.subscription, 'subscription', {
- value: result.subscription,
- enumerable: false,
- configurable: true
- });
- }
-
- return callback(null, result.subscription);
+ return err
+ ? callback(err)
+ : callback(null, result.subscription);
}, 'migration');
};
@@ -630,8 +621,7 @@ Charged.prototype.validateCoupon = function(name, callback) {
};
Charged.prototype.validateCouponByCode = function(name, callback) {
- var path = '/coupons/' + escape(name) + '/validate';
- //var path = '/coupons/find/validate?code=' + escape(name);
+ var path = '/coupons/find/validate?code=' + escape(name);
return this.get(path, callback, 'coupon');
};

0 comments on commit 2e87b5c

Please sign in to comment.