diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-11-25 23:41:44 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-11-25 23:41:44 -0500 |
| commit | 818a4f598851d4fbfac5addbfd3fedc59772ac2b (patch) | |
| tree | f6c5bda4b0e3c65e4d574df804390301e48cbfe0 /StoneIsland/www/js/lib/account/PaymentView.js | |
| parent | 98e21c4f1b096fc117a6a0f770bb69ab7c83914d (diff) | |
populate cc test data
Diffstat (limited to 'StoneIsland/www/js/lib/account/PaymentView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/account/PaymentView.js | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/StoneIsland/www/js/lib/account/PaymentView.js b/StoneIsland/www/js/lib/account/PaymentView.js index d61ab5ab..dcf509c8 100644 --- a/StoneIsland/www/js/lib/account/PaymentView.js +++ b/StoneIsland/www/js/lib/account/PaymentView.js @@ -5,6 +5,23 @@ var PaymentView = FormView.extend({ events: { }, + test_data: { + "Name":"Name", + "Surname":"Surname", + "Address1":"address", + "Address2":"address2", + "City":"Ferrara", + "Province":"NY", + "HolderIsoCountry":"IT", + "ZipCode":"40200", + "Phone":"12343340200", + "Type":"Amex", + "Number":"378282246310005", + "ExpirationMonth":"09", + "ExpirationYear":"2017", + "Cvv":"123", + }, + initialize: function(){ this.$form = this.$("form") this.$msg = this.$(".msg") @@ -17,9 +34,49 @@ var PaymentView = FormView.extend({ if (! auth.logged_in()) { return app.router.go("intro") } app.footer.show("SAVE", "CANCEL") document.body.className = "payment" + this.preload() + }, + + populate: function(data){ + this.data = data || this.data + this.address.populate(data) + this.cc.populate(data) }, - save: function(){ + finalize: function(data){ + return null }, }) + +/* + var new_card = { + "Name":"Name", + "Surname":"Surname", + "Address":"address", + "City":"Ferrara", + "Province":"FE", + "HolderIsoCountry":"IT", + "ZipCode":"40200", + "Type":"Visa", + "Number":"0000567890124285", + "ExpirationMonth":"02", + "ExpirationYear":"2017", + } + 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) + done() + }) + + promise(sdk.payment.list_credit_cards, { data: {} }).then(function(data){ + assert(data.Header.StatusCode == 201) + console.log(data) + done() + }) + + promise(sdk.payment.delete_credit_card, { guid: last_guid }).then(function(data){ + assert(data.Header.StatusCode == 200) + done() +*/
\ No newline at end of file |
