diff --git a/src/routes/console/account/header.svelte b/src/routes/console/account/header.svelte index 71d54f3d3..9c7f0c333 100644 --- a/src/routes/console/account/header.svelte +++ b/src/routes/console/account/header.svelte @@ -34,6 +34,12 @@ title: 'Organizations', event: 'organizations', hasChildren: true + }, + { + href: `${path}/payments`, + title: 'Payments details', + event: 'payments', + hasChildren: true } ]; diff --git a/src/routes/console/account/payments/+page.svelte b/src/routes/console/account/payments/+page.svelte new file mode 100644 index 000000000..8da780215 --- /dev/null +++ b/src/routes/console/account/payments/+page.svelte @@ -0,0 +1,23 @@ + + + + + + + + + + +{#if showPayment} + +{/if} diff --git a/src/routes/console/account/payments/+page.ts b/src/routes/console/account/payments/+page.ts new file mode 100644 index 000000000..fbb26b0b1 --- /dev/null +++ b/src/routes/console/account/payments/+page.ts @@ -0,0 +1,12 @@ +import { Dependencies } from '$lib/constants'; +import { sdk } from '$lib/stores/sdk'; +import type { PageLoad } from './$types'; + +export const load: PageLoad = async ({ params, parent, depends }) => { + await parent(); + depends(Dependencies.PAYMENT_METHODS); + + return { + // paymentMethods: await sdk.forConsole.billing.listPaymentMethods() + }; +}; diff --git a/src/routes/console/account/payments/availableCredit.svelte b/src/routes/console/account/payments/availableCredit.svelte new file mode 100644 index 000000000..1b63715fb --- /dev/null +++ b/src/routes/console/account/payments/availableCredit.svelte @@ -0,0 +1,45 @@ + + + + Available Credit + +

Appwrite credit will automatically be applied to your next invoice.

+ +

Credit balance: {credit}

+ + + + +
+ + + + +
diff --git a/src/routes/console/account/payments/billingAddress.svelte b/src/routes/console/account/payments/billingAddress.svelte new file mode 100644 index 000000000..93de721d1 --- /dev/null +++ b/src/routes/console/account/payments/billingAddress.svelte @@ -0,0 +1,16 @@ + + + + Billing Address + +

+ View or update your billing address. This address will appear on your invoice. +

+ + +

Add a billing address

+
+
+
diff --git a/src/routes/console/account/payments/paymentHistory.svelte b/src/routes/console/account/payments/paymentHistory.svelte new file mode 100644 index 000000000..47579a499 --- /dev/null +++ b/src/routes/console/account/payments/paymentHistory.svelte @@ -0,0 +1,20 @@ + + + + Payment History + +

+ Transaction history for this Organization. Download invoices for more details about your + payments. +

+ + +

+ You have no payment history. After you receive your first invoice, you'll see it + here. +

+
+
+
diff --git a/src/routes/console/account/payments/paymentMethods.svelte b/src/routes/console/account/payments/paymentMethods.svelte new file mode 100644 index 000000000..22b8757d0 --- /dev/null +++ b/src/routes/console/account/payments/paymentMethods.svelte @@ -0,0 +1,33 @@ + + + + Payment Methods + +

View or update your organization payment methods here.

+ + {#if $paymentMethods.total > 0} + {#each $paymentMethods.paymentMethods as paymentMethod} +

+ {paymentMethod.brand} + {paymentMethod.last4}, expiring: {paymentMethod.expiryMonth}/{paymentMethod.expiryYear} + {#if paymentMethod.default} {/if} +

+ {/each} + + {:else} + (showPayment = true)}> +

Add a payment method

+
+ {/if} +
+
diff --git a/src/routes/console/account/payments/paymentModal.svelte b/src/routes/console/account/payments/paymentModal.svelte new file mode 100644 index 000000000..ff7fae0d2 --- /dev/null +++ b/src/routes/console/account/payments/paymentModal.svelte @@ -0,0 +1,110 @@ + + + + Add Payment Method + This payment method will be added to the {$organization.name} billing details. + + + +
+ +
+

+ You won't be charged immediately. You will be charged for your plan on the first day of + each month using the payment method you've specified above. +

+
+ + + + +
diff --git a/src/routes/console/account/payments/paymentSummary.svelte b/src/routes/console/account/payments/paymentSummary.svelte new file mode 100644 index 000000000..bd60176b9 --- /dev/null +++ b/src/routes/console/account/payments/paymentSummary.svelte @@ -0,0 +1,24 @@ + + + + Payment Summary + +

An overview of your upcoming payments.

+ + + +
PLACEHOLDER PLAN
+
+

X projects

+
+ {#if VARS.CONSOLE_TIER && VARS.CONSOLE_TIER !== 'base'} +
+

Next billing data

+

XX DATE

+
+ {/if} +
+
diff --git a/src/routes/console/account/payments/store.ts b/src/routes/console/account/payments/store.ts new file mode 100644 index 000000000..2a4322e3e --- /dev/null +++ b/src/routes/console/account/payments/store.ts @@ -0,0 +1,6 @@ +import { page } from '$app/stores'; +import { derived } from 'svelte/store'; + +export const publicKey = import.meta.env?.VITE_STRIPE_PUBLIC_KEY?.toString() as string | undefined; + +export const paymentMethods = derived(page, ($page) => $page.data.paymentMethods); diff --git a/src/routes/console/createOrganizationCloud.svelte b/src/routes/console/createOrganizationCloud.svelte index 61f2d6284..7d67cece7 100644 --- a/src/routes/console/createOrganizationCloud.svelte +++ b/src/routes/console/createOrganizationCloud.svelte @@ -78,5 +78,6 @@ diff --git a/src/routes/console/wizard/step2.svelte b/src/routes/console/wizard/step2.svelte index cb157ae91..0bbd414d2 100644 --- a/src/routes/console/wizard/step2.svelte +++ b/src/routes/console/wizard/step2.svelte @@ -44,7 +44,6 @@
{#each methods as method} -
test
import { Alert } from '$lib/components'; - import { Button, FormList, InputEmail } from '$lib/elements/forms'; + import { Button, Form, FormList, InputEmail } from '$lib/elements/forms'; import { Table, TableBody, @@ -44,7 +44,8 @@ {#if $createOrganization.tier === 'pro'} - Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto, quasi? + You can add unlimited organization members on the Pro plan for $20 each. Each member + added will receive an email invite to your organization on completion. {:else if $createOrganization.tier === 'starter'} You can add up to three organization members with the Starter plan for $10 each. Each member added will receive an email invite to your organization on completion. @@ -54,45 +55,55 @@ {/if} - - - - +
+
+ + + + +
+
{#if $createOrganization?.collaborators?.length} - - - Collaborator - Cost - Admin - - - - {#each $createOrganization.collaborators as collaborator} - - {collaborator.email} - PRICE - - - - - - - - {/each} - -
+
+ + + Collaborator + Cost + Admin + + + + {#each $createOrganization.collaborators as collaborator} + + {collaborator.email} + PRICE + + + + + + + + {/each} + +
+
{/if} diff --git a/src/routes/console/wizard/step4.svelte b/src/routes/console/wizard/step4.svelte index 30d750c11..5b04ad32a 100644 --- a/src/routes/console/wizard/step4.svelte +++ b/src/routes/console/wizard/step4.svelte @@ -1,94 +1,42 @@ - Organization Details - - + Confirm your details + Confirm the details of your new organization and start your free trial. + - {#if !showCustomId} -
- (showCustomId = !showCustomId)}> - -
- {:else} - +

Organization name

+
+

{$createOrganization.name}

+ {#if $createOrganization?.id} + {$createOrganization.id} {/if} - +
-

Plan

-

- For more details on our plans, visit our pricing page. -

-
    - {#if !anyOrgFree} -
  • - - -
    -

    Free - $0/month

    -

    For personal, passion projects.

    -
    -
    -
    -
  • - {/if} -
  • - - -
    -

    - Starter - $10/month per organization member -

    -

    - For small organizations that want flexibility. -

    -
    - 14 DAY FREE TRIAL -
    -
    -
  • -
  • - - -
    -

    - Pro - $20/month per organization member + exta usage -

    -

    - For organizations that need the ability scale easily. -

    -
    - 14 DAY FREE TRIAL -
    -
    -
  • -
+
+

Organization members

+

{$createOrganization?.collaborators?.length ?? 0} invited

+
+
+

Payment

+

{$createOrganization.payment}

+
+ +
+

{$createOrganization.tier} plan

+

Invited members

+

Credit added

+
+

Estimated total

+ +

+ This amount and any extra usage fees will be charged on a recurring 30 day billing cycle + after your trial period ends on DATE +

+