blender-dev-fund.git
27 hours agoUpdate looper master production
Anna Sirota [Wed, 27 Oct 2021 08:49:05 +0000 (10:49 +0200)]
Update looper

594c50d New report: subscriptions cancellations by date
f40799c New admin action for subscriptions: force renewal
2426252 T91068 Automatically cancel subscriptions that are on-hold for too long
        Disabled by default, enabled by setting settings.LOOPER_SUBSCRIPTION_EXPIRE_AFTER
aa6c137 Upgrade Braintree SDK to 4.12.0

3 weeks agoUpgrade jsmin to 3.0.0
Anna Sirota [Wed, 6 Oct 2021 14:08:37 +0000 (16:08 +0200)]
Upgrade jsmin to 3.0.0

Version 2.2.2 is not longer compatible with setuptools
due to use of 2to3. Version 3.0.0 removes support of Python 2.
See https://github.com/tikitu/jsmin/issues/33 for more details.

8 weeks agoTry to work around FileNotFoundError 'python' by pinning poetry version
Anna Sirota [Wed, 1 Sep 2021 15:34:34 +0000 (17:34 +0200)]
Try to work around FileNotFoundError 'python' by pinning poetry version

8 weeks agoUpdate looper
Anna Sirota [Wed, 1 Sep 2021 15:13:16 +0000 (17:13 +0200)]
Update looper

853f115 Bring back filtering by plan in subscription admin
07dc818 Report fix: use report totals when computing the tax totals instead of summing up order tax amounts
3ca2475 PEP8 fix
9b54e5f Log an error when order is paid but subscription is in a wrong status
8cc07bf T91067 Set order status to "refunded" when it is fully refunded
b11a711 Add missing report migration (empty migration for a new proxy model)

8 weeks agoUpdate looper to 1.8.2
Anna Sirota [Tue, 31 Aug 2021 14:31:23 +0000 (16:31 +0200)]
Update looper to 1.8.2

0ddb002 T91072 Shorten payment method str representation
d7f9b3c T91072 Shorten subscription link title in admin order list to ID
edc598e T91070 Show 50 subscriptions/orders per admin list page
92ce325 T91071 Add full name to searchable fields in admin, provide a way to extend user search fields
a4e3fec T91074 Make money more readable: use thousands separator
e65f145 T91076 Default to current quarter in the VAT numbers report
b1d8a2e T91073 Report: revenue per country T91073
34a831f Fix a typo in RecordModificationMixin
8062b28 T89661 Re-validate existing VAT numbers periodically
1937a36 More readable Taxable.__str__
d98d3bb Add factory-boy to simplify creation of subscriptions in tests
a85add9 Set clock test date to after Jan 2015, that is when VAT rules changed completely
07eca18 Fix a typo in version value
a09b00b Hide an unused date field in subscription admin
b801dcd Replace subscription plan filter with collection_method filter in admin
9693d32 Add pending_cancellation_since field to subscriptions
9c03f6b Work around multiple gateway customer IDs
5de7ff4 Log all tax-related changes of subscription fields
4e3d248 Log all changes of subscription status
4fa7a12 Minor change to a docstring
298fd78 Include both orders with VAT change type and orders that have non-zero tax amounts into VAT report
404e4be Display country code in the list of tax rules
69edb54 Add default False to Transaction.paid column
c46dac3 Closes T90485 Managing tax rates via the admin
40e119b Fix an internal error when acessing admin history of a non-existing object
e7c9f0a PEP8 fix
95d03bd Fix T90409 Ireland's VAT rate is no longer correct
f68bfa5 Bump version
bd8d6ae Remove "Add transaction" buttons, since transactions cannot really be added via admin
f8b0ed4 Minor change to a docstring
1a5a888 Allow blank order names
9c3fad9 Sort transactions latest first in admin order overview
6e959ea Fix T90408 Correct VAT calculations
198dc25 Fix tax percentage sometimes formatted in scientific notation

2 months agoUpdate looper: T86735 fixed
Anna Sirota [Tue, 3 Aug 2021 10:11:59 +0000 (12:11 +0200)]
Update looper: T86735 fixed

2 months agoUpdate looper (1.5.7 -> 1.6.2rc1 61e34be)
Anna Sirota [Tue, 3 Aug 2021 09:41:45 +0000 (11:41 +0200)]
Update looper (1.5.7 -> 1.6.2rc1 61e34be)

