diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/test/04-cart.js | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/test/test/04-cart.js b/test/test/04-cart.js index e378165d..5f6c04d7 100644 --- a/test/test/04-cart.js +++ b/test/test/04-cart.js @@ -156,6 +156,12 @@ describe('shipping', function(){ describe('payment', function(){ + + if (! sdk.auth.access_token) { + sdk.auth.access_token = "45871479f5001afc06e628c7bb8e95ffb1f71df8" + sdk.auth.user_id = 374663521 + } + describe('#set_payment_type()', function(){ it('sets payment type', function(done){ // this id probably needs to be hard coded. 1 = credit card. @@ -201,7 +207,7 @@ describe('payment', function(){ 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(data) done() }) }) @@ -209,21 +215,24 @@ describe('payment', function(){ describe('#add_credit_card()', function(){ it('add credit card', function(done){ var new_card = { + "Name":"Name", + "Surname":"Surname", "Address":"address", "City":"Ferrara", - "ExpirationMonth":"02", - "ExpirationYear":"2017", - "Name":"Name", - "Number":"0000567890124285", "Province":"FE", - "Surname":"Surname", - "Type":"Visa", "ZipCode":"40200", + + "Type":"Visa", + "Number":"0000567890124285", + "ExpirationMonth":"02", + "ExpirationYear":"2017", "HolderIsoCountry":"IT", } promise(sdk.payment.add_credit_card, { data: new_card }).then(function(data){ assert(data.Header.StatusCode == 201) done() + }).error(function(data){ + console.log(data) }) }) }) @@ -263,4 +272,4 @@ describe('payment', function(){ describe('checkout', function(){ describe('#finalize()', function(){ }) -})
\ No newline at end of file +}) |
