billing V2 frontend

This commit is contained in:
Tanmay Sharma
2025-10-27 14:18:25 +05:30
parent 3ba4340042
commit 45af6266bb
11 changed files with 1433 additions and 9 deletions
@@ -23,6 +23,35 @@ class EnterpriseAccountAPI extends ApiClient {
action_type: action,
});
}
getCreditBalance() {
return axios.get(`${this.url}credits_balance`);
}
getV2PricingPlans() {
return axios.get(`${this.url}v2_pricing_plans`);
}
getV2TopupOptions() {
return axios.get(`${this.url}v2_topup_options`);
}
purchaseTopup(credits) {
return axios.post(`${this.url}v2_topup`, { credits });
}
subscribeToV2Plan(pricing_plan_id, quantity = 1) {
return axios.post(`${this.url}v2_subscribe`, { pricing_plan_id, quantity });
}
cancelSubscription(options = {}) {
const { feedback = null, comment = null } = options;
return axios.post(`${this.url}cancel_subscription`, {
feedback,
comment,
});
}
}
export default new EnterpriseAccountAPI();