61e34be Fix test broken because the patched clock ignores subscriptions with nameless payment methods
d2df2b2 Allow filtering subscriptions by tax type in admin
22d159c Move Subscription.next_payment filter to the rest of the dates in admin
01a8d51 Limit subscriptions count report to this year by default
9a5ac0b Work around multiple gateway customer IDs stored: pick one and log an exception
5a3f897 Show subscriptions, order, transaction admin history ordered latest first
ab64710 Allow filtering for legacy transactions too
c93dcab Order orders, subscriptions and transactions by created desc in admin
315c55e Allow filtering for legacy orders and subscriptions
994af8f Add refunded status to Order and Transaction
299f8d8 Hide Transaction.updated_at in the list of order transactions
191f91b Rename admin models module to avoid confusing it with "real" Django models
12d8b0c Display gateway's transaction ID in the admin when available
2261dc5 Closes T89754 Store error code when transactions fails
4485930 Allow filtering subscriptions by next_payment date
a3b391e Display order numbers in list view
6abc7f8 Use only one field for list_display_links, more is visually confusing
61471b2 Fix subscription type label in the reports
0fa7e86 Change PayPal method_type from "pp" to "pa" to match values already stored in the DBs
7af6a46 Filter subscriptions count report by manual/automatic
a3670cc Method for sorting plan variations by their renewal intervals (in days, regardless of interval_unit)
7ab1ab4 Closes T89706 Add "new subscriptions per date" report
9755ab9 Filter subscriptions and orders by currency
9cb68ca Closes T89689 send name and email when creating customers at BT gateway
87507e1 Allow overriding pay-existing-order URL
27b6169 Allow searching payment methods by their recognisable names
0e2281f Allow deleting gateway customer IDs from admin
483ab52 Add order number to search fields in order/subscription/transaction admin

3 months agoUpdate looper (make difference between plans more visible in revenue report)
Anna Sirota [Mon, 5 Jul 2021 09:01:10 +0000 (11:01 +0200)]
Update looper (make difference between plans more visible in revenue report)

3 months agoUpdate looper
Anna Sirota [Mon, 5 Jul 2021 07:51:07 +0000 (09:51 +0200)]
Update looper

    eb42c3bd8 Only show "Other" in revenue report if orders that don't match any plans exist
    1dea87c31 Use colorhash to color report lines
    5d0675c9e Add revenue per plan variation report; rename sales to revenue in all reports

3 months agoUpdate looper: add reports and CSV export
Anna Sirota [Thu, 1 Jul 2021 14:36:57 +0000 (16:36 +0200)]
Update looper: add reports and CSV export

    298fd7d90 Fix TypeError: sum() takes no keyword arguments (Python 3.6 compat)
    a2ba4025a Prepend site title to the name of exported CSV files
    3580d56c6 Bump version to Blender Studio's poetry update looper
    994b3cd1e Fix missing templates issue (symlinks dont work wheels)
    08fb756d1 Closes T88988 Add reports to the admin
    defac5088 Add export to CSV buttons to orders, subscriptions and transactions
    045a85193 Allow admins to delete payment methods
    fd1e08134 Rearrange admin modules

3 months agoUpgrade looper to v1.5.0
Anna Sirota [Tue, 29 Jun 2021 12:47:52 +0000 (14:47 +0200)]
Upgrade looper to v1.5.0

    9f237a78284e Use Order.number whenever possible
    abe6dddff99b T89411: Order refund amounts must be stored, not calculated properties
    4a399c5d301e Clean up transactions tests
    4874ffa17283 Clean up subscriptions tests
    8f37cf2d4363 Add legacy flags and order number columns to support migration from Blender…
    63a6e8eee352 Pass request to in preferred currency middleware
    1f71e1fd125b Shortcut for fetching similar plan variations in different currencies

4 months agoFix T88995: display buttons at the top of subscription admin
Anna Sirota [Mon, 21 Jun 2021 10:05:52 +0000 (12:05 +0200)]
Fix T88995: display buttons at the top of subscription admin

4 months agoUpgrade to Django v3.0.14
Anna Sirota [Wed, 2 Jun 2021 10:52:29 +0000 (12:52 +0200)]
Upgrade to Django v3.0.14

