mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: billings checks on load
This commit is contained in:
1 parent
ae75f33145
commit
636fa27e2f
2 files changed
+8
-5
No files matched your search
@@ -279,6 +279,7 @@ export const paymentMissingMandate = writable<PaymentMethodData>(null);
|
||||
|
||||
export async function checkForMandate(org: Organization) {
|
||||
const paymentId = org.paymentMethodId ?? org.backupPaymentMethodId;
|
||||
if (!paymentId) return;
|
||||
const paymentMethod = await sdk.forConsole.billing.getPaymentMethod(paymentId);
|
||||
if (paymentMethod.mandateId === null && paymentMethod.country === 'in') {
|
||||
headerAlert.add({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { INTERVAL } from '$lib/constants';
|
||||
import { BillingPlan, INTERVAL } from '$lib/constants';
|
||||
import { Logs } from '$lib/layout';
|
||||
import Footer from '$lib/layout/footer.svelte';
|
||||
import Header from '$lib/layout/header.svelte';
|
||||
@@ -267,12 +267,14 @@
|
||||
organization.subscribe(async (org) => {
|
||||
if (!org) return;
|
||||
if (isCloud) {
|
||||
calculateTrialDay(org);
|
||||
await paymentExpired(org);
|
||||
await checkForUsageLimit(org);
|
||||
checkForMarkedForDeletion(org);
|
||||
await checkPaymentAuthorizationRequired(org);
|
||||
await checkForMandate(org);
|
||||
if (org?.billingPlan !== BillingPlan.STARTER) {
|
||||
calculateTrialDay(org);
|
||||
await paymentExpired(org);
|
||||
await checkPaymentAuthorizationRequired(org);
|
||||
await checkForMandate(org);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user