Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making the signature consistent #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 43 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ http://docs.recurly.com/api/accounts



recurly.accounts.list(callback, filter)
recurly.accounts.list(filter, callback)

recurly.accounts.create(details, callback)

recurly.accounts.update(accountcode, details, callback)
recurly.accounts.update(accountcode, details, callback)

recurly.accounts.get(accountcode, callback)
recurly.accounts.get(accountcode, callback)

recurly.accounts.close(accountcode, callback)
recurly.accounts.close(accountcode, callback)

recurly.accounts.reopen(accountcode, callback)

Expand All @@ -51,13 +51,13 @@ Billing Information
===============
http://docs.recurly.com/api/billing-info

recurly.billingInfo.update(accountcode, details, callback)
recurly.billingInfo.update(accountcode, details, callback)


recurly.billingInfo.get(accountcode, callback)
recurly.billingInfo.get(accountcode, callback)


recurly.billingInfo.remove(accountcode, callback)
recurly.billingInfo.remove(accountcode, callback)



Expand All @@ -66,7 +66,7 @@ Adjustments
http://docs.recurly.com/api/adjustments

recurly.adjustments.get(accountcode, callback)

recurly.adjustments.create(accountcode, details, callback)

recurly.adjustments.remove(uuid, callback)
Expand All @@ -76,8 +76,8 @@ Coupons
===============
http://docs.recurly.com/api/coupons

recurly.coupons.list(callback, filter)
recurly.coupons.list(filter, callback)

recurly.coupons.get(couponcode, callback)

recurly.coupons.create(details, callback)
Expand All @@ -87,7 +87,7 @@ http://docs.recurly.com/api/coupons
Coupon Redemtion
=================
http://docs.recurly.com/api/coupons/coupon-redemption

recurly.couponRedemption.redeem(couponcode, details, callback)

recurly.couponRedemption.get(accountcode, callback)
Expand All @@ -102,12 +102,12 @@ Invoices
===============
http://docs.recurly.com/api/invoices

recurly.invoices.list(callback, filter)
recurly.invoices.list(filter, callback)

recurly.invoices.listByAccount(accountcode, callback, filter)

recurly.invoices.get(invoicenumber, callback)

recurly.invoices.create(accountcode, details, callback)

recurly.invoices.markSuccessful(invoicenumber, callback)
Expand All @@ -119,68 +119,68 @@ Subscriptions
===============
http://docs.recurly.com/api/subscriptions

recurly.subscriptions.list(callback, filter)

recurly.subscriptions.listByAccount(accountcode, callback)
recurly.subscriptions.list(callback, filter)

recurly.subscriptions.listByAccount(accountcode, callback)

recurly.subscriptions.get(uuid, callback)

recurly.subscriptions.create(details, callback)

recurly.subscriptions.get(uuid, callback)
recurly.subscriptions.update(uuid, details, callback)

recurly.subscriptions.create(details, callback)

recurly.subscriptions.update(uuid, details, callback)

recurly.subscriptions.cancel(uuid, callback)

recurly.subscriptions.reactivate(uuid, callback)

recurly.subscriptions.terminate(uuid, refundType, callback)
recurly.subscriptions.cancel(uuid, callback)

recurly.subscriptions.postpone(uuid, nextRenewalDate, callback)
recurly.subscriptions.reactivate(uuid, callback)

recurly.subscriptions.terminate(uuid, refundType, callback)

recurly.subscriptions.postpone(uuid, nextRenewalDate, callback)


Subscription Plans
==================
http://docs.recurly.com/api/plans

recurly.plans.list(callback, filter)
recurly.plans.list(filter, callback)

recurly.plans.get(plancode, callback)

recurly.plans.get(plancode, callback)

recurly.plans.create(details, callback)

recurly.plans.update(plancode, details, callback)

recurly.plans.remove(plancode, callback)

Plan Add-ons
==================
http://docs.recurly.com/api/plans/add-ons

recurly.planAddons.list(plancode, callback, filter)
recurly.planAddons.list(plancode, filter, callback)

recurly.planAddons.get(plancode, addoncode, callback)