4 months agoUpdate looper to v1.4.6
Anna Sirota [Wed, 2 Jun 2021 10:45:22 +0000 (12:45 +0200)]
Update looper to v1.4.6

    932d475d7 Fix "deactivated" signal never triggered by subscription status changes
    2f77dae7d Drop trailing zeroes from the formatted tax percentage
    2ebcda797 Fix order being duplicated on order.update

4 months agoChange wording of the deactivation email
Anna Sirota [Wed, 2 Jun 2021 10:42:10 +0000 (12:42 +0200)]
Change wording of the deactivation email

It mentions reactivating a membership but there
seem to be no way to do that from the link it points to.

5 months agoKeep seconds in datetime format
Anna Sirota [Thu, 27 May 2021 09:54:41 +0000 (11:54 +0200)]
Keep seconds in datetime format

5 months agoChange datetime format: it's too long when shown in the admin list views
Anna Sirota [Thu, 27 May 2021 09:51:40 +0000 (11:51 +0200)]
Change datetime format: it's too long when shown in the admin list views

5 months agoUpdate looper to v 1.4.4
Anna Sirota [Thu, 27 May 2021 09:07:45 +0000 (11:07 +0200)]
Update looper to v 1.4.4

* Allow filtering by tax_type in order admin
* Move tax fields to the end of the row in order admin
* Use GeoIP country as a fallback in tax calculations
* Minor change to tax line formatting
* Set receipt PDF URL in the settings, projects can have it under a different alias

5 months agoSet receipt PDF URL in the settings, projects can have it under a different alias
Anna Sirota [Tue, 25 May 2021 14:36:57 +0000 (16:36 +0200)]
Set receipt PDF URL in the settings, projects can have it under a different alias

5 months agoUpgrade looper to 1.4.0 version with VAT support
Anna Sirota [Tue, 25 May 2021 11:50:42 +0000 (13:50 +0200)]
Upgrade looper to 1.4.0 version with VAT support

5 months agoLink to the annual report in the payment notification mail
Anna Sirota [Mon, 10 May 2021 12:41:42 +0000 (14:41 +0200)]
Link to the annual report in the payment notification mail

5 months agoUpdate looper
Anna Sirota [Thu, 6 May 2021 15:21:40 +0000 (17:21 +0200)]
Update looper

Looper's changelog:
    f998aeb8d7f8 Erase Braintree client token when charge fails
    108324745fb4 Erase Braintree client token when adding a payment method fails
    97bfe1ae5fdb Catch and report "nonce not found" Braintree error
    e082451a1711 Order plan variations by default for currency first
    8a086d5fb9ad Change the gateway widget by wrapping labels into stylable elements
    3fefdfff5fdb Bump the version
    1544323f7a5f Show the original error message returned by the gateway, if possible

5 months agoMembership counts should be filtered by active
Anna Sirota [Thu, 6 May 2021 14:58:27 +0000 (16:58 +0200)]
Membership counts should be filtered by active

6 months agoUpgrade looper to the version with recurring transactions
Anna Sirota [Mon, 19 Apr 2021 09:39:06 +0000 (11:39 +0200)]
Upgrade looper to the version with recurring transactions

Mark Braintree transactions as `recurring` in accordance with their docs.
This patch adds appropriate transaction_source parameter to the Braintree's .sale() call, in accordance with their guide for exemptions from Strong Customer Authentication for recurring transactions.
It corrects a bunch of invalid assumptions in the code due to which 3D Secure authentication was not included into transactions even though it was acquired in the checkout.
See {D10501} for more details.

7 months agoMove customer IP validation to the views
Anna Sirota [Fri, 26 Mar 2021 10:40:21 +0000 (11:40 +0100)]
Move customer IP validation to the views

Updates looper version to make use of the new way of validating
customer IP addresses in the checkout views.
See also: https://developer.blender.org/D10820

7 months agoRemove the suggested solution to "Authentication Required" from the email templates
Anna Sirota [Thu, 25 Mar 2021 16:00:37 +0000 (17:00 +0100)]
Remove the suggested solution to "Authentication Required" from the email templates

7 months agoUse include to take care of looper's scripts
Anna Sirota [Wed, 24 Mar 2021 16:06:36 +0000 (17:06 +0100)]
Use include to take care of looper's scripts

Looper now has a template snippet that takes care
of all looper JS that used to be copy-pasted into multiple templates.

