summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/sdk/cart.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-30 16:14:29 -0500
committerJules Laplace <jules@okfoc.us>2015-11-30 16:14:29 -0500
commit840cdf39595c6b8a29d2c91447d9fb8a91582a59 (patch)
tree76ec09a7693993f7229948a79dace3f268f001ec /StoneIsland/www/js/sdk/cart.js
parent7920b278e296e99a069c7ab8b78b271e9665a84a (diff)
ui changes
Diffstat (limited to 'StoneIsland/www/js/sdk/cart.js')
-rw-r--r--StoneIsland/www/js/sdk/cart.js37
1 files changed, 36 insertions, 1 deletions
diff --git a/StoneIsland/www/js/sdk/cart.js b/StoneIsland/www/js/sdk/cart.js
index 0316e234..3ff2e1d2 100644
--- a/StoneIsland/www/js/sdk/cart.js
+++ b/StoneIsland/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({
@@ -189,7 +205,7 @@ sdk.cart = (function(){
})
}
- cart.finalize = function(opt){
+ cart.secure_finalize = function(opt){
return $.ajax({
method: "POST",
url: sdk.path("Cart.API/1.6", "carts/" + cart.id + "/secureFinalizer.json"),
@@ -208,6 +224,25 @@ sdk.cart = (function(){
error: opt.error,
})
}
+
+ cart.finalize = function(opt){
+ return $.ajax({
+ method: "POST",
+ url: sdk.path("Cart.API/1.6", "carts/" + cart.id + "/finalizer.json"),
+ headers: {
+ "x-yoox-appname": auth.appname,
+ "x-yoox-cart-token": cart.token,
+ },
+ data: JSON.stringify( opt.data || {} ),
+ success: function(data){
+ console.log(data)
+ // order number is:
+ // "Info": "2905Y07FA13020"
+ opt.success(data)
+ },
+ error: opt.error,
+ })
+ }
return cart
})() \ No newline at end of file