summaryrefslogtreecommitdiff
path: root/postgresqleu/paypal/admin.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/paypal/admin.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/paypal/admin.py')
-rw-r--r--postgresqleu/paypal/admin.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/postgresqleu/paypal/admin.py b/postgresqleu/paypal/admin.py
index c2334cff..a5d9c5fa 100644
--- a/postgresqleu/paypal/admin.py
+++ b/postgresqleu/paypal/admin.py
@@ -1,10 +1,10 @@
from django.contrib import admin
-from .models import SourceAccount, TransactionInfo, ErrorLog
+from .models import TransactionInfo, ErrorLog
class TransactionInfoAdmin(admin.ModelAdmin):
- list_display = ('timestamp', 'sourceaccount', 'sender', 'amount', 'fee', 'transtext', 'matched', )
- list_filter = ('sourceaccount', 'matched', )
+ list_display = ('timestamp', 'sender', 'amount', 'fee', 'transtext', 'matched', )
+ list_filter = ('matched', )
ordering = ('-timestamp', )
search_fields = ('paypaltransid', 'sender', 'sendername', 'transtext',)
@@ -15,6 +15,5 @@ class ErrorLogAdmin(admin.ModelAdmin):
ordering = ('-timestamp', )
-admin.site.register(SourceAccount)
admin.site.register(TransactionInfo, TransactionInfoAdmin)
admin.site.register(ErrorLog, ErrorLogAdmin)