diff options
Diffstat (limited to 'StoneIsland/www/js/sdk')
| -rw-r--r-- | StoneIsland/www/js/sdk/_sdk.js | 9 | ||||
| -rw-r--r-- | StoneIsland/www/js/sdk/address.js | 2 | ||||
| -rw-r--r-- | StoneIsland/www/js/sdk/product.js | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/StoneIsland/www/js/sdk/_sdk.js b/StoneIsland/www/js/sdk/_sdk.js index ce68da62..a7ecf6d3 100644 --- a/StoneIsland/www/js/sdk/_sdk.js +++ b/StoneIsland/www/js/sdk/_sdk.js @@ -1,9 +1,14 @@ var sdk = (function(){ var sdk = {} - // var endpoint = "https://secure.api.yoox.biz/" var endpoint = "https://sandbox.api.yoox.biz/" - + + sdk.init = function(opt){ + if (opt && opt.production) { + endpoint = "https://secure.api.yoox.biz/" + } + } + sdk.path = function(api, path){ return endpoint + api + "/STONEISLAND_US/" + path } diff --git a/StoneIsland/www/js/sdk/address.js b/StoneIsland/www/js/sdk/address.js index 16fc2dc4..2b1bfae0 100644 --- a/StoneIsland/www/js/sdk/address.js +++ b/StoneIsland/www/js/sdk/address.js @@ -34,5 +34,7 @@ sdk.address = (function(){ error: opt.error, }) } + + return address })()
\ No newline at end of file diff --git a/StoneIsland/www/js/sdk/product.js b/StoneIsland/www/js/sdk/product.js index c904eb32..a2ba30a1 100644 --- a/StoneIsland/www/js/sdk/product.js +++ b/StoneIsland/www/js/sdk/product.js @@ -1,7 +1,7 @@ sdk.product = (function(){ var product = {} - product.fetch_collection = function(opt){ + product.collection = function(opt){ $.ajax({ method: "GET", url: sdk.path("Search.API/1.2", "search.json"), @@ -15,7 +15,7 @@ sdk.product = (function(){ product.item = function(opt){ $.ajax({ method: "GET", - url: sdk.path("Item.API/1.0", "item/" + data.code + ".json"), + url: sdk.path("Item.API/1.0", "item/" + opt.code + ".json"), success: opt.success, error: opt.error, }) |
