diff --git a/client/components/open/forms/fields/FormFieldEdit.vue b/client/components/open/forms/fields/FormFieldEdit.vue
index 156f7b5a..3f47d17f 100644
--- a/client/components/open/forms/fields/FormFieldEdit.vue
+++ b/client/components/open/forms/fields/FormFieldEdit.vue
@@ -24,7 +24,10 @@
:type="field.type"
/>
-
+
{{ blocksTypes[field.type].title }}
diff --git a/client/components/pages/auth/components/RegisterForm.vue b/client/components/pages/auth/components/RegisterForm.vue
index a5334ab5..c77290bb 100644
--- a/client/components/pages/auth/components/RegisterForm.vue
+++ b/client/components/pages/auth/components/RegisterForm.vue
@@ -69,10 +69,11 @@
+
I agree with the
of the website and I accept them.
+
diff --git a/client/components/pages/pricing/CheckoutDetailsModal.vue b/client/components/pages/pricing/CheckoutDetailsModal.vue
deleted file mode 100644
index 9627fa39..00000000
--- a/client/components/pages/pricing/CheckoutDetailsModal.vue
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
- Go to checkout
-
-
-
-
-
diff --git a/client/components/pages/pricing/PricingTable.vue b/client/components/pages/pricing/PricingTable.vue
index 05c0c9db..cf2e3e55 100644
--- a/client/components/pages/pricing/PricingTable.vue
+++ b/client/components/pages/pricing/PricingTable.vue
@@ -141,7 +141,8 @@
v-else-if="authenticated && user.is_subscribed"
class="mr-1"
:arrow="true"
- @click.prevent="openBilling"
+ :to="{ name: 'redirect-billing-portal' }"
+ target="_blank"
>
View Billing
@@ -222,15 +223,6 @@ export default {
computed: {},
- methods: {
- openBilling() {
- this.billingLoading = true
- opnFetch("/subscription/billing-portal").then((data) => {
- this.billingLoading = false
- const url = data.portal_url
- window.location = url
- })
- },
- },
+ methods: {},
}
diff --git a/client/components/pages/pricing/SubscriptionModal.vue b/client/components/pages/pricing/SubscriptionModal.vue
index fcd2480e..f537bc6b 100644
--- a/client/components/pages/pricing/SubscriptionModal.vue
+++ b/client/components/pages/pricing/SubscriptionModal.vue
@@ -92,9 +92,9 @@
Manage Plan
@@ -301,7 +301,9 @@
size="md"
class="w-auto flex-grow"
:loading="form.busy || loading"
- @click="saveDetails"
+ :disabled="form.busy || loading"
+ :to="checkoutUrl"
+ target="_blank"
>
Upgrade
@@ -329,6 +331,7 @@
diff --git a/client/composables/useCheckoutUrl.js b/client/composables/useCheckoutUrl.js
new file mode 100644
index 00000000..3f25fa91
--- /dev/null
+++ b/client/composables/useCheckoutUrl.js
@@ -0,0 +1,42 @@
+import { computed, unref } from 'vue'
+
+export const useCheckoutUrl = (name, email, plan, yearly, currency) => {
+ return computed(() => {
+ // Unwrap refs if they are passed
+ const nameValue = unref(name)
+ const emailValue = unref(email)
+ const planValue = unref(plan)
+ const yearlyValue = unref(yearly)
+ const currencyValue = unref(currency)
+
+ const params = {
+ plan: planValue,
+ yearly: yearlyValue.toString(),
+ currency: currencyValue,
+ name: nameValue,
+ email: emailValue
+ }
+
+ // Get trial duration if exists - only in client side
+ if (import.meta.client) {
+ const urlParams = new URLSearchParams(window.location.search)
+ const trialDuration = urlParams.get('trial_duration')
+ if (trialDuration) {
+ params.trial_duration = trialDuration
+ // Keep the amplitude event
+ useAmplitude().logEvent('extended_trial_used', { duration: trialDuration })
+ }
+ }
+
+ // Filter out empty params
+ const filteredParams = Object.fromEntries(
+ // eslint-disable-next-line no-unused-vars
+ Object.entries(params).filter(([_, value]) => value !== null && value !== undefined && value !== '')
+ )
+
+ return {
+ name: 'redirect-checkout',
+ query: filteredParams
+ }
+ })
+}
\ No newline at end of file
diff --git a/client/pages/redirect/billing-portal.vue b/client/pages/redirect/billing-portal.vue
new file mode 100644
index 00000000..8a14d761
--- /dev/null
+++ b/client/pages/redirect/billing-portal.vue
@@ -0,0 +1,29 @@
+
+
+
+
+ Redirecting to billing portal...
+
+
+
+
+
\ No newline at end of file
diff --git a/client/pages/redirect/checkout.vue b/client/pages/redirect/checkout.vue
new file mode 100644
index 00000000..b080e056
--- /dev/null
+++ b/client/pages/redirect/checkout.vue
@@ -0,0 +1,62 @@
+
+
+
+
+ Preparing your checkout...
+
+
+
+
+
\ No newline at end of file
diff --git a/client/pages/settings/billing.vue b/client/pages/settings/billing.vue
index f53fc3d2..eac5dc55 100644
--- a/client/pages/settings/billing.vue
+++ b/client/pages/settings/billing.vue
@@ -19,7 +19,8 @@
color="gray"
icon="i-heroicons-credit-card"
:loading="billingLoading"
- @click="openBillingDashboard"
+ :to="{ name: 'redirect-billing-portal' }"
+ target="_blank"
>
Manage Subscription & Invoices
Billing & Invoices
@@ -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
- })
-}