Skip to content

Commit

Permalink
fix subscription URL and remove duplicate declarations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgarlanger committed Dec 19, 2014
1 parent 9e27929 commit 707258c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
config.json
.idea
16 changes: 8 additions & 8 deletions lib/recurly.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ var Addon = RecurlyData.buildPrototype({

// ----------------------------------------------------------------------

var BillingInfo = RecurlyData.buildPrototype({
BillingInfo = RecurlyData.buildPrototype({
properties: [
'account',
'address1',
Expand Down Expand Up @@ -725,7 +725,7 @@ BillingInfo.prototype.update = function(options, callback)
// https://api.recurly.com/v2/accounts/:account_code/redemption
// gets coupon redemptions for an account; should probably be a method on account

var Redemption = RecurlyData.buildPrototype({
Redemption = RecurlyData.buildPrototype({
properties: [
'created_at',
'currency',
Expand Down Expand Up @@ -1037,7 +1037,7 @@ Plan.prototype.update = function(options, callback)

// ----------------------------------------------------------------------

var Subscription = RecurlyData.buildPrototype({
Subscription = RecurlyData.buildPrototype({
properties: [
'account',
'activated_at',
Expand Down Expand Up @@ -1154,7 +1154,7 @@ Subscription.prototype.cancel = function(callback)
if (this.a && this.a.cancel)
href = this.a.cancel.href;
else
href = Subscription.ENDPOINT + this.id + '/cancel';
href = Subscription.ENDPOINT + '/' + this.id + '/cancel';

RecurlyData.put(href, '', function(err, response, payload)
{
Expand All @@ -1178,7 +1178,7 @@ Subscription.prototype.reactivate = function(callback)
if (this.a && this.a.reactivate)
href = this.a.reactivate.href;
else
href = Subscription.ENDPOINT + this.id + '/reactivate';
href = Subscription.ENDPOINT + '/' + this.id + '/reactivate';

RecurlyData.put(href, '', function(err, response, payload)
{
Expand All @@ -1204,7 +1204,7 @@ Subscription.prototype.postpone = function(nextRenewal, callback)
if (this.a && this.a.postpone)
href = this.a.postpone.href;
else
href = Subscription.ENDPOINT + this.id + '/postpone';
href = Subscription.ENDPOINT + '/' + this.id + '/postpone';

var query = { next_renewal_date: nextRenewal.toISOString() };
href += '?' + querystring.stringify(query);
Expand Down Expand Up @@ -1236,7 +1236,7 @@ Subscription.prototype.terminate = function(refundType, callback)
if (this.a && this.a.terminate)
href = this.a.terminate.href;
else
href = Subscription.ENDPOINT + this.id + '/terminate';
href = Subscription.ENDPOINT + '/' + this.id + '/terminate';

var query = { refund: refundType };
href += '?' + querystring.stringify(query);
Expand All @@ -1255,7 +1255,7 @@ Subscription.prototype.terminate = function(refundType, callback)
// ----------------------------------------------------------------------
// TODO

var Transaction = RecurlyData.buildPrototype({
Transaction = RecurlyData.buildPrototype({
properties: [
'account',
'action',
Expand Down

0 comments on commit 707258c

Please sign in to comment.