diff options
| author | Rene Ae <aehtyb@gmail.com> | 2015-12-01 00:51:02 -0600 |
|---|---|---|
| committer | Rene Ae <aehtyb@gmail.com> | 2015-12-01 00:51:02 -0600 |
| commit | 6415f506034262dd7151be2e35e1e1c1e97f4dfa (patch) | |
| tree | c6e564e374967725a40fd87f7c5f3a1ba8019089 /StoneIsland/platforms/ios/www/js/sdk | |
| parent | 5e07e273e18a609978253c45f3c5f702b0de4991 (diff) | |
| parent | 9497b50fa02f3cfa9cb263ce3a96fa725282d60d (diff) | |
Merge branch 'master' of https://github.com/okfocus/stone-island
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/sdk')
| -rw-r--r-- | StoneIsland/platforms/ios/www/js/sdk/account.js | 32 | ||||
| -rw-r--r-- | StoneIsland/platforms/ios/www/js/sdk/cart.js | 16 |
2 files changed, 48 insertions, 0 deletions
diff --git a/StoneIsland/platforms/ios/www/js/sdk/account.js b/StoneIsland/platforms/ios/www/js/sdk/account.js index fe5f03cd..3eb3f3bd 100644 --- a/StoneIsland/platforms/ios/www/js/sdk/account.js +++ b/StoneIsland/platforms/ios/www/js/sdk/account.js @@ -96,6 +96,38 @@ sdk.account = (function(){ }) } + account.fetch_orders = function(opt){ + return $.ajax({ + method: "GET", + url: sdk.path("Account.API/1.5", "users/" + auth.user_id + "/orders.json"), + headers: { + "x-yoox-appname": auth.appname, + "x-yoox-account-token": auth.access_token, + }, + data: JSON.stringify( opt.data ), + success: function(data){ + opt.success(data) + }, + error: opt.error, + }) + } + + account.fetch_single_order = function(opt){ + return $.ajax({ + method: "GET", + url: sdk.path("Account.API/1.5", "users/" + auth.user_id + "/orders/" + opt.id + ".json"), + headers: { + "x-yoox-appname": auth.appname, + "x-yoox-account-token": auth.access_token, + }, + data: JSON.stringify( opt.data ), + success: function(data){ + opt.success(data) + }, + error: opt.error, + }) + } + return account })() diff --git a/StoneIsland/platforms/ios/www/js/sdk/cart.js b/StoneIsland/platforms/ios/www/js/sdk/cart.js index a5e85089..3ff2e1d2 100644 --- a/StoneIsland/platforms/ios/www/js/sdk/cart.js +++ b/StoneIsland/platforms/ios/www/js/sdk/cart.js @@ -140,6 +140,22 @@ sdk.cart = (function(){ }) } + cart.get_card_types = function(opt){ + return $.ajax({ + method: "GET", + url: sdk.path("Cart.API/1.6", "cardTypes.json"), + headers: { + "x-yoox-appname": auth.appname, + "x-yoox-cart-token": cart.token, + }, + data: "", + success: function(data){ + opt.success(data) + }, + error: opt.error, + }) + } + // use with full CC data if not storing it in wallet cart.set_credit_card = function(opt){ return $.ajax({ |
