diff options
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/account/PaymentView.js')
| -rwxr-xr-x | StoneIsland/platforms/android/assets/www/js/lib/account/PaymentView.js | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/PaymentView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/PaymentView.js deleted file mode 100755 index 8767b39f..00000000 --- a/StoneIsland/platforms/android/assets/www/js/lib/account/PaymentView.js +++ /dev/null @@ -1,128 +0,0 @@ -var PaymentView = FormView.extend({ - - el: "#payment", - - action: sdk.payment.add_credit_card, - - events: { - }, - - test_data: { - "Name":"Name", - "Surname":"Surname", - "Address1":"address", - "Address2":"address2", - "City":"Ferrara", - "Province":"NY", - "HolderIsoCountry":"IT", - "CreditCardCountry": "US", - "ZipCode":"40200", - "Type":"Visa", - "Number":"4111111111111111", - "ExpirationMonth":"09", - "ExpirationYear":"2017", - "Cvv":"1233", - }, - - initialize: function(){ - this.$form = this.$(".form") - this.$msg = this.$(".msg") - this.address = new AddressView ({ parent: this, checkPhone: false }) - this.cc = new CreditCardView ({ parent: this }) - this.scroller = ScrollFactory('#payment', app.iscroll_options) - }, - - show: function(){ - if (! auth.logged_in()) { return app.router.go("intro") } - if (! navigator.onLine) { - app.closed.showElement() - app.closed.setMessage("PLEASE GO ONLINE TO CHANGE<br>YOUR PAYMENT INFO.", "") - return - } - app.account.consent.check() - app.footer.show("SAVE") - document.body.className = "payment" - this.deferScrollToTop() - // this.preload() - }, - - populate: function(data){ - this.data = data || this.data - this.address.populate(data) - this.cc.populate(data) - }, - - finalize: function(data){ - if (this.cc.data && this.cc.data.Guid) { - sdk.payment.delete_credit_card({ - guid: this.cc.data.Guid, - success: function(){ console.log("deleted credit card") }, - error: function(){ console.log("error deleting credit card") }, - }) - } - - data.IsDefault = "true" // this.$isDefault.prop("checked") ? "true" : "false" - data.UserId = sdk.auth.user_id - data.HolderIsoCountry = "US" - data.CreditCardNumber = data.Number - data.IsPreferred = "true" - - console.log(data) - return data - }, - - success: function(data){ - app.curtain.show("loading") - app.account.listAddresses({ - success: function(){ - this.$msg.html('Your payment information has been saved.') - app.curtain.hide("loading") - }.bind(this), - error: function(){ - app.curtain.hide("loading") - }, - }) - }, - - error: function(data){ - console.log("ERROR WITH PAYMENT") - console.log(data) - }, - - cancel: function(){ - app.router.go("intro") - }, - -}) - -/* - 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 |