7 months agoFix navigation overlap with stat counter
Mike Newbon [Wed, 24 Mar 2021 15:49:30 +0000 (16:49 +0100)]
Fix navigation overlap with stat counter

7 months agoRevert "Remove thermometer code"
Anna Sirota [Tue, 23 Mar 2021 13:20:48 +0000 (14:20 +0100)]
Revert "Remove thermometer code"

This reverts commit ae0832d24823f44d840c0bb8b8b2e9fa079fc9db.

7 months agoAdd 'one-time donations' links
Mike Newbon [Mon, 22 Mar 2021 16:54:42 +0000 (17:54 +0100)]
Add 'one-time donations' links

7 months agoRemove thermometer code
Mike Newbon [Mon, 22 Mar 2021 16:26:03 +0000 (17:26 +0100)]
Remove thermometer code

7 months agoUse latest looper, closes T85646
Anna Sirota [Thu, 18 Mar 2021 15:12:39 +0000 (16:12 +0100)]
Use latest looper, closes T85646

Previously used branch of looper has been merged into master.

7 months agoUse standalone looper
Anna Sirota [Tue, 16 Mar 2021 16:00:54 +0000 (17:00 +0100)]
Use standalone looper

Replaces local looper module with one installed from looper's repository.
A few Python dependencies had to be bumped, and git installed in the base image.

7 months agoHide "Replace" payment method link
Anna Sirota [Tue, 16 Mar 2021 15:11:40 +0000 (16:11 +0100)]
Hide "Replace" payment method link

Hides the Replace link previously shown on payment methods.
Replace payment method doesn't work with SCA, because SCA requires
a fixed amount for the payment method verification,
while replace payment method view has not knowledge of a fixed amount
because it tries to act on all subscriptions that use the same payment method.

7 months agoMake change payment method link more prominent
Anna Sirota [Tue, 16 Mar 2021 13:32:48 +0000 (14:32 +0100)]
Make change payment method link more prominent

7 months agoAdd verbose name to looper's VAT number
Anna Sirota [Mon, 15 Mar 2021 17:11:35 +0000 (18:11 +0100)]
Add verbose name to looper's VAT number

7 months agoAdd a shortcut for active Subscriptions query
Anna Sirota [Mon, 15 Mar 2021 17:10:58 +0000 (18:10 +0100)]
Add a shortcut for active Subscriptions query

7 months agoReplace non-swappable auth.User in looper modules
Anna Sirota [Mon, 15 Mar 2021 17:10:20 +0000 (18:10 +0100)]
Replace non-swappable auth.User in looper modules

Replaces direct imports and usage of auth.User with get_user_model,
to make looper compatible with projects that swap their User model.

7 months agoFix some of the 200-something mypy errors in looper
Anna Sirota [Mon, 15 Mar 2021 16:26:16 +0000 (17:26 +0100)]
Fix some of the 200-something mypy errors in looper

This is an attempt at salvaging mypy annotations
that already exist in the standalone looper's code.

7 months agoFix currency selector
Anna Sirota [Fri, 12 Mar 2021 16:37:21 +0000 (17:37 +0100)]
Fix currency selector

Currency selector Javascript was only included
into the 'looper' bundle, and was missing from the landing
page and checkout.

7 months agoRemove unused f-strings in looper
Anna Sirota [Wed, 10 Mar 2021 15:07:14 +0000 (16:07 +0100)]
Remove unused f-strings in looper

7 months agoMinor change to looper admin log utils
Anna Sirota [Wed, 10 Mar 2021 15:06:32 +0000 (16:06 +0100)]
Minor change to looper admin log utils

7 months agoFix some typos in looper
Anna Sirota [Wed, 10 Mar 2021 15:05:52 +0000 (16:05 +0100)]
Fix some typos in looper

7 months agoReplace relative a import in looper module
Anna Sirota [Wed, 10 Mar 2021 11:27:04 +0000 (12:27 +0100)]
Replace relative a import in looper module

7 months agoBetter naming in Subscription admin's "interval" field
Anna Sirota [Wed, 10 Mar 2021 11:21:44 +0000 (12:21 +0100)]
Better naming in Subscription admin's "interval" field

7 months agoRemove an outdated TODO
Anna Sirota [Wed, 10 Mar 2021 11:18:36 +0000 (12:18 +0100)]
Remove an outdated TODO

