-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from ostdotcom/develop
Redemptions API.
- Loading branch information
Showing
11 changed files
with
341 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.2.2 | ||
2.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
"use strict"; | ||
|
||
/** | ||
* Redeemable SKUs Service | ||
* | ||
* @module services/redeemable_skus | ||
*/ | ||
|
||
const rootPrefix = ".." | ||
, validate = require(rootPrefix + '/lib/validate') | ||
; | ||
|
||
// hide request object | ||
var _requestObj = null; | ||
|
||
/** | ||
* Redeemable SKUs Service constructor. | ||
* | ||
* @constructor | ||
*/ | ||
const redeemable_skus = function (requestObj) { | ||
const oThis = this; | ||
|
||
// Assign request object. | ||
_requestObj = requestObj; | ||
|
||
// Define the url prefix. | ||
oThis.urlPrefix = '/redeemable-skus'; | ||
|
||
return oThis; | ||
}; | ||
|
||
redeemable_skus.prototype = { | ||
/** | ||
* Get redeemable skus list. | ||
* | ||
* @param {object} params | ||
* | ||
* @returns {*} | ||
*/ | ||
getList: function(params) { | ||
const oThis = this; | ||
|
||
params = params || {}; | ||
|
||
return _requestObj.get(oThis.urlPrefix, params); | ||
}, | ||
|
||
/** | ||
* Get redeemable sku by redeemable sku id. | ||
* | ||
* @param {object} params | ||
* | ||
* @returns {*} | ||
*/ | ||
get: function(params) { | ||
const oThis = this; | ||
|
||
params = params || {}; | ||
|
||
return _requestObj.get(oThis.urlPrefix + "/" + validate.getRedeemableSkuId(params), params); | ||
} | ||
|
||
}; | ||
|
||
module.exports = redeemable_skus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
"use strict"; | ||
|
||
/** | ||
* Redemptions Service | ||
* | ||
* @module services/redemptions | ||
*/ | ||
|
||
const rootPrefix = ".." | ||
, validate = require(rootPrefix + '/lib/validate') | ||
; | ||
|
||
// hide request object | ||
var _requestObj = null; | ||
|
||
/** | ||
* Redemptions Service constructor | ||
* | ||
* @constructor | ||
*/ | ||
const redemptions = function (requestObj) { | ||
const oThis = this; | ||
|
||
// Assign request object | ||
_requestObj = requestObj; | ||
|
||
// Define the url prefix | ||
oThis.urlPrefix = '/users'; | ||
oThis.redemptionsUrlPrefix = '/redemptions'; | ||
|
||
return oThis; | ||
}; | ||
|
||
redemptions.prototype = { | ||
/** | ||
* Get user redemptions list. | ||
* | ||
* @param {object} params | ||
* | ||
* @returns {*} | ||
*/ | ||
getList: function(params) { | ||
const oThis = this; | ||
|
||
params = params || {}; | ||
|
||
return _requestObj.get(oThis.urlPrefix + "/" + validate.getUserId(params) + oThis.redemptionsUrlPrefix, params); | ||
}, | ||
|
||
/** | ||
* Get user redemption by redemption id. | ||
* | ||
* @param {object} params | ||
* | ||
* @returns {*} | ||
*/ | ||
get: function(params) { | ||
const oThis = this; | ||
|
||
params = params || {}; | ||
|
||
return _requestObj.get(oThis.urlPrefix + "/" + validate.getUserId(params) + oThis.redemptionsUrlPrefix + '/' + validate.getRedemptionId(params), params); | ||
} | ||
|
||
}; | ||
|
||
module.exports = redemptions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.