- When paying with cryptocurrencies it is important that you pay the
- exact amount stated on the order. If you pay too little, the
- order fails. If you pay too much then the remaining credit will not
- be added to your account. Pay close attention when sending a payment
- from an online exchange, sometimes they will subtract the fees from
- the amount sent which will cause the payment to fail.
-
- {/if}
-
-
-
-
- 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.
-
+ When paying with cryptocurrencies it is important that you pay
+ the exact amount stated on the order. If you pay too
+ little, the order fails. If you pay too much then the remaining
+ credit will not be added to your account. Pay close attention
+ when sending a payment from an online exchange, sometimes they
+ will subtract the fees from the amount sent which will cause the
+ payment to fail.
+
+{/if}
+
+
+
+
+ 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.
+
+ 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.
+
+
+
diff --git a/svelte/src/layout/checkout/PickProvider.svelte b/svelte/src/layout/checkout/PickProvider.svelte
new file mode 100644
index 0000000..9319be3
--- /dev/null
+++ b/svelte/src/layout/checkout/PickProvider.svelte
@@ -0,0 +1,44 @@
+
+
+Please select a payment provider
+
+
+ {#each payment_providers as p (p.name)}
+ {#if p.country_filter === undefined || p.country_filter.includes(state.country.alpha2)}
+
+ {/if}
+ {/each}
+
+
+
diff --git a/svelte/src/lib/PixeldrainAPI.ts b/svelte/src/lib/PixeldrainAPI.ts
index 6fedb62..5b5bb22 100644
--- a/svelte/src/lib/PixeldrainAPI.ts
+++ b/svelte/src/lib/PixeldrainAPI.ts
@@ -24,6 +24,9 @@ export type User = {
file_embed_domains: string,
skip_file_viewer: boolean,
affiliate_user_name: string,
+ checkout_country: string,
+ checkout_name: string,
+ checkout_provider: string,
}
export type Subscription = {
diff --git a/svelte/src/user_home/AccountSettings.svelte b/svelte/src/user_home/AccountSettings.svelte
index 5281152..fc2de01 100644
--- a/svelte/src/user_home/AccountSettings.svelte
+++ b/svelte/src/user_home/AccountSettings.svelte
@@ -4,6 +4,7 @@ import CopyButton from "layout/CopyButton.svelte";
import Form from "util/Form.svelte";
import Button from "layout/Button.svelte";
import OtpSetup from "./OTPSetup.svelte";
+ import { put_user } from "lib/PixeldrainAPI";
let affiliate_link = window.location.protocol+"//"+window.location.host + "?ref=" + encodeURIComponent(window.user.username)
let affiliate_deny = false
@@ -52,6 +53,22 @@ let account_settings = {
log in. If you forget your username you can still log in using
your e-mail address if you have one configured`,
separator: true,
+ }, {
+ name: "checkout_country",
+ label: "Country code used at checkout",
+ type: "text",
+ default_value: window.user.checkout_country,
+ }, {
+ name: "checkout_provider",
+ label: "Default payment provider used at checkout",
+ type: "text",
+ default_value: window.user.checkout_provider,
+ }, {
+ name: "checkout_name",
+ label: "Full name used at checkout",
+ type: "text",
+ default_value: window.user.checkout_name,
+ separator: true,
},
],
submit_label: `save Save`,
@@ -67,11 +84,23 @@ let account_settings = {
form.append("email", fields.email)
form.append("password_new", fields.password_new1)
form.append("username", fields.username)
+ form.append("checkout_country", fields.checkout_country)
+ form.append("checkout_provider", fields.checkout_provider)
+ form.append("checkout_name", fields.checkout_name)
- const resp = await fetch(window.api_endpoint+"/user", { method: "PUT", body: form });
- if(resp.status >= 400) {
- return {error_json: await resp.json()}
+ try {
+ await put_user({
+ email: fields.email,
+ password_new: fields.password_new1,
+ username: fields.username,
+ checkout_country: fields.checkout_country,
+ checkout_provider: fields.checkout_provider,
+ checkout_name: fields.checkout_name,
+ })
+ } catch (err) {
+ return {error_json: err}
}
+
return {success: true, message: "Success! Your changes have been saved"}
},
}
diff --git a/svelte/src/user_home/DepositCredit.svelte b/svelte/src/user_home/DepositCredit.svelte
index f96321f..d02388b 100644
--- a/svelte/src/user_home/DepositCredit.svelte
+++ b/svelte/src/user_home/DepositCredit.svelte
@@ -1,5 +1,5 @@