PDF views are part of looper now

7 months agoReplace relative a import in looper module
Anna Sirota [Wed, 10 Mar 2021 11:18:24 +0000 (12:18 +0100)]
Replace relative a import in looper module

7 months agoExtra checks for looper config with GatewayConfigurationError
Anna Sirota [Tue, 9 Mar 2021 15:27:40 +0000 (16:27 +0100)]
Extra checks for looper config with GatewayConfigurationError

7 months agoReplace relative imports in looper modules
Anna Sirota [Tue, 9 Mar 2021 15:19:52 +0000 (16:19 +0100)]
Replace relative imports in looper modules

7 months agoAutoformat looper module with black again
Anna Sirota [Tue, 9 Mar 2021 14:14:53 +0000 (15:14 +0100)]
Autoformat looper module with black again

7 months ago[PEP8] Fix a star-import
Anna Sirota [Tue, 9 Mar 2021 14:12:24 +0000 (15:12 +0100)]
[PEP8] Fix a star-import

7 months agoMove a looper test into a relevant test module
Anna Sirota [Tue, 9 Mar 2021 14:02:35 +0000 (15:02 +0100)]
Move a looper test into a relevant test module

7 months agoClean up implicit string concatenations introduced by black
Anna Sirota [Tue, 9 Mar 2021 13:51:37 +0000 (14:51 +0100)]
Clean up implicit string concatenations introduced by black

7 months agoMove settings and receipts into looper
Anna Sirota [Tue, 9 Mar 2021 11:46:46 +0000 (12:46 +0100)]
Move settings and receipts into looper

Moves reusable settings and receipt templates and views into looper.
Part of the effort to decouple looper from the Development Fund.

7 months agoRemove Membership link field from looper admin
Anna Sirota [Tue, 9 Mar 2021 11:13:21 +0000 (12:13 +0100)]
Remove Membership link field from looper admin

Moves a custom Subscription admin field linking to
the membership from looper admin to devfund admin,
without changing it.

7 months agoRefactor looper's Javascript
Anna Sirota [Fri, 5 Mar 2021 15:35:49 +0000 (16:35 +0100)]
Refactor looper's Javascript

The goal is to have a single JS module for looper payment forms
that "just works", with or without reCaptcha, and has no dependency on jQuery.

7 months agoDisable bank transfer in "Extend your Membership"
Anna Sirota [Tue, 2 Mar 2021 14:06:52 +0000 (15:06 +0100)]
Disable bank transfer in "Extend your Membership"

Removes gateways that don't support transactions
from the form on "Extend your Membership page".

8 months agoFix "Extend my membership" form
Anna Sirota [Fri, 26 Feb 2021 13:48:49 +0000 (14:48 +0100)]
Fix "Extend my membership" form

Adds missing address and price form fields, as well
as the rest of the missing Braintree boilerplate to
"Extend my membership" form, which was broken since {D10330}.

8 months agoAdd a note about SCA to the emails about failed payments
Anna Sirota [Wed, 24 Feb 2021 15:04:43 +0000 (16:04 +0100)]
Add a note about SCA to the emails about failed payments

8 months agoRemove accidental "]" from plaintext email templates
Anna Sirota [Wed, 24 Feb 2021 14:58:47 +0000 (15:58 +0100)]
Remove accidental "]" from plaintext email templates

8 months agoFix T83665: Add no follow to sponsor credit links
Mike Newbon [Wed, 24 Feb 2021 12:41:17 +0000 (13:41 +0100)]
Fix T83665: Add no follow to sponsor credit links

8 months agoMove email HTML templates into the dir with the rest of email templates
Anna Sirota [Wed, 24 Feb 2021 09:28:31 +0000 (10:28 +0100)]
Move email HTML templates into the dir with the rest of email templates

8 months agoMore filters for order and transaction admin
Anna Sirota [Mon, 22 Feb 2021 18:00:25 +0000 (19:00 +0100)]
More filters for order and transaction admin

Allow filtering by transaction failure message

8 months agoMore filters for order admin
Anna Sirota [Mon, 22 Feb 2021 13:40:47 +0000 (14:40 +0100)]
More filters for order admin

Allow filtering by payment method type, deletion flag and collection
attempts.

