remove update subscription flow overall from UI
This commit is contained in:
@@ -53,12 +53,6 @@ class EnterpriseAccountAPI extends ApiClient {
|
||||
return axios.post(`${this.url}cancel_subscription`, data);
|
||||
}
|
||||
|
||||
updateSubscriptionQuantity(quantity) {
|
||||
return axios.post(`${this.url}update_subscription_quantity`, {
|
||||
quantity,
|
||||
});
|
||||
}
|
||||
|
||||
changePricingPlan(data) {
|
||||
return axios.post(`${this.url}change_pricing_plan`, data);
|
||||
}
|
||||
|
||||
@@ -132,7 +132,9 @@ onMounted(handleInitialLoad);
|
||||
<BillingCard
|
||||
v-else
|
||||
:title="$t('BILLING_SETTINGS_V2.TOPUP_OPTIONS.TITLE')"
|
||||
:description="$t('BILLING_SETTINGS_V2.TOPUP_OPTIONS.UPGRADE_REQUIRED')"
|
||||
:description="
|
||||
$t('BILLING_SETTINGS_V2.TOPUP_OPTIONS.UPGRADE_REQUIRED')
|
||||
"
|
||||
>
|
||||
<div class="px-5 pb-5">
|
||||
<p class="text-sm text-n-600">
|
||||
|
||||
+8
-1
@@ -243,6 +243,7 @@ const handleUpdateQuantity = async () => {
|
||||
isUpdatingQuantity.value = true;
|
||||
try {
|
||||
const result = await store.dispatch('accounts/v2UpdateQuantity', {
|
||||
pricingPlanId: currentPlanId.value,
|
||||
quantity: newQuantity.value,
|
||||
});
|
||||
if (result.success) {
|
||||
@@ -270,7 +271,13 @@ const isCurrentPlan = plan => {
|
||||
v-if="hasActiveSubscription && !isCancellingAtPeriodEnd"
|
||||
#action
|
||||
>
|
||||
<ButtonV4 sm faded red :is-loading="isCanceling" @click="openCancelModal">
|
||||
<ButtonV4
|
||||
sm
|
||||
faded
|
||||
red
|
||||
:is-loading="isCanceling"
|
||||
@click="openCancelModal"
|
||||
>
|
||||
{{ $t('BILLING_SETTINGS_V2.PRICING_PLANS.CANCEL_SUBSCRIPTION') }}
|
||||
</ButtonV4>
|
||||
</template>
|
||||
|
||||
@@ -26,7 +26,9 @@ const {
|
||||
} = useCaptain();
|
||||
|
||||
const uiFlags = useMapGetter('accounts/getUIFlags');
|
||||
const isStripeBillingV2Enabled = useMapGetter('globalConfig/isStripeBillingV2Enabled');
|
||||
const isStripeBillingV2Enabled = useMapGetter(
|
||||
'globalConfig/isStripeBillingV2Enabled'
|
||||
);
|
||||
const store = useStore();
|
||||
|
||||
const BILLING_REFRESH_ATTEMPTED = 'billing_refresh_attempted';
|
||||
|
||||
@@ -304,13 +304,18 @@ export const actions = {
|
||||
}
|
||||
},
|
||||
|
||||
v2UpdateQuantity: async ({ commit, dispatch }, { quantity }) => {
|
||||
v2UpdateQuantity: async (
|
||||
{ commit, dispatch },
|
||||
{ pricingPlanId, quantity }
|
||||
) => {
|
||||
commit(types.default.SET_V2_BILLING_UI_FLAG, {
|
||||
isSubscribeInProcess: true,
|
||||
});
|
||||
try {
|
||||
const response =
|
||||
await EnterpriseAccountAPI.updateSubscriptionQuantity(quantity);
|
||||
const response = await EnterpriseAccountAPI.changePricingPlan({
|
||||
pricing_plan_id: pricingPlanId,
|
||||
quantity,
|
||||
});
|
||||
// Update account with new quantity
|
||||
if (response.data.id && response.data.custom_attributes) {
|
||||
commit(types.default.SET_ACCOUNT_LIMITS, response.data);
|
||||
|
||||
Reference in New Issue
Block a user