@@ -7,7 +8,7 @@
View or update your organization payment methods here.
-
+ (showPayment = true)}>
Add a payment method
diff --git a/src/routes/console/organization-[organization]/billing/paymentModal.svelte b/src/routes/console/organization-[organization]/billing/paymentModal.svelte
new file mode 100644
index 000000000..9f7b69f9a
--- /dev/null
+++ b/src/routes/console/organization-[organization]/billing/paymentModal.svelte
@@ -0,0 +1,90 @@
+
+
+
+ Add Payment Method
+ This payment method will be added to the Acme Org billing details.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/routes/console/organization-[organization]/billing/paymentSummary.svelte b/src/routes/console/organization-[organization]/billing/paymentSummary.svelte
index bf55230cb..bd60176b9 100644
--- a/src/routes/console/organization-[organization]/billing/paymentSummary.svelte
+++ b/src/routes/console/organization-[organization]/billing/paymentSummary.svelte
@@ -1,5 +1,6 @@
@@ -13,5 +14,11 @@
X projects
+ {#if VARS.CONSOLE_TIER && VARS.CONSOLE_TIER !== 'base'}
+
+
Next billing data
+
XX DATE
+
+ {/if}
diff --git a/src/routes/console/organization-[organization]/billing/stripe.ts b/src/routes/console/organization-[organization]/billing/stripe.ts
new file mode 100644
index 000000000..c0b61afb1
--- /dev/null
+++ b/src/routes/console/organization-[organization]/billing/stripe.ts
@@ -0,0 +1,33 @@
+import { writable } from 'svelte/store';
+import Stripe from 'stripe';
+
+export const publicKey = import.meta.env?.VITE_STRIPE_PUBLIC_KEY?.toString() as string | undefined;
+export const secretKey = import.meta.env?.VITE_STRIPE_SECRET_KEY?.toString() as string | undefined;
+export const stripe = new Stripe(secretKey, undefined);
+
+function createCustomerStore() {
+ const { subscribe, set } = writable(undefined);
+ return {
+ subscribe,
+ set,
+ load: async (id: string) => {
+ const customer: Stripe.Customer | Stripe.DeletedCustomer =
+ await stripe.customers.retrieve(id);
+ set(customer);
+ },
+ create: async (params: Stripe.CustomerCreateParams) => {
+ const customer: Stripe.Customer = await stripe.customers.create(params);
+ set(customer);
+ },
+ update: async (id: string, params: Stripe.CustomerUpdateParams) => {
+ const customer: Stripe.Customer = await stripe.customers.update(id, params);
+ set(customer);
+ },
+ remove: async (id: string) => {
+ const customer: Stripe.DeletedCustomer = await stripe.customers.del(id);
+ set(customer);
+ }
+ };
+}
+
+export const customer = createCustomerStore();