8 months agoMore filters for transactions admin
Anna Sirota [Mon, 22 Feb 2021 13:28:41 +0000 (14:28 +0100)]
More filters for transactions admin

Allow filtering transactions by payment method type and gateway.

8 months agoMove signals that aren't specific to looper out of D10437
Anna Sirota [Thu, 18 Feb 2021 11:01:46 +0000 (12:01 +0100)]
Move signals that aren't specific to looper out of  D10437

8 months agoMove looper's javascript files D10440
Anna Sirota [Thu, 18 Feb 2021 11:00:44 +0000 (12:00 +0100)]
Move looper's javascript files D10440

8 months agoFix T85731: checkout form is broken in Safari
Anna Sirota [Thu, 18 Feb 2021 10:59:31 +0000 (11:59 +0100)]
Fix T85731: checkout form is broken in Safari

8 months agoAdd .arcconfig so the project can use Arcanist
Sybren A. Stüvel [Thu, 18 Feb 2021 10:48:41 +0000 (11:48 +0100)]
Add .arcconfig so the project can use Arcanist

8 months agoMove requires_status to looper.decorators and type-annotate it D10435
Anna Sirota [Tue, 16 Feb 2021 14:48:34 +0000 (15:48 +0100)]
Move requires_status to looper.decorators and type-annotate it D10435

8 months agoAdd as_text() to Address, lands D10434
Anna Sirota [Tue, 16 Feb 2021 14:23:38 +0000 (15:23 +0100)]
Add as_text() to Address, lands D10434

8 months agoFix existing mypy annotations broken black
Anna Sirota [Tue, 16 Feb 2021 13:28:24 +0000 (14:28 +0100)]
Fix existing mypy annotations broken black

8 months ago"import typing" -> "from typing import ..."
Anna Sirota [Tue, 16 Feb 2021 13:28:04 +0000 (14:28 +0100)]
"import typing" -> "from typing import ..."

8 months agoUpgrade black, mypy and flake, apply black again
Anna Sirota [Tue, 16 Feb 2021 13:00:10 +0000 (14:00 +0100)]
Upgrade black, mypy and flake, apply black again

8 months agoApply black to the rest of looper
Anna Sirota [Tue, 16 Feb 2021 12:45:10 +0000 (13:45 +0100)]
Apply black to the rest of looper

8 months agoApply black to looper/migrations
Anna Sirota [Tue, 16 Feb 2021 12:39:22 +0000 (13:39 +0100)]
Apply black to looper/migrations

8 months agoRemove gulp and pug D10407
Anna Sirota [Mon, 15 Feb 2021 11:42:44 +0000 (12:42 +0100)]
Remove gulp and pug D10407

 * Removes pug templates, replacing them with HTML;
 * Sets up `pypugjs` for the remaining external pug templates coming from BWA;
 * Removes all of the `gulp` boilerplate, replacing it with `libsasscompiler` and `django-pipeline`;
 * Moves around static files to make it easier to setup `django-pipeline`.

8 months agoWork around the Cryptography package requiring Rust
Anna Sirota [Thu, 11 Feb 2021 17:18:48 +0000 (18:18 +0100)]
Work around the Cryptography package requiring Rust

Since version 3.4 the Python `cryptography` package requires Rust to be
installed. For now we stick to the last version of the package that didn't
require Rust.

See https://github.com/pyca/cryptography/issues/5771 for more info. There
it's also described that recent versions of Pip bundle a precompiled
wheel for cryptography, hence the upgrade of Pip in the docker base image.

8 months agoEnable 3DSecure in Braintree's DropIn UI
Anna Sirota [Mon, 8 Feb 2021 14:30:06 +0000 (15:30 +0100)]
Enable 3DSecure in Braintree's DropIn UI

