Skip to content

Commit

Permalink
renames
Browse files Browse the repository at this point in the history
  • Loading branch information
frakti committed Nov 30, 2016
1 parent 5c75e97 commit c5cdcf6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/Products.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ module.exports = class Products {
return this.client.delete(`/products/${encode(productId)}`, callback)
}

list (query, callback) {
if (isFunction(query)) {
callback = query
query = {}
list (params, callback) {
if (isFunction(params)) {
callback = params
params = {}
}
return this.client.get('/products', query, callback)
return this.client.get('/products', params, callback)
}

createSku (productId, sku, callback) {
Expand Down
26 changes: 13 additions & 13 deletions src/Redemptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,32 @@ module.exports = class Redemptions {
return this.client.post(`/vouchers/${encode(code)}/redemption`, context, callback, {qs})
}

list (query, callback) {
if (isFunction(query)) {
callback = query
query = null
list (params, callback) {
if (isFunction(params)) {
callback = params
params = {}
}

return this.client.get('/redemptions', query, callback)
return this.client.get('/redemptions', params, callback)
}

getForVoucher (code, callback) {
return this.client.get(`/vouchers/${encode(code)}/redemption`, null, callback)
}

rollback (redemptionId, data, callback) {
if (isFunction(data)) {
callback = data
data = null
rollback (redemptionId, params, callback) {
if (isFunction(params)) {
callback = params
params = null
}

let qs = {}
let payload = {}

if (isString(data)) {
qs.reason = encode(data)
} else if (isObject(data)) {
const {reason, tracking_id, customer} = data
if (isString(params)) {
qs.reason = encode(params)
} else if (isObject(params)) {
const {reason, tracking_id, customer} = params

qs = {
reason: reason ? encode(reason) : undefined,
Expand Down

0 comments on commit c5cdcf6

Please sign in to comment.