summaryrefslogtreecommitdiff
path: root/postgresqleu/settings.py
diff options
context:
space:
mode:
authorMagnus Hagander2019-01-19 09:59:32 +0000
committerMagnus Hagander2019-01-19 09:59:32 +0000
commit9501985e7b15c5cfb55ae2e594dbbe1918592cef (patch)
tree9021f67c8d6b2681eb4a6f644fa402dcc138b847 /postgresqleu/settings.py
parentbfddd3d40fb2768cb39e2578db0b2eccd623e956 (diff)
Re-factor payment methods and move configuration to the database
This is a major refactoring of how the payment method integrates, with the intetion of making it more flexible and more easy to use. 1. Configuration now lives in the database instead of local_settings.py. 2. This configuration is edited through the /admin/ interface, which makes it a lot easier to add constraints (and instructions), thus preventing misconfiguration. 3. Invoice payment methods are now separate from invoice payment implementations. That means there can be multiple instances of the same payment method, such as multiple different paypal accounts, being managed. 4. All payment method implementations are now available in all installations, including Braintree and Trustly. This retires the x_ENABLED settings in local_settings.py. The code won't actually run unless there are any payment methods defined with them. 5. On migration, all payment methods that are marked as inactive and have never been used are removed. Any payment method that has been used is left around, since there are old invoices connected to it. Likewise, any payment method that is selected as available for any sponsorship level (past or future) is left in the system. XXXXXX manual action needed on production systems XXXXXX 1. Settings for payment methods should be migrated automatically, but should of course be verified! 2. The template for Manual Bank Transfer is *not* migrated, since it wasn't in settings.py, but in a template and overriden downstream. Migrate the contents of the template invoices/banktransfer.html to the database using the /admin/ interface. When this is done, the template can be removed. 3. Notification URLs in Adyen must be updated in the Adyen backoffice to include the payment method id in the url (adding a /n/ to the end of the URL, with n being the id of the payment method). 4. Notification URLs in Paypal must be updated the same way.
Diffstat (limited to 'postgresqleu/settings.py')
-rw-r--r--postgresqleu/settings.py61
1 files changed, 2 insertions, 59 deletions
diff --git a/postgresqleu/settings.py b/postgresqleu/settings.py
index 48760046..8f8408f7 100644
--- a/postgresqleu/settings.py
+++ b/postgresqleu/settings.py
@@ -105,6 +105,8 @@ INSTALLED_APPS = [
'postgresqleu.invoices',
'postgresqleu.accounting',
'postgresqleu.util',
+ 'postgresqleu.trustlypayment',
+ 'postgresqleu.braintreepayment',
]
# Emails
@@ -138,47 +140,8 @@ MEMBERSHIP_COUNTRY_VALIDATOR = None
INVOICE_PDF_BUILDER = 'postgresqleu.util.misc.baseinvoice.BaseInvoice'
REFUND_PDF_BUILDER = 'postgresqleu.util.misc.baseinvoice.BaseRefund'
-# Paypal sandbox configuration
-PAYPAL_BASEURL = 'https://www.paypal.com/cgi-bin/webscr'
-PAYPAL_EMAIL = DEFAULT_EMAIL
-PAYPAL_PDT_TOKEN = 'abc123'
-PAYPAL_DEFAULT_SOURCEACCOUNT = 1
-PAYPAL_API_USER = 'someuser'
-PAYPAL_API_PASSWORD = 'secret'
-PAYPAL_API_SIGNATURE = 'secret'
-PAYPAL_SANDBOX = True
-PAYPAL_REPORT_RECEIVER = DEFAULT_EMAIL
-PAYPAL_DONATION_TEXT = "Paypal Donation"
-
-# Adyen configuration
-ADYEN_IS_TEST_SYSTEM = True
-ADYEN_BASEURL = 'https://test.adyen.com/'
-ADYEN_CABASEURL = 'https://test-ca.adyen.com/'
-ADYEN_APIBASEURL = 'https://pal-test.adyen.com/'
-ADYEN_MERCHANTACCOUNT = 'whatever'
-ADYEN_SIGNKEY = 'foobar'
-ADYEN_SKINCODE = 'abc123'
-ADYEN_NOTIFICATION_RECEIVER = DEFAULT_EMAIL
-ADYEN_NOTIFY_USER = 'adyennot'
-ADYEN_NOTIFY_PASSWORD = 'topsecret'
-ADYEN_REPORT_USER = 'someone'
-ADYEN_REPORT_PASSWORD = 'topsecret'
-ADYEN_WS_USER = 'someone'
-ADYEN_WS_PASSWORD = 'topsecret'
-ADYEN_MERCHANTREF_PREFIX = 'PGEU'
-ADYEN_MERCHANTREF_REFUND_PREFIX = 'PGEUREFUND'
-
# Account numbers used for auto-accounting
ENABLE_AUTO_ACCOUNTING = False
-ACCOUNTING_PAYPAL_INCOME_ACCOUNT = 1932
-ACCOUNTING_PAYPAL_FEE_ACCOUNT = 6041
-ACCOUNTING_PAYPAL_TRANSFER_ACCOUNT = 1930
-ACCOUNTING_ADYEN_AUTHORIZED_ACCOUNT = 1621
-ACCOUNTING_ADYEN_PAYABLE_ACCOUNT = 1622
-ACCOUNTING_ADYEN_FEE_ACCOUNT = 6040
-ACCOUNTING_ADYEN_PAYOUT_ACCOUNT = 1930
-ACCOUNTING_ADYEN_MERCHANT_ACCOUNT = 1971
-ACCOUNTING_ADYEN_REFUNDS_ACCOUNT = 2498
ACCOUNTING_MANUAL_INCOME_ACCOUNT = 1930
ACCOUNTING_CONFREG_ACCOUNT = 3003
ACCOUNTING_CONFSPONSOR_ACCOUNT = 3004
@@ -205,8 +168,6 @@ ENABLE_PG_COMMUNITY_AUTH = False
ENABLE_NEWS = True
ENABLE_MEMBERSHIP = False
ENABLE_ELECTIONS = False
-ENABLE_BRAINTREE = False
-ENABLE_TRUSTLY = False
# Set to a username and password in local_settings.py to enable global http auth
GLOBAL_LOGIN_USER = ''
@@ -288,21 +249,3 @@ if ENABLE_MEMBERSHIP:
if ENABLE_ELECTIONS:
INSTALLED_APPS.append('postgresqleu.elections')
-
-
-if ENABLE_BRAINTREE:
- INSTALLED_APPS.append('postgresqleu.braintreepayment')
- BRAINTREE_SANDBOX = False
- # Accounts to use for braintree transactions
- # Override in local_settings.py, and also configure
- # the public and secret keys there.
- ACCOUNTING_BRAINTREE_AUTHORIZED_ACCOUNT = 1621
- ACCOUNTING_BRAINTREE_PAYABLE_ACCOUNT = 1623
- ACCOUNTING_BRAINTREE_PAYOUT_ACCOUNT = 1930
- ACCOUNTING_BRAINTREE_FEE_ACCOUNT = 6040
-
-if ENABLE_TRUSTLY:
- INSTALLED_APPS.append('postgresqleu.trustlypayment')
-
- # Accounts to use for trustly transactions
- ACCOUNTING_TRUSTLY_ACCOUNT = 1972