Using the [recommended DropIn UI implementation](https://developers.braintreepayments.com/guides/3d-secure/migration/javascript/v3#drop-in-ui), makes sure that a 3D Secure challenge is presented to the customer when necessary.
If the challenge is successful or the payment method is not eligible for 3D Secure, a payment method nonce is passed over to the back-end as usual.
Otherwise an error is displayed.

The form in the change-payment-method page is now the same as in the checkout, because 3D Secure has to work there as well.

See https://developers.braintreepayments.com/guides/3d-secure/migration/javascript/v3#client-side-sandbox-testing

10 months agoUpgrade BrainTree Python SDK to 3.59
Sybren A. Stüvel [Tue, 22 Dec 2020 14:23:23 +0000 (15:23 +0100)]
Upgrade BrainTree Python SDK to 3.59

This is required for the upcoming mandatory 3DSecure v2 validation.

10 months agoUpgrade BrainTree Dropin 1.13 → 1.25
Sybren A. Stüvel [Tue, 22 Dec 2020 14:05:13 +0000 (15:05 +0100)]
Upgrade BrainTree Dropin 1.13 → 1.25

A version 1.20 or newer is required for 3D Secure v2, which is going to be
mandatory at the end of this year.

10 months agoBrainTree JS: remove unused `dropin_ui_options` parameter
Sybren A. Stüvel [Tue, 22 Dec 2020 13:50:21 +0000 (14:50 +0100)]
BrainTree JS: remove unused `dropin_ui_options` parameter

There is code to pass custom options to the BrainTree drop-in JavaScript
component. This code is never used, but it would get in the way of adding
another option (that is going to be mandatory per 2021-01-01).

No functional changes.

12 months agoFix error when first subscription payment fails
Sybren A. Stüvel [Thu, 1 Oct 2020 09:08:59 +0000 (11:08 +0200)]
Fix error when first subscription payment fails

Avoid `None` when extending a subscription, when there hasn't been any
payment made yet. This happened in the live website, and I think it was
with this flow:
- For some reason, the user creates a subscription but doesn't pay for
  the order. Not sure how this could have happened, but the
  subscription's first order is unpaid.
- User then paid for 10 months (so 10x the normal monthly amount).

This caused an error because `subscription.next_payment` was `None` when
computing the new 'next payment' date. This is what's fixed now; when
the date is `None`, the next payment date is computed as ('now' +
'months paid').

13 months agoUse SHOW_THERMOMETER setting in landing template
Francesco Siddi [Tue, 22 Sep 2020 14:57:27 +0000 (16:57 +0200)]
Use SHOW_THERMOMETER setting in landing template

This allows to hide the entire thermometer when set to False.

13 months agoFix ValueError when remote address contains port number
Sybren A. Stüvel [Tue, 18 Aug 2020 12:18:47 +0000 (14:18 +0200)]
Fix ValueError when remote address contains port number

When `REMOTE_ADDR` or `HTTP_X_FORWARDED_FOR` contains a port number
(like `127.0.0.1:44433` or `[1234::34]:44433`) the preferred currency
check would raise an exception. Removing the port number from such
requests resolves this.

Differential Revision: https://developer.blender.org/D8610

13 months agoCleanup: remove unused `RemoteAddressRecorder` middleware
Sybren A. Stüvel [Tue, 18 Aug 2020 12:12:35 +0000 (14:12 +0200)]
Cleanup: remove unused `RemoteAddressRecorder` middleware

Remove the `RemoteAddressRecorder` middleware, as it's not used
anywhere.

Reviewed By: fsiddi

Differential Revision: https://developer.blender.org/D8609

14 months agoDev Fund: Adjust height of patron member logos
Pablo Vazquez [Fri, 21 Aug 2020 14:17:04 +0000 (16:17 +0200)]
Dev Fund: Adjust height of patron member logos

Thanks @fsiddi for the help.

16 months agoFix missing logging on production server
Sybren A. Stüvel [Mon, 8 Jun 2020 11:11:57 +0000 (13:11 +0200)]
Fix missing logging on production server

The issue was that Python's `TimedRotatingFileHandler` is not thread/process
safe (even though the `logging` module documentation says differently).

Python logging is now sent to stderr, where it is captured by uWSGI and
logged to disk. It is now uWSGI that performs rollover, based on the log
file size. It is up to a cron job to clean up old log files.

16 months agoMake the reCAPTCHA function repeatable
Sybren A. Stüvel [Tue, 2 Jun 2020 16:02:20 +0000 (18:02 +0200)]
Make the reCAPTCHA function repeatable

Apparently `grecaptcha.execute();` won't run twice. This makes sense, as
it's supposed to run on submit, and not on
button-click-that-may-trigger-submit. However, when the form submission
is halted for some reason, the button still needs to call the
`callback_recaptcha_ok()` callback to allow form submission.

16 months agoPerform check for recent subscriptions on checkout form
Sybren A. Stüvel [Fri, 29 May 2020 13:26:23 +0000 (15:26 +0200)]
Perform check for recent subscriptions on checkout form

The checkout form now checks for recently-created subscriptions, and will
require the user to check a checkbox before creating another one.

16 months agoCleanup: split checkout function into separate functions
Sybren A. Stüvel [Fri, 29 May 2020 08:34:35 +0000 (10:34 +0200)]
Cleanup: split checkout function into separate functions

The `CheckoutView.form_valid()` function was doing way too much in one
function, so I split it up into smaller chunks. It could be split up and
cleaned up more, but this is a nice start.

No functional changes.

16 months agoTests: hide coverage report on test failure
Sybren A. Stüvel [Fri, 29 May 2020 13:27:50 +0000 (15:27 +0200)]
Tests: hide coverage report on test failure

The coverage report is quite long, so it scrolls the actual error messages
way off screen.

17 months agoFix T76716 - Ensure CSRF token in landing page
Francesco Siddi [Fri, 29 May 2020 07:27:46 +0000 (09:27 +0200)]
Fix T76716 - Ensure CSRF token in landing page

When the user is not authenticated, there is a possibility that the csrf_token
is not set in the user session. This causes the currency change switch to
send a POST request that gets rejected. By adding {% csrf_token %} we
force the creation of the token in the session. This could have been done
using the ensure_csrf_cookie method, but the landing view is served by the
Wagtail framework, which would need to be "extended" to support this.
In this case we prefer to keep tings simple.

17 months agoRestructure reCaptcha integration
Sybren A. Stüvel [Thu, 28 May 2020 16:15:21 +0000 (18:15 +0200)]
Restructure reCaptcha integration

The old approach was submitting the form when the CAPTCHA check would
succeeded via `theform.submit()`. This does not trigger on-submit
events, and as a result interfered with the BrainTree processing of the
form.

The new approach changes the submit button to a regular button, and
performs the CAPTCHA check in its on-click handler. As a result, this
check doesn't need the form's on-submit handler any more. By calling
`theform.requestSubmit()`, the BrainTree on-submit handler is still
called, and things should work again.

17 months agoUpdate package.json and package-lock.json
Francesco Siddi [Tue, 26 May 2020 10:26:57 +0000 (12:26 +0200)]
Update package.json and package-lock.json

Various security updates.

18 months agoBraintree: expire client tokens after 10 minutes
Sybren A. Stüvel [Tue, 7 Apr 2020 16:37:21 +0000 (18:37 +0200)]
Braintree: expire client tokens after 10 minutes

Braintree expires client tokens after 24 hours. We don't even have to keep
them for that long.

18 months agoBraintree: upgrade JavaScript dropin 1.13.0 → 1.22.1
Sybren A. Stüvel [Tue, 7 Apr 2020 14:45:09 +0000 (16:45 +0200)]
Braintree: upgrade JavaScript dropin 1.13.0 → 1.22.1

Maybe this helps with the error we're seeing in the production site on the
checkout page:

```
{'data': None,
 'errors': [{'extensions': {'errorClass': 'AUTHENTICATION',
    'errorType': 'developer_error'},
   'message': 'Authentication credentials are invalid.'}],
 'extensions': {'requestId': 'xxxx'}}
```

19 months agoUnlimited length for Transaction.failure_message
Sybren A. Stüvel [Thu, 26 Mar 2020 09:13:44 +0000 (10:13 +0100)]
Unlimited length for Transaction.failure_message

In PostgreSQL there is no performance difference between VARCHAR and TEXT,
so it's better to just have unlimited space for error messages.

19 months agoFix transaction failure message not fitting into database field
Sybren A. Stüvel [Thu, 26 Mar 2020 09:02:03 +0000 (10:02 +0100)]
Fix transaction failure message not fitting into database field

Due to a recent DDoS attack there were timeouts connecting to the Braintree
payment gateway, resulting in long error messages. These couldn't fit into
the database.

This commit lengthens the `Transaction.failure_message` field from 128 to
255 characters and shortens failure messages that are still too long to
fit.

19 months agoAdded missing template `payment_method_not_used.pug`
Sybren A. Stüvel [Mon, 16 Mar 2020 10:22:43 +0000 (11:22 +0100)]
Added missing template `payment_method_not_used.pug`