summaryrefslogtreecommitdiff
path: root/postgresqleu/paypal/views.py
diff options
context:
space:
mode:
authorMagnus Hagander2013-12-16 16:40:43 +0000
committerMagnus Hagander2013-12-16 16:40:43 +0000
commita4c59328f1dca33e43bea0eb1f1c4470b69c32e4 (patch)
tree0b48813d3c6f77c5765f6faa12ea193bf9240a40 /postgresqleu/paypal/views.py
parent8794557c04d75453f50d5e3c5bfb047fdbccb99d (diff)
Include payment links invoice payments as well
It never hurts to have a linkback to Adyen and Paypal as well as the link directly to the invoice - since we have the info.
Diffstat (limited to 'postgresqleu/paypal/views.py')
-rw-r--r--postgresqleu/paypal/views.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/postgresqleu/paypal/views.py b/postgresqleu/paypal/views.py
index bcde2ede..eedeadaf 100644
--- a/postgresqleu/paypal/views.py
+++ b/postgresqleu/paypal/views.py
@@ -123,6 +123,12 @@ def paypal_return_handler(request):
matched = False)
ti.save()
+ # Generate URLs that link back to paypal in a way that we can use
+ # from the accounting system. Note that this is an undocumented
+ # URL format for paypal, so it may stop working at some point in
+ # the future.
+ urls = ["https://www.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s" % ti.paypaltransid,]
+
# Separate out donations made through our website
if ti.transtext == "PostgreSQL Europe donation":
ti.matched = True
@@ -137,7 +143,6 @@ def paypal_return_handler(request):
(settings.ACCOUNTING_PAYPAL_FEE_ACCOUNT, accstr, ti.fee),
(settings.ACCOUNTING_DONATIONS_ACCOUNT, accstr, -ti.amount),
]
- urls = ["https://www.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s" % ti.paypaltransid,]
create_accounting_entry(date.today(), accrows, True, urls)
return render_to_response('paypal/noinvoice.html', {
@@ -150,6 +155,7 @@ def paypal_return_handler(request):
ti.fee,
settings.ACCOUNTING_PAYPAL_INCOME_ACCOUNT,
settings.ACCOUNTING_PAYPAL_FEE_ACCOUNT,
+ urls,
payment_logger)
if r == invoicemanager.RESULT_OK:
# Matched it!