fix: payment auth

This commit is contained in:
Arman committed 2023-12-07 14:06:23 +01:00
1 parent 871e1925cc
commit d221a2ca24
3 files changed
+12 -5

No files matched your search

@@ -21,7 +21,7 @@
</Button>
<Button
secondary
href={`${endpoint}/organizations/${$organization.$id}/billing?type=confirmation&invoice=${$actionRequiredInvoices.invoices[0].$id}`}>
href={`/organization-${$organization.$id}/billing?type=confirmation&invoice=${$actionRequiredInvoices.invoices[0].$id}`}>
Authorize payment
</Button>
</svelte:fragment>
+1 -1
View File
@@ -46,7 +46,7 @@ function createHeaderAlertStore() {
});
return n;
});
return component;
return component as HeaderAlert;
}
};
}
+10 -3
View File
@@ -10,7 +10,7 @@
import { log } from '$lib/stores/logs';
import { newOrgModal, organization } from '$lib/stores/organization';
import { wizard } from '$lib/stores/wizard';
import { onMount } from 'svelte';
import { afterUpdate, onMount } from 'svelte';
import { loading, requestedMigration } from '../store';
import Create from './createOrganization.svelte';
import {
@@ -242,7 +242,7 @@
}
]);
let isOpen = false;
let selectedHeaderAlert = headerAlert.get();
onMount(async () => {
loading.set(false);
if (isCloud && !$page.url.pathname.includes('/console/onboarding')) {
@@ -314,6 +314,7 @@
});
}
checkPaymentAuthorizationRequired();
selectedHeaderAlert = headerAlert.get();
}
});
@@ -448,6 +449,7 @@
$actionRequiredInvoices = await sdk.forConsole.billing.listInvoices($organization.$id, [
Query.equal('status', 'requires_authentication')
]);
console.log($actionRequiredInvoices);
if ($actionRequiredInvoices && $actionRequiredInvoices.total) {
headerAlert.add({
id: 'paymentAuthRequired',
@@ -455,6 +457,7 @@
show: true,
importance: 8
});
console.log($headerAlert);
}
}
@@ -469,7 +472,11 @@
$registerSearchers(orgSearcher, projectsSearcher);
$: selectedHeaderAlert = headerAlert.get();
afterUpdate(() => {
selectedHeaderAlert = headerAlert.get();
});
$: console.log(selectedHeaderAlert);
</script>
<CommandCenter />