diff --git a/svelte/src/user_home/DepositCredit.svelte b/svelte/src/user_home/DepositCredit.svelte index aabd281..50cd400 100644 --- a/svelte/src/user_home/DepositCredit.svelte +++ b/svelte/src/user_home/DepositCredit.svelte @@ -3,20 +3,28 @@ import { onMount } from "svelte"; import Euro from "../util/Euro.svelte"; import { formatDate } from "../util/Formatting.svelte"; import LoadingIndicator from "../util/LoadingIndicator.svelte"; +import MollieDeposit from "./MollieDeposit.svelte"; let loading = false let credit_amount = 10 -const checkout = async (network) => { +const checkout = async (network = "", amount = 0, country = "") => { loading = true + + if (amount < 10) { + alert("Amount needs to be at least €10") + return + } + const form = new FormData() - form.set("amount", credit_amount*1e6) + form.set("amount", amount*1e6) form.set("network", network) + form.set("country", country) try { const resp = await fetch( - window.api_endpoint+"/btcpay/deposit", - { method: "POST", body: form }, + window.api_endpoint+"/user/invoice", + {method: "POST", body: form}, ) if(resp.status >= 400) { let json = await resp.json() @@ -35,7 +43,7 @@ let invoices = [] const load_invoices = async () => { loading = true try { - const resp = await fetch(window.api_endpoint+"/btcpay/invoice") + const resp = await fetch(window.api_endpoint+"/user/invoice") if(resp.status >= 400) { throw new Error((await resp.json()).message) } @@ -66,19 +74,19 @@ onMount(() => {

Deposit credits

- To deposit funds on your pixeldrain account please contact - sales@pixeldrain.com. We will - prepare an invoice for you. We accept wire transfers and PayPal. As we - are located in the Netherlands SEPA payments should be free and instant. + Pixeldrain credits can be used for our prepaid plans, which are + different from the Patreon plans. With prepaid you only pay for what you + use, at a rate of €4 per TB per month for storage and €2 per TB for data + transfer.

- Pixeldrain credits can be used for our prepaid plans, which are - different from the Patreon plans. Because preparing invoices requires - some manual labour we only accept deposits of €100 or more. The prepaid - plans are meant for people who require a lot of bandwidth or storage. - Paying only for what you use means you can save money compared to a - fixed monthly price. + Use the form below to deposit credit on your pixeldrain account using + Mollie. The minimum deposit is €10. Mollie payments are currently + only available in Europe.

+ + checkout("mollie", e.detail.amount, e.detail.country)}/> +

Crypto payments

Alternatively you can use Bitcoin, Lightning network ( {

Deposit amount € - +
Choose payment method:
- - -
@@ -118,6 +126,9 @@ onMount(() => { Created Amount + VAT + Country + Method Status @@ -126,23 +137,28 @@ onMount(() => { {#each invoices as row (row.id)} {formatDate(row.time, true, true, false)} - + + + {row.country} + {row.payment_method} - {#if row.status === "InvoiceCreated"} - New (waiting for payment) + {#if row.status === "InvoiceCreated" || row.status === "open"} + Waiting for payment {:else if row.status === "InvoiceProcessing"} Payment received, waiting for confirmations - {:else if row.status === "InvoiceSettled"} + {:else if row.status === "InvoiceSettled" || row.status === "paid"} Paid {:else if row.status === "InvoiceExpired"} Expired + {:else if row.status === "canceled"} + Canceled {:else} {row.status} {/if} - {#if row.status === "New" || row.status === "InvoiceCreated"} -
+ {#if row.status === "New" || row.status === "InvoiceCreated" || row.status === "open"} + paid Pay {/if} diff --git a/svelte/src/user_home/MollieDeposit.svelte b/svelte/src/user_home/MollieDeposit.svelte new file mode 100644 index 0000000..158e577 --- /dev/null +++ b/svelte/src/user_home/MollieDeposit.svelte @@ -0,0 +1,148 @@ + + +
+ {#if country === null} + +
Please pick your country of residence
+
+ {#each countries as c} + + {/each} +
+ + {:else} + +
+ +
+
+ Paying from + + {country.name} ({country.vat}% VAT) +
+
+ +
+
Please choose an amount
+ {#each amounts as a} + + {/each} + +
+
Custom amount €
+ +
+ +
+ Total including VAT: + +
+ + +
+ {/if} +
+ + diff --git a/svelte/src/user_home/Subscription.svelte b/svelte/src/user_home/Subscription.svelte index 625369b..3c6ac98 100644 --- a/svelte/src/user_home/Subscription.svelte +++ b/svelte/src/user_home/Subscription.svelte @@ -1,4 +1,5 @@
+ {#if checkout_success} +
+

Payment successful!

+

+ The credit has been added to your account balance. Activate a + subscription plan below to finish upgrading your account. +

+
+ {/if}

Manage subscription

Current account balance:

- When your prepaid subscription is active you will be charged daily based - on usage. The prepaid subscription will stay active for as long as you - have credit on your account. When you reach negative balance the - subscription will automatically end. You will need a positive balance to - activate the subscription again. + Prepaid subscriptions are charged daily based on usage. When you reach + negative balance the subscription will automatically end. You will need + a positive balance to activate the subscription again.

Prepaid plans

@@ -65,16 +83,28 @@ const update = async () => {
    -
  • Base price of €1 per month
  • +
  • Base price of €2 per month
  • €4 per TB per month for storage
  • -
  • €2 per TB for data transfer
  • +
  • + €2 per TB for data transfer (with bandwidth sharing + enabled) +
  • Files never expire as long as subscription is active
  • +
  • + Download page branding + options +
  • +
  • + File embedding + control options +
- 120 days storage
+ 240 days storage
{#if subscription === "prepaid_temp_storage_120d"} Currently active {:else} @@ -88,8 +118,20 @@ const update = async () => {
  • Base price of €1 per month
  • €0.50 per TB per month for storage
  • -
  • €2 per TB for data transfer
  • -
  • Files expire 120 days after the last time they're viewed
  • +
  • + €2 per TB for data transfer (with bandwidth sharing + enabled) +
  • +
  • Files never expire as long as subscription is active
  • +
  • + Download page branding + options +
  • +
  • + File embedding + control options +
@@ -108,6 +150,7 @@ const update = async () => {
  • Standard free plan, files expire after 60 days.
  • +
  • Download limit of 10 GB per day
diff --git a/svelte/src/user_home/Transactions.svelte b/svelte/src/user_home/Transactions.svelte index 15de7fc..adff0d1 100644 --- a/svelte/src/user_home/Transactions.svelte +++ b/svelte/src/user_home/Transactions.svelte @@ -147,32 +147,34 @@ onMount(() => { Time Balance Subscription - Storage - Bandwidth + Storage + Bandwidth Deposit - - - - Charge - Charge - Usage - Charge - Usage - - {#each transactions.rows as row} - {formatDate(row.time, true, true, false)} - - - - {formatDataVolume(row.storage_used, 3)} - - {formatDataVolume(row.bandwidth_used, 3)} - + + {formatDate(row.time, true, true, false)} + + + + + + + + + + ({formatDataVolume(row.storage_used, 3)}) + + + + ({formatDataVolume(row.bandwidth_used, 3)}) + + + + {/each}