Skip to content

Commit

Permalink
switch KYC thresholds to Money type
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Oct 29, 2017
1 parent f506134 commit cc87c16
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 15 deletions.
8 changes: 4 additions & 4 deletions liberapay/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@ def with_vat(self):
KYC_DOC_MAX_SIZE_MB = int(KYC_DOC_MAX_SIZE / 1000000)
KYC_DOCS_EXTS = ['pdf', 'jpeg', 'jpg', 'gif', 'png']
KYC_DOCS_EXTS_STR = ', '.join(KYC_DOCS_EXTS)
KYC_INCOME_THRESHOLDS = (
KYC_INCOME_THRESHOLDS = [(i, Money(a, 'EUR')) for i, a in (
(1, 18000),
(2, 30000),
(3, 50000),
(4, 80000),
(5, 120000),
(6, 120000),
)
KYC_PAYIN_YEARLY_THRESHOLD = Decimal('2500')
KYC_PAYOUT_YEARLY_THRESHOLD = Decimal('1000')
)]
KYC_PAYIN_YEARLY_THRESHOLD = Money('2500', 'EUR')
KYC_PAYOUT_YEARLY_THRESHOLD = Money('1000', 'EUR')

LAUNCH_TIME = datetime(2016, 2, 3, 12, 50, 0, 0, utc)

Expand Down
1 change: 0 additions & 1 deletion templates/identity-form-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
% set saved = account.IncomeRange
% set prev_threshold = None
% for i, threshold in constants.KYC_INCOME_THRESHOLDS
% set threshold = Money(threshold, 'EUR')
<option value="{{ i }}" {{ 'selected' if i == saved else '' }}>{{
_("Less than {0}", threshold) if loop.first else
_("More than {0}", threshold) if loop.last else
Expand Down
4 changes: 2 additions & 2 deletions www/%username/identity.spt
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ else:
"If you give more than {0} in a year, or receive more than {1} in a year, "
"or if your account shows signs of suspicious activity, then you will have "
"to provide additional information:"
, Money(constants.KYC_PAYIN_YEARLY_THRESHOLD, 'EUR')
, Money(constants.KYC_PAYOUT_YEARLY_THRESHOLD, 'EUR')
, constants.KYC_PAYIN_YEARLY_THRESHOLD
, constants.KYC_PAYOUT_YEARLY_THRESHOLD
) }}</p>

<input type="hidden" name="csrf_token" value="{{ csrf_token }}" />
Expand Down
4 changes: 2 additions & 2 deletions www/%username/wallet/payin/bankwire/%back_to.spt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ from mangopay.resources import BankWirePayIn

from liberapay.billing.fees import upcharge_bank_wire
from liberapay.billing.transactions import payin_bank_wire
from liberapay.constants import EVENTS, KYC_PAYIN_YEARLY_THRESHOLD, PAYIN_BANK_WIRE_MIN
from liberapay.constants import EVENTS, PAYIN_BANK_WIRE_MIN
from liberapay.exceptions import InvalidNumber
from liberapay.utils import b64decode_s, get_participant
from liberapay.utils.i18n import Money
Expand Down Expand Up @@ -60,7 +60,7 @@ if weekly > 0:
min_weeks = (constants.PAYIN_BANK_WIRE_MIN[currency].amount / weekly).to_integral_value(ROUND_UP)
max_weeks = min(
max(constants.PAYIN_BANK_WIRE_TARGET[currency].amount // weekly, 52),
constants.KYC_PAYIN_YEARLY_THRESHOLD // weekly
constants.PAYIN_BANK_WIRE_MAX[currency].amount // weekly
)
weeks_list = sorted(set((min_weeks, 4, 13, 26, 39, max_weeks)))
weeks_list = [w for w in weeks_list if w >= min_weeks and w <= max_weeks] or [min_weeks]
Expand Down
2 changes: 1 addition & 1 deletion www/%username/wallet/payin/card/%back_to.spt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ from liberapay.billing.fees import skim_amount, upcharge_card
from liberapay.billing.transactions import (
charge, record_exchange_result, repr_error,
)
from liberapay.constants import FEE_PAYIN_CARD, PAYIN_CARD_MIN, KYC_PAYIN_YEARLY_THRESHOLD
from liberapay.constants import FEE_PAYIN_CARD, PAYIN_CARD_MIN
from liberapay.exceptions import InvalidNumber, Redirect
from liberapay.models.exchange_route import ExchangeRoute
from liberapay.utils import b64decode_s, get_participant, is_card_expired
Expand Down
4 changes: 1 addition & 3 deletions www/%username/wallet/payin/direct-debit/%exchange_id.spt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ from liberapay.billing.transactions import (
prepare_direct_debit, execute_direct_debit, record_exchange_result,
repr_error, repr_exception,
)
from liberapay.constants import (
FEE_PAYIN_DIRECT_DEBIT, PAYIN_DIRECT_DEBIT_MIN, KYC_PAYIN_YEARLY_THRESHOLD
)
from liberapay.constants import FEE_PAYIN_DIRECT_DEBIT, PAYIN_DIRECT_DEBIT_MIN
from liberapay.exceptions import InvalidNumber
from liberapay.models.exchange_route import ExchangeRoute
from liberapay.utils import (
Expand Down
4 changes: 2 additions & 2 deletions www/about/faq.spt
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ title = _("Frequently Asked Questions")
"There are no restrictions on the total amount you can give or receive, "
"but for legal reasons you will need to provide identity documents if "
"you give more than {0}, or receive more than {1}, per year."
, Money(constants.KYC_PAYIN_YEARLY_THRESHOLD, 'EUR')
, Money(constants.KYC_PAYOUT_YEARLY_THRESHOLD, 'EUR')
, constants.KYC_PAYIN_YEARLY_THRESHOLD
, constants.KYC_PAYOUT_YEARLY_THRESHOLD
) }}<br>
{{ _(
"The minimum you can give any user is {0}. To minimize processing fees, "
Expand Down

0 comments on commit cc87c16

Please sign in to comment.