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:
Chirag Chhatrala
2025-03-05 16:46:33 +05:30
committed by GitHub
parent b633f97ce1
commit a59b46665c
9 changed files with 193 additions and 221 deletions

View File

@@ -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>