@@ -33,6 +33,7 @@ class DatabaseSeeder extends Seeder | |||||
'name' => 'Language Targeted Views', | 'name' => 'Language Targeted Views', | ||||
'type' => 'views', | 'type' => 'views', | ||||
'site' => 'youtube', | 'site' => 'youtube', | ||||
'modifier' => 'language', | |||||
'minimum' => 1000, | 'minimum' => 1000, | ||||
'maximum' => 100000, | 'maximum' => 100000, | ||||
'price' => 20, | 'price' => 20, | ||||
@@ -104,7 +104,7 @@ function pay() { | |||||
document.getElementById('payment-error').textContent = | document.getElementById('payment-error').textContent = | ||||
result.error.message | result.error.message | ||||
} else if (result.paymentIntent.status === 'succeeded') { | } else if (result.paymentIntent.status === 'succeeded') { | ||||
this.complete() | |||||
this.$emit('purchaseComplete') | |||||
} else { | } else { | ||||
document.getElementById('payment-error').textContent = | document.getElementById('payment-error').textContent = | ||||
'An unknown error occured' | 'An unknown error occured' | ||||
@@ -145,6 +145,7 @@ export default { | |||||
computed: {total, ready}, | computed: {total, ready}, | ||||
methods: {getSecret, pay, getCards}, | methods: {getSecret, pay, getCards}, | ||||
props: ['token'], | props: ['token'], | ||||
emits: ['purchaseComplete'], | |||||
created() { | created() { | ||||
this.getCards() | this.getCards() | ||||
} | } | ||||
@@ -85,6 +85,11 @@ function getOrders() { | |||||
}) | }) | ||||
} | } | ||||
//Should show completed view and update user information after 5 seconds | |||||
function showCompleted() { | |||||
} | |||||
export default { | export default { | ||||
components: { | components: { | ||||
Sidebar, Settings, PastOrders, NewOrder | Sidebar, Settings, PastOrders, NewOrder | ||||
@@ -93,7 +98,7 @@ export default { | |||||
return {active: window.location.hash, user: null, | return {active: window.location.hash, user: null, | ||||
token: null, orders: null, loading: true,} | token: null, orders: null, loading: true,} | ||||
}, | }, | ||||
methods: {getUser, getServices, getOrders}, | |||||
methods: {getUser, getServices, getOrders, showCompleted}, | |||||
created() { | created() { | ||||
let loaders = [] | let loaders = [] | ||||
loaders.push(this.getUser()) | loaders.push(this.getUser()) | ||||
@@ -39,6 +39,7 @@ | |||||
<div><input required :min="selected.minimum" :max="selected.maximum" | <div><input required :min="selected.minimum" :max="selected.maximum" | ||||
type="number" v-model="amount" id="selQty"><span> / | type="number" v-model="amount" id="selQty"><span> / | ||||
{{selected.maximum.toLocaleString('en')}}</span></div> | {{selected.maximum.toLocaleString('en')}}</span></div> | ||||
<template v-if="selected.modifier == 'location'"> | <template v-if="selected.modifier == 'location'"> | ||||
<h4>Location</h4> | <h4>Location</h4> | ||||
<div><select required id="country" name=""> | <div><select required id="country" name=""> | ||||
@@ -50,6 +51,18 @@ | |||||
</select> | </select> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<template v-if="selected.modifier == 'language'"> | |||||
<h4>Location</h4> | |||||
<div><select required id="language" name=""> | |||||
<option value="english">English</option> | |||||
<option value="french">French</option> | |||||
<option value="spanish">Spanish</option> | |||||
<option value="german">German</option> | |||||
</select> | |||||
</div> | |||||
</template> | |||||
<h4>URL</h4> | <h4>URL</h4> | ||||
<div><input required type="url" id="url" v-model="url"></div> | <div><input required type="url" id="url" v-model="url"></div> | ||||
<button @click="buyService" :disabled="paying">Submit<loading | <button @click="buyService" :disabled="paying">Submit<loading | ||||
@@ -100,9 +113,12 @@ function buyService() { | |||||
this.paying = true | this.paying = true | ||||
let note = '' | let note = '' | ||||
let country = document.getElementById('country') | let country = document.getElementById('country') | ||||
let language = document.getElementById('language') | |||||
if (country) { | if (country) { | ||||
note = JSON.stringify({'location': country.value}) | note = JSON.stringify({'location': country.value}) | ||||
} else if (language) { | |||||
note = JSON.stringify({'language': language.value}) | |||||
} | } | ||||
fetch('/panel/orders', { | fetch('/panel/orders', { | ||||