recurly.planAddons.get(plancode, addoncode, callback)

recurly.planAddons.create(plancode, details, callback)

recurly.planAddons.update(plancode, addoncode, details, callback)

recurly.planAddons.remove(plancode, addoncode, callback)


Transactions
===============
http://docs.recurly.com/api/transactions

recurly.transactions.list(callback, filter)
recurly.transactions.list(filter, callback)


recurly.transactions.listByAccount(accountcode, callback, filter)
recurly.transactions.listByAccount(accountcode, filter, callback)


recurly.transactions.get(id, callback)
recurly.transactions.get(id, callback)


recurly.transactions.create(details, callback)
recurly.transactions.create(details, callback)


recurly.transactions.refund(id, callback, amount)
recurly.transactions.refund(id, amount, callback)
26 changes: 13 additions & 13 deletions lib/recurly.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

//http://docs.recurly.com/api/accounts
this.accounts = {
list: function(callback, filter){
list: function(filter, callback){
t.request(utils.addQueryParams(routes.accounts.list, filter), callback);
},
get: function(accountcode, callback){
Expand Down Expand Up @@ -41,7 +41,7 @@
t.request(utils.addParams(routes.adjustments.remove, {uuid: uuid}), callback);
}
}

//http://docs.recurly.com/api/billing-info
this.billingInfo = {
update: function(accountcode, details, callback){
Expand All @@ -57,7 +57,7 @@

//http://docs.recurly.com/api/coupons
this.coupons = {
list: function(callback, filter){
list: function(filter, callback){
t.request(utils.addQueryParams(routes.coupons.list, filter), callback);
},
get: function(couponcode, callback){
Expand Down Expand Up @@ -87,10 +87,10 @@
}

this.invoices = {
list: function(callback, filter){
list: function(filter, callback){
t.request(utils.addQueryParams(routes.invoices.list, filter), callback);
},
listByAccount: function(accountcode, callback, filter){
listByAccount: function(accountcode, filter, callback){
t.request(
utils.addParams(
utils.addQueryParams(routes.invoices.listByAccount, filter)
Expand All @@ -112,7 +112,7 @@
}

this.plans = {
list: function(callback, filter){
list: function(filter, callback){
t.request(utils.addQueryParams(routes.plans.list, filter), callback);
},
get: function(plancode, callback){
Expand All @@ -130,7 +130,7 @@
}

this.planAddons = {
list: function(plancode, callback, filter){
list: function(plancode, filter, callback){
t.request(utils.addParams(utils.addQueryParams(routes.planAddons.list, filter), {plan_code: plancode}), callback);
},
get: function(plancode, addoncode, callback){
Expand All @@ -141,10 +141,10 @@
},
update: function(plancode, addoncode, details, callback){
t.request(utils.addParams(
routes.planAddons.update,
routes.planAddons.update,
{ plan_code: plancode,
add_on_code: addoncode
}),
}),
callback, new Js2xml('add_on', details).toString());
},
remove: function(plancode, addoncode, callback){
Expand All @@ -153,7 +153,7 @@
}

this.subscriptions = {
list: function(callback, filter){
list: function(filter, callback){
t.request(utils.addQueryParams(routes.subscriptions.list, filter), callback);
},
listByAccount: function(accountcode, callback){
Expand Down Expand Up @@ -184,10 +184,10 @@
}

this.transactions = {
list: function(callback, filter){
list: function(filter, callback){
t.request(utils.addQueryParams(routes.transactions.list, filter), callback);
},
listByAccount: function(accountCode, callback, filter){
listByAccount: function(accountCode, filter, callback){
t.request(
utils.addParams(
utils.addQueryParams(routes.transactions.listByAccount, filter), {account_code: accountCode}),
Expand All @@ -199,7 +199,7 @@
create: function(details, callback){
t.request(routes.transactions.create, callback, new Js2xml('transaction', details).toString());
},
refund: function(id, callback, amount){
refund: function(id, amount, callback){
var route = utils.addParams(routes.transactions.refund, {id: id});
if(amount){
route = utils.addQueryParams(route, { amount_in_cents: amount });
Expand Down