summaryrefslogtreecommitdiffstats
path: root/eopayment/systempayv2.py
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2016-02-16 09:51:41 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2016-02-16 17:20:48 (GMT)
commitb69cefbfa86a6c9f51e199217d141d8593b051d5 (patch)
tree84e7e6a0c0a138210fabf68f3f4b657ac11beb76 /eopayment/systempayv2.py
parent8cd625e4651ededa92d888c31d64fafa578f2a9e (diff)
downloadeopayment-b69cefbfa86a6c9f51e199217d141d8593b051d5.zip
eopayment-b69cefbfa86a6c9f51e199217d141d8593b051d5.tar.gz
eopayment-b69cefbfa86a6c9f51e199217d141d8593b051d5.tar.bz2
standardise normal_return_url and automatic_return_url options (#9998)
Diffstat (limited to 'eopayment/systempayv2.py')
-rw-r--r--eopayment/systempayv2.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/eopayment/systempayv2.py b/eopayment/systempayv2.py
index 90bb822..fb36b4c 100644
--- a/eopayment/systempayv2.py
+++ b/eopayment/systempayv2.py
@@ -5,6 +5,7 @@ import hashlib
import logging
import string
import urlparse
+import warnings
from gettext import gettext as _
from common import PaymentCommon, PaymentResponse, PAID, ERROR, FORM, Form
@@ -214,6 +215,17 @@ class Payment(PaymentCommon):
description = {
'caption': 'SystemPay, système de paiment du groupe BPCE',
'parameters': [
+ {
+ 'name': 'normal_return_url',
+ 'caption': _('Normal return URL'),
+ 'default': '',
+ 'required': True,
+ },
+ {
+ 'name': 'automatic_return_url',
+ 'caption': _('Automatic return URL (ignored, must be set in Payzen/SystemPay backoffice)'),
+ 'required': False,
+ },
{'name': 'service_url',
'default': service_url,
'caption': _(u'URL du service de paiment'),
@@ -266,8 +278,13 @@ class Payment(PaymentCommon):
kwargs.update(add_vads({'amount': unicode(amount)}))
if amount < 0:
raise ValueError('amount must be an integer >= 0')
+ normal_return_url = self.normal_return_url
if next_url:
- kwargs[VADS_URL_RETURN] = unicode(next_url)
+ warnings.warn("passing next_url to request() is deprecated, "
+ "set normal_return_url in options", DeprecationWarning)
+ normal_return_url = next_url
+ if normal_return_url:
+ kwargs[VADS_URL_RETURN] = unicode(normal_return_url)
if name is not None:
kwargs['vads_cust_name'] = unicode(name)
if address is not None: