diff --git a/index.html b/index.html index e9b0396..448db52 100644 --- a/index.html +++ b/index.html @@ -4,12 +4,13 @@ Incentify + -
+
\ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 49e149e..d7ebbf5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,7 @@
- +
diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 8b74250..d2deefe 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -74,7 +74,6 @@ export default { }); }, logout() { - console.log("hi") localStorage.removeItem('token') this.$router.go('/'); } @@ -82,7 +81,6 @@ export default { created() { this.$http.get(process.env.API_URL + '/users').then((response) => { // success callback - console.log(response); this.profileData.email = response.body[0].email; }, (response) => { // error callback diff --git a/src/components/add-goal.vue b/src/components/add-goal.vue index 69f4904..f45fbf9 100644 --- a/src/components/add-goal.vue +++ b/src/components/add-goal.vue @@ -16,6 +16,7 @@

+ @@ -27,6 +28,10 @@ ], data() { return { + stripe_token: {}, + price: 1000, + stripe_instance: {}, + order_status: 'READY', showIntegration$Input: true, activeTab: { tab: 1, @@ -41,6 +46,17 @@ } }; }, + ready() { + this.stripe_instance = StripeCheckout.configure({ + key: 'pk_test_t5EdiYNBA1LOp7En1xhBOYVp', //put your own publishable key here + image: 'https://stripe.com/img/documentation/checkout/marketplace.png', + locale: 'auto', + token: function(token) { + this.stripe_token= token; + this.sendData2Server(); + } + }); + }, methods: { commit() { var shortname = this.integrationShortName.toLowerCase(); @@ -52,7 +68,28 @@ // error callback this.failure = !this.failure; }); - } + }, + purchaseStuff() { + this.stripe_instance.open({ + name: 'Incentify', + description: 'New Commitment', + amount: this.price + }) + // console.log('attempting to get a token'); + }, + sendData2Server() { + console.log("data 2 server"); + this.order_status= "PENDING"; + this.$http.post(process.env.API_URL + '/stripe/process_payment', {token_id: this.stripe_token.id, price: this.price}) + .then((response) => { + // console.log(response.body); + this.order_status= "Successfully Completed"; + },(response) => { + // error callback + // console.log(response.body); + this.order_status= "Failed"; + }); + }, } }; diff --git a/src/main.js b/src/main.js index 59e2622..55c9ed3 100644 --- a/src/main.js +++ b/src/main.js @@ -24,7 +24,6 @@ const router = new VueRouter(); // get rid of 300ms tap delay FastClick.attach(document.body); -console.log(process.env.API_URL); router.map({ '/': {