2022-09-20 19:59:52 +00:00
|
|
|
<template>
|
2022-11-08 16:44:04 +00:00
|
|
|
<div>
|
|
|
|
<h3 class="font-semibold text-2xl text-gray-900">Billing details</h3>
|
2023-08-31 14:39:33 +00:00
|
|
|
<small class="text-gray-600">Manage your billing. Download invoices, update your plan, or cancel it at any time.</small>
|
|
|
|
|
2022-11-08 16:44:04 +00:00
|
|
|
<div class="mt-4">
|
|
|
|
<v-button color="gray" shade="light" :loading="billingLoading" @click.prevent="openBillingDashboard">
|
|
|
|
Manage Subscription
|
|
|
|
</v-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-20 19:59:52 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import axios from 'axios'
|
2023-01-21 11:57:37 +00:00
|
|
|
import VButton from '../../components/common/Button.vue'
|
|
|
|
import SeoMeta from '../../mixins/seo-meta.js'
|
2022-09-20 19:59:52 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: { VButton },
|
|
|
|
scrollToTop: false,
|
2022-12-22 10:55:17 +00:00
|
|
|
mixins: [SeoMeta],
|
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: {
|
|
|
|
openBillingDashboard () {
|
|
|
|
this.billingLoading = true
|
|
|
|
axios.get('/api/subscription/billing-portal').then((response) => {
|
|
|
|
const url = response.data.portal_url
|
|
|
|
window.location = url
|
|
|
|
}).finally(() => {
|
|
|
|
this.billingLoading = false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|