Billing flow redirect (#713)
* Billing flow redirect * fix checkout url * Refactor checkout and subscription flow - Improve checkout URL generation with ref unwrapping - Enhance user data handling in subscription modal - Remove deprecated CheckoutDetailsModal component - Update form field and register form styling - Add more robust user data update mechanism * Refactor checkout and subscription flow - Improve checkout URL generation with ref unwrapping - Enhance user data handling in subscription modal - Remove deprecated CheckoutDetailsModal component - Update form field and register form styling - Add more robust user data update mechanism * Fix accessibility and checkout URL generation - Add proper label for terms and conditions checkbox in RegisterForm - Refactor checkout URL generation in SubscriptionModal using computed refs - Improve form input handling and reactivity --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -19,7 +19,8 @@
|
||||
color="gray"
|
||||
icon="i-heroicons-credit-card"
|
||||
:loading="billingLoading"
|
||||
@click="openBillingDashboard"
|
||||
:to="{ name: 'redirect-billing-portal' }"
|
||||
target="_blank"
|
||||
>
|
||||
<span v-if="canCancel">Manage Subscription & Invoices</span>
|
||||
<span else>Billing & Invoices</span>
|
||||
@@ -117,15 +118,4 @@ const cancelSubscription = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const openBillingDashboard = () => {
|
||||
billingLoading.value = true
|
||||
opnFetch('/subscription/billing-portal').then((data) => {
|
||||
const url = data.portal_url
|
||||
window.location = url
|
||||
}).catch((error) => {
|
||||
useAlert().error(error.data.message)
|
||||
}).finally(() => {
|
||||
billingLoading.value = false
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user