summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRene Ae <aehtyb@gmail.com>2015-11-11 19:58:12 -0600
committerRene Ae <aehtyb@gmail.com>2015-11-11 19:58:12 -0600
commit0f1a1220b9085f1da05ce6fce8da11d8045b7dde (patch)
tree77b911a278b707096806947845eaabb90d3dc11f /test
parent19600ae1d4a66d8f0eb5b1ec706aa7720b5dc6b2 (diff)
fixed typo
Diffstat (limited to 'test')
-rw-r--r--test/test/04-cart.js50
1 files changed, 46 insertions, 4 deletions
diff --git a/test/test/04-cart.js b/test/test/04-cart.js
index 1e8ecc4a..7638bac2 100644
--- a/test/test/04-cart.js
+++ b/test/test/04-cart.js
@@ -134,13 +134,27 @@ describe('shipping', function(){
it('requests delivery types', function(done){
promise(sdk.shipping.get_delivery_types, { data: {} }).then(function(data){
assert(data.Header.StatusCode == 200)
- console.log(data)
+ // console.log(JSON.stringify(data))
+ // sample console log: https://gist.github.com/fanfare/15dfbca6a16ae6bed503
done()
})
})
-
})
describe('#set_delivery_type()', function(){
+
+ //RETURNING A 415 ERROR (which isnt listed as potential error).. ?
+
+ it('set delivery type', function(done){
+ var d_type = {
+ "Id": 1,
+ }
+ promise(sdk.shipping.set_delivery_type, { data: d_type }).then(function(data){
+ assert(data.Header.StatusCode == 200)
+ //console.log(data)
+ done()
+ })
+ })
+
})
})
@@ -205,8 +219,8 @@ describe('payment', function(){
it('list credit cards', function(done){
promise(sdk.payment.list_credit_cards, { data: {} }).then(function(data){
assert(data.Header.StatusCode == 200)
- // show any credit card on file
- // console.log(data)
+ console.log("listing credit cards");
+ console.log(data)
done()
})
})
@@ -254,6 +268,34 @@ describe('payment', function(){
})
})
})
+
+ // add another credit card so you can actually use it
+ describe('#add_credit_card()', function(){
+ it('add credit card', function(done){
+ var new_card = {
+ "Name":"Name",
+ "Surname":"Surname",
+ "Address":"address",
+ "City":"Ferrara",
+ "Province":"FE",
+ "ZipCode":"40200",
+
+ "Type":"Visa",
+ "Number":"0000567890124285",
+ "ExpirationMonth":"02",
+ "ExpirationYear":"2017",
+ "HolderIsoCountry":"IT",
+ }
+ promise(sdk.payment.add_credit_card, { data: new_card }).then(function(data){
+ last_guid = data['CreditCard']['Guid']
+ assert(data.Header.StatusCode == 201)
+ assert(!! last_guid)
+ console.log(last_guid)
+ done()
+ })
+ })
+ })
+
describe('#use_stored_credit_card()', function(){
/*
it('use stored credit card', function(done){