From 5382d53513f950309a35885f7897409311d0f734 Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Wed, 9 Apr 2025 09:47:15 +0200 Subject: [PATCH] Update prepaid checkout to allow all countries --- res/static/img/payment_providers/Voucher.svg | 59 ----- .../img/payment_providers/apple_pay.svg | 11 + res/static/img/payment_providers/applepay.svg | 1 - res/static/img/payment_providers/bancomat.svg | 11 + .../img/payment_providers/bancontact.svg | 25 +- .../img/payment_providers/banktransfer.svg | 1 - res/static/img/payment_providers/belfius.svg | 12 +- res/static/img/payment_providers/blik.svg | 23 ++ .../img/payment_providers/creditcard.svg | 62 ++++- .../img/payment_providers/directdebit.svg | 1 - res/static/img/payment_providers/eps.svg | 12 +- res/static/img/payment_providers/giftcard.svg | 1 - res/static/img/payment_providers/giropay.svg | 1 - .../img/payment_providers/google_pay.svg | 17 ++ res/static/img/payment_providers/ideal.svg | 29 ++- .../img/payment_providers/ideal_in3.svg | 28 +++ res/static/img/payment_providers/in3.svg | 14 -- res/static/img/payment_providers/kbc.svg | 16 +- res/static/img/payment_providers/klarna.svg | 5 - res/static/img/payment_providers/mb_way.svg | 1 + .../img/payment_providers/multibanco.svg | 1 + res/static/img/payment_providers/mybank.svg | 10 - res/static/img/payment_providers/p24.svg | 13 + res/static/img/payment_providers/paypal.svg | 14 +- .../img/payment_providers/paysafecard.svg | 1 - res/static/img/payment_providers/postepay.svg | 4 - .../img/payment_providers/przelewy24.svg | 1 - res/static/img/payment_providers/riverty.svg | 12 + res/static/img/payment_providers/satispay.svg | 17 ++ res/static/img/payment_providers/sepa.svg | 14 ++ res/static/img/payment_providers/sofort.svg | 5 - res/static/img/payment_providers/twint.svg | 44 ++++ res/static/style/layout.css | 24 +- res/template/status.html | 25 ++ svelte/package-lock.json | 13 +- svelte/package.json | 1 + svelte/src/file_viewer/ReportWindow.svelte | 3 +- .../file_viewer/viewers/BandwidthUsage.svelte | 2 +- .../src/file_viewer/viewers/RateLimit.svelte | 2 +- svelte/src/layout/SlowDown.svelte | 4 +- svelte/src/lib/PixeldrainAPI.ts | 11 + svelte/src/user_home/MollieDeposit.svelte | 237 ++++++++++-------- webcontroller/web_controller.go | 3 +- 43 files changed, 534 insertions(+), 257 deletions(-) delete mode 100644 res/static/img/payment_providers/Voucher.svg create mode 100644 res/static/img/payment_providers/apple_pay.svg delete mode 100644 res/static/img/payment_providers/applepay.svg create mode 100644 res/static/img/payment_providers/bancomat.svg delete mode 100644 res/static/img/payment_providers/banktransfer.svg create mode 100644 res/static/img/payment_providers/blik.svg delete mode 100644 res/static/img/payment_providers/directdebit.svg delete mode 100644 res/static/img/payment_providers/giftcard.svg delete mode 100644 res/static/img/payment_providers/giropay.svg create mode 100644 res/static/img/payment_providers/google_pay.svg create mode 100644 res/static/img/payment_providers/ideal_in3.svg delete mode 100644 res/static/img/payment_providers/in3.svg delete mode 100644 res/static/img/payment_providers/klarna.svg create mode 100644 res/static/img/payment_providers/mb_way.svg create mode 100644 res/static/img/payment_providers/multibanco.svg delete mode 100644 res/static/img/payment_providers/mybank.svg create mode 100644 res/static/img/payment_providers/p24.svg delete mode 100644 res/static/img/payment_providers/paysafecard.svg delete mode 100644 res/static/img/payment_providers/postepay.svg delete mode 100644 res/static/img/payment_providers/przelewy24.svg create mode 100644 res/static/img/payment_providers/riverty.svg create mode 100644 res/static/img/payment_providers/satispay.svg create mode 100644 res/static/img/payment_providers/sepa.svg delete mode 100644 res/static/img/payment_providers/sofort.svg create mode 100644 res/static/img/payment_providers/twint.svg create mode 100644 res/template/status.html diff --git a/res/static/img/payment_providers/Voucher.svg b/res/static/img/payment_providers/Voucher.svg deleted file mode 100644 index d04256e..0000000 --- a/res/static/img/payment_providers/Voucher.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/res/static/img/payment_providers/apple_pay.svg b/res/static/img/payment_providers/apple_pay.svg new file mode 100644 index 0000000..8b27d47 --- /dev/null +++ b/res/static/img/payment_providers/apple_pay.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/res/static/img/payment_providers/applepay.svg b/res/static/img/payment_providers/applepay.svg deleted file mode 100644 index 38e14ee..0000000 --- a/res/static/img/payment_providers/applepay.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/static/img/payment_providers/bancomat.svg b/res/static/img/payment_providers/bancomat.svg new file mode 100644 index 0000000..41a4f3f --- /dev/null +++ b/res/static/img/payment_providers/bancomat.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/res/static/img/payment_providers/bancontact.svg b/res/static/img/payment_providers/bancontact.svg index 9e2154d..5d5484f 100644 --- a/res/static/img/payment_providers/bancontact.svg +++ b/res/static/img/payment_providers/bancontact.svg @@ -1,15 +1,20 @@ - - - - + + + + + + - - - + + + - - - + + + + + + diff --git a/res/static/img/payment_providers/banktransfer.svg b/res/static/img/payment_providers/banktransfer.svg deleted file mode 100644 index 8a88323..0000000 --- a/res/static/img/payment_providers/banktransfer.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/static/img/payment_providers/belfius.svg b/res/static/img/payment_providers/belfius.svg index eb9eafa..80b6869 100644 --- a/res/static/img/payment_providers/belfius.svg +++ b/res/static/img/payment_providers/belfius.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/res/static/img/payment_providers/blik.svg b/res/static/img/payment_providers/blik.svg new file mode 100644 index 0000000..30c69b9 --- /dev/null +++ b/res/static/img/payment_providers/blik.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/creditcard.svg b/res/static/img/payment_providers/creditcard.svg index a22e26c..7ce087a 100644 --- a/res/static/img/payment_providers/creditcard.svg +++ b/res/static/img/payment_providers/creditcard.svg @@ -1 +1,61 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/directdebit.svg b/res/static/img/payment_providers/directdebit.svg deleted file mode 100644 index 8a88323..0000000 --- a/res/static/img/payment_providers/directdebit.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/static/img/payment_providers/eps.svg b/res/static/img/payment_providers/eps.svg index d56e47c..dca5431 100644 --- a/res/static/img/payment_providers/eps.svg +++ b/res/static/img/payment_providers/eps.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/res/static/img/payment_providers/giftcard.svg b/res/static/img/payment_providers/giftcard.svg deleted file mode 100644 index 7f70179..0000000 --- a/res/static/img/payment_providers/giftcard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/static/img/payment_providers/giropay.svg b/res/static/img/payment_providers/giropay.svg deleted file mode 100644 index 9113803..0000000 --- a/res/static/img/payment_providers/giropay.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/static/img/payment_providers/google_pay.svg b/res/static/img/payment_providers/google_pay.svg new file mode 100644 index 0000000..92f58fb --- /dev/null +++ b/res/static/img/payment_providers/google_pay.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/ideal.svg b/res/static/img/payment_providers/ideal.svg index ff5727e..b8c10f9 100644 --- a/res/static/img/payment_providers/ideal.svg +++ b/res/static/img/payment_providers/ideal.svg @@ -1,12 +1,19 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/ideal_in3.svg b/res/static/img/payment_providers/ideal_in3.svg new file mode 100644 index 0000000..7d21062 --- /dev/null +++ b/res/static/img/payment_providers/ideal_in3.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/in3.svg b/res/static/img/payment_providers/in3.svg deleted file mode 100644 index 418f0e6..0000000 --- a/res/static/img/payment_providers/in3.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/res/static/img/payment_providers/kbc.svg b/res/static/img/payment_providers/kbc.svg index 7f75295..a6c2d0f 100644 --- a/res/static/img/payment_providers/kbc.svg +++ b/res/static/img/payment_providers/kbc.svg @@ -1 +1,15 @@ - \ No newline at end of file + + + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/klarna.svg b/res/static/img/payment_providers/klarna.svg deleted file mode 100644 index 00c8b5a..0000000 --- a/res/static/img/payment_providers/klarna.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/res/static/img/payment_providers/mb_way.svg b/res/static/img/payment_providers/mb_way.svg new file mode 100644 index 0000000..29a5268 --- /dev/null +++ b/res/static/img/payment_providers/mb_way.svg @@ -0,0 +1 @@ + diff --git a/res/static/img/payment_providers/multibanco.svg b/res/static/img/payment_providers/multibanco.svg new file mode 100644 index 0000000..686f059 --- /dev/null +++ b/res/static/img/payment_providers/multibanco.svg @@ -0,0 +1 @@ + diff --git a/res/static/img/payment_providers/mybank.svg b/res/static/img/payment_providers/mybank.svg deleted file mode 100644 index d885cd9..0000000 --- a/res/static/img/payment_providers/mybank.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/res/static/img/payment_providers/p24.svg b/res/static/img/payment_providers/p24.svg new file mode 100644 index 0000000..2b8e43d --- /dev/null +++ b/res/static/img/payment_providers/p24.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/paypal.svg b/res/static/img/payment_providers/paypal.svg index 4b71ec3..b1d09fb 100644 --- a/res/static/img/payment_providers/paypal.svg +++ b/res/static/img/payment_providers/paypal.svg @@ -1 +1,13 @@ - \ No newline at end of file + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/paysafecard.svg b/res/static/img/payment_providers/paysafecard.svg deleted file mode 100644 index 73d5a20..0000000 --- a/res/static/img/payment_providers/paysafecard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/static/img/payment_providers/postepay.svg b/res/static/img/payment_providers/postepay.svg deleted file mode 100644 index 364ea4d..0000000 --- a/res/static/img/payment_providers/postepay.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/res/static/img/payment_providers/przelewy24.svg b/res/static/img/payment_providers/przelewy24.svg deleted file mode 100644 index 6f33785..0000000 --- a/res/static/img/payment_providers/przelewy24.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/res/static/img/payment_providers/riverty.svg b/res/static/img/payment_providers/riverty.svg new file mode 100644 index 0000000..0518391 --- /dev/null +++ b/res/static/img/payment_providers/riverty.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/satispay.svg b/res/static/img/payment_providers/satispay.svg new file mode 100644 index 0000000..d6bb32d --- /dev/null +++ b/res/static/img/payment_providers/satispay.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/sepa.svg b/res/static/img/payment_providers/sepa.svg new file mode 100644 index 0000000..9584c1b --- /dev/null +++ b/res/static/img/payment_providers/sepa.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/res/static/img/payment_providers/sofort.svg b/res/static/img/payment_providers/sofort.svg deleted file mode 100644 index 00c8b5a..0000000 --- a/res/static/img/payment_providers/sofort.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/res/static/img/payment_providers/twint.svg b/res/static/img/payment_providers/twint.svg new file mode 100644 index 0000000..30c9863 --- /dev/null +++ b/res/static/img/payment_providers/twint.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/static/style/layout.css b/res/static/style/layout.css index cd57e0b..ec26dc6 100644 --- a/res/static/style/layout.css +++ b/res/static/style/layout.css @@ -509,8 +509,7 @@ button, .button, input[type="submit"], input[type="button"], -input[type="color"], -select { +input[type="color"] { display: inline-flex; flex-direction: row; border-radius: 6px; @@ -544,13 +543,11 @@ button:hover, input[type="submit"]:hover, input[type="button"]:hover, input[type="color"]:hover, -select:hover, button:focus, .button:focus, input[type="submit"]:focus, input[type="button"]:focus, -input[type="color"]:focus, -select:focus { +input[type="color"]:focus { color: var(--input_text); text-decoration: none; background: var(--input_hover_background); @@ -560,8 +557,7 @@ button:active, .button:active, input[type="submit"]:active, input[type="button"]:active, -input[type="color"]:active, -select:active { +input[type="color"]:active { box-shadow: inset 4px 4px 6px var(--shadow_color); /* Exactly 3px offset compared to the inactive padding to give a depth effect */ padding: 6px 0px 0px 6px; @@ -586,9 +582,7 @@ input[type="submit"].disabled, input[type="button"]:disabled, input[type="button"].disabled, input[type="color"]:disabled, -input[type="color"].disabled, -select:disabled, -select.disabled { +input[type="color"].disabled { color: var(--input_disabled_text); box-shadow: none; transition: none; @@ -662,6 +656,7 @@ option { /* TEXT FIELDS */ textarea, +select, .groove, input[type="text"], input[type="password"], @@ -686,6 +681,7 @@ input[type="datetime-local"] { } textarea:active, +select:active, input[type="text"]:active, input[type="password"]:active, input[type="email"]:active, @@ -693,6 +689,7 @@ input[type="number"]:active, input[type="date"]:active, input[type="datetime-local"]:active, textarea:focus, +select:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, @@ -703,6 +700,7 @@ input[type="datetime-local"]:focus { } textarea:disabled, +select:disabled, input[type="text"]:disabled, input[type="password"]:disabled, input[type="email"]:disabled, @@ -722,6 +720,12 @@ input[type=file] { height: 0; } +/* The selected option in multi select */ +option:checked { + background-color: var(--highlight_background); + color: var(--highlight_text_color); +} + /* Webkit Scrollbars */ ::-webkit-scrollbar { diff --git a/res/template/status.html b/res/template/status.html new file mode 100644 index 0000000..a908bda --- /dev/null +++ b/res/template/status.html @@ -0,0 +1,25 @@ +{{ define "status" }} + + + {{template "meta_tags" "Server status"}} + + + + {{template "page_top" .}} +
+ + +
+ {{template "page_bottom" .}} + {{template "analytics"}} + + +{{ end }} diff --git a/svelte/package-lock.json b/svelte/package-lock.json index 70fce46..165d7e0 100644 --- a/svelte/package-lock.json +++ b/svelte/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "behave-js": "^1.5.0", "chart.js": "^4.4.6", + "country-data-list": "^1.4.0", "pure-color": "^1.3.0", "rollup-plugin-includepaths": "^0.2.4", "svelte-preprocess": "^6.0.3", @@ -2302,9 +2303,9 @@ "license": "MIT" }, "node_modules/caniuse-lite": { - "version": "1.0.30001677", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001677.tgz", - "integrity": "sha512-fmfjsOlJUpMWu+mAAtZZZHz7UEwsUxIIvu1TJfO1HqFQvB/B+ii0xr9B5HpbZY/mC4XZ8SvjHJqtAY6pDPQEog==", + "version": "1.0.30001712", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001712.tgz", + "integrity": "sha512-MBqPpGYYdQ7/hfKiet9SCI+nmN5/hp4ZzveOJubl5DTAMa5oggjAuoi0Z4onBpKPFI2ePGnQuQIzF3VxDjDJig==", "devOptional": true, "funding": [ { @@ -2436,6 +2437,12 @@ "url": "https://opencollective.com/core-js" } }, + "node_modules/country-data-list": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/country-data-list/-/country-data-list-1.4.0.tgz", + "integrity": "sha512-3i1Q1onE9MaqYPdtTUzZRZJY7lBXWpud3eWXrw3ckJyvOzXcsFALiy0Z4Giksy5ECpq9ajYijMPxfRZvVP65UA==", + "license": "MIT" + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/svelte/package.json b/svelte/package.json index 17a0a32..a9db488 100644 --- a/svelte/package.json +++ b/svelte/package.json @@ -23,6 +23,7 @@ "dependencies": { "behave-js": "^1.5.0", "chart.js": "^4.4.6", + "country-data-list": "^1.4.0", "pure-color": "^1.3.0", "rollup-plugin-includepaths": "^0.2.4", "svelte-preprocess": "^6.0.3", diff --git a/svelte/src/file_viewer/ReportWindow.svelte b/svelte/src/file_viewer/ReportWindow.svelte index dd61fba..96741c0 100644 --- a/svelte/src/file_viewer/ReportWindow.svelte +++ b/svelte/src/file_viewer/ReportWindow.svelte @@ -159,7 +159,8 @@ const report_description = () => {

If you think this file violates pixeldrain's content policy you can report it for moderation - with this form. Please submit copyright infringement notices through our + with this form. For copyright infringement notices or urgent matters + please use our abuse e-mail address.

diff --git a/svelte/src/file_viewer/viewers/BandwidthUsage.svelte b/svelte/src/file_viewer/viewers/BandwidthUsage.svelte index 9726abd..4b874fd 100644 --- a/svelte/src/file_viewer/viewers/BandwidthUsage.svelte +++ b/svelte/src/file_viewer/viewers/BandwidthUsage.svelte @@ -32,7 +32,7 @@ $: transfer_left = $stats.limits.transfer_limit - $stats.limits.transfer_limit_u

- + bolt Upgrade your account to disable the transfer limit diff --git a/svelte/src/file_viewer/viewers/RateLimit.svelte b/svelte/src/file_viewer/viewers/RateLimit.svelte index e8ec1d9..cf907b0 100644 --- a/svelte/src/file_viewer/viewers/RateLimit.svelte +++ b/svelte/src/file_viewer/viewers/RateLimit.svelte @@ -71,7 +71,7 @@ let file = { - + bolt Upgrade your account diff --git a/svelte/src/layout/SlowDown.svelte b/svelte/src/layout/SlowDown.svelte index 0706afe..1006811 100644 --- a/svelte/src/layout/SlowDown.svelte +++ b/svelte/src/layout/SlowDown.svelte @@ -37,8 +37,8 @@ export let icon_href = "" least {formatDuration((file_size/($stats.limits.speed_limit))*1000, 0)}

  • - - bolt Upgrade your account + + bolt Get Premium and earn my eternal gratitude {#if !window.user_authenticated} diff --git a/svelte/src/lib/PixeldrainAPI.ts b/svelte/src/lib/PixeldrainAPI.ts index 79fadb8..6fedb62 100644 --- a/svelte/src/lib/PixeldrainAPI.ts +++ b/svelte/src/lib/PixeldrainAPI.ts @@ -114,3 +114,14 @@ export const put_user = async (data: Object) => { ((window as any).user as User)[key] = data[key] } } + + +export type VATRate = { + name: string, + vat: number, + alpha2: string, + alpha3: string, +} +export const get_misc_vat_rate = async (country_code: string) => { + return await check_response(await fetch(get_endpoint() + "/misc/vat_rate/" + country_code)) as VATRate +} diff --git a/svelte/src/user_home/MollieDeposit.svelte b/svelte/src/user_home/MollieDeposit.svelte index f9adebe..8190822 100644 --- a/svelte/src/user_home/MollieDeposit.svelte +++ b/svelte/src/user_home/MollieDeposit.svelte @@ -1,62 +1,74 @@ -
    @@ -97,62 +122,43 @@ const checkout = async () => {
    Please pick your country of residence
    -
    - {#each countries as c} - - {/each} +
    + + + +
    +
    We support the following payment processors
    -
    - PayPal - PayPal -
    -
    - iDEAL - iDEAL -
    -
    - Klarna - Klarna -
    -
    - Bancontact - Bancontact -
    -
    - SEPA - SEPA -
    -
    - SOFORT - SOFORT -
    -
    - KBC/CBC - KBC/CBC -
    -
    - Belfius - Belfius -
    -
    - Giropay - Giropay -
    -
    - EPS - EPS -
    -
    - Przelewy24 - Przelewy24 -
    + {#each payment_providers as p (p.name)} +
    + {p.name} + {p.name} +
    + {/each}
    {:else} @@ -165,8 +171,8 @@ const checkout = async () => {
    Paying from - {country.flag} - {country.name} ({country.vat}% VAT) + {country.emoji} + {country.name} ({vat}% VAT)
    @@ -189,25 +195,40 @@ const checkout = async () => {
    Total including VAT: - +
    +
    +

    + This Pixeldrain premium plan costs €1 per month, but due to + processing fees we can't accept payments less than €10. So your + deposit will give roughly 10 months of premium service depending on + usage. You can track your spending on the transactions page. +

    {/if}