2022-09-20 19:59:52 +00:00
|
|
|
<template>
|
2022-11-08 16:44:04 +00:00
|
|
|
<div>
|
2023-11-01 15:58:10 +00:00
|
|
|
<h3 class="font-semibold text-2xl text-gray-900">
|
|
|
|
Billing details
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
<template v-if="user.has_customer_id">
|
|
|
|
<small class="text-gray-600">Manage your billing. Download invoices, update your plan, or cancel it at any
|
|
|
|
time.</small>
|
|
|
|
|
|
|
|
<div class="mt-4">
|
|
|
|
<v-button color="gray" shade="light" :loading="billingLoading" @click.prevent="openBillingDashboard">
|
|
|
|
Manage Subscription
|
|
|
|
</v-button>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<app-sumo-billing class="mt-4" />
|
2022-11-08 16:44:04 +00:00
|
|
|
</div>
|
2022-09-20 19:59:52 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from 'axios'
|
2023-12-01 17:57:14 +00:00
|
|
|
import { computed } from 'vue'
|
|
|
|
import { useAuthStore } from '../../stores/auth'
|
2023-01-21 11:57:37 +00:00
|
|
|
import VButton from '../../components/common/Button.vue'
|
|
|
|
import SeoMeta from '../../mixins/seo-meta.js'
|
2023-11-01 15:58:10 +00:00
|
|
|
import AppSumoBilling from '../../components/vendor/appsumo/AppSumoBilling.vue'
|
2022-09-20 19:59:52 +00:00
|
|
|
|
|
|
|
export default {
|
2023-11-01 15:58:10 +00:00
|
|
|
components: { AppSumoBilling, VButton },
|
2022-12-22 10:55:17 +00:00
|
|
|
mixins: [SeoMeta],
|
2023-11-01 15:58:10 +00:00
|
|
|
scrollToTop: false,
|
2022-09-20 19:59:52 +00:00
|
|
|
|
2023-12-01 17:57:14 +00:00
|
|
|
setup () {
|
|
|
|
const authStore = useAuthStore()
|
|
|
|
return {
|
|
|
|
user : computed(() => authStore.user)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2022-09-20 19:59:52 +00:00
|
|
|
data: () => ({
|
2022-12-22 10:55:17 +00:00
|
|
|
metaTitle: 'Billing',
|
2022-09-20 19:59:52 +00:00
|
|
|
billingLoading: false
|
|
|
|
}),
|
|
|
|
|
|
|
|
methods: {
|
2023-11-01 15:58:10 +00:00
|
|
|
openBillingDashboard () {
|
2022-09-20 19:59:52 +00:00
|
|
|
this.billingLoading = true
|
|
|
|
axios.get('/api/subscription/billing-portal').then((response) => {
|
|
|
|
const url = response.data.portal_url
|
|
|
|
window.location = url
|
2023-10-12 10:06:03 +00:00
|
|
|
}).catch((error) => {
|
|
|
|
this.alertError(error.response.data.message)
|
2022-09-20 19:59:52 +00:00
|
|
|
}).finally(() => {
|
|
|
|
this.billingLoading = false
|
|
|
|
})
|
|
|
|
}
|
2023-11-01 15:58:10 +00:00
|
|
|
},
|
|
|
|
|
2023-12-01 17:57:14 +00:00
|
|
|
computed: {}
|
2022-09-20 19:59:52 +00:00
|
|
|
}
|
|
|
|
</script>
|