summaryrefslogtreecommitdiff
path: root/addons/payment_sips/controllers/main.py
diff options
context:
space:
mode:
authorDamien Bouvy <dbo@odoo.com>2020-05-18 15:09:16 +0000
committerDamien Bouvy <dbo@odoo.com>2020-08-17 13:21:08 +0000
commitbb9ae7b08b2b062acec13de4a92737a57be880e2 (patch)
treed4d69f8c082b950c2256faa42f44002f573b6170 /addons/payment_sips/controllers/main.py
parentfc9ea2c519bf494be1dbb668e742e3d60f41cf05 (diff)
[IMP] payment_sips: code improvements
Extend support for all currencies listed in the SIPS documentation, including the decimal numbers per currency. Move this hardcoded data is a less annoying place. Remove unnecessary code (e.g. checking if there is more than one payment with the same reference, which can't happen due to a SQL unique constraint from the payment module). Code clarity while I'm at it. Task-2259942 closes odoo/odoo#51473 Related: odoo/upgrade#1216 Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Diffstat (limited to 'addons/payment_sips/controllers/main.py')
-rw-r--r--addons/payment_sips/controllers/main.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/addons/payment_sips/controllers/main.py b/addons/payment_sips/controllers/main.py
index 6f268170485..1a9f99fa701 100644
--- a/addons/payment_sips/controllers/main.py
+++ b/addons/payment_sips/controllers/main.py
@@ -26,14 +26,12 @@ class SipsController(http.Controller):
_logger.warning('Sips: data are corrupted')
return False
- @http.route([
- '/payment/sips/ipn/'],
- type='http', auth='public', methods=['POST'], csrf=False)
+ @http.route('/payment/sips/ipn/', type='http', auth='public', methods=['POST'], csrf=False)
def sips_ipn(self, **post):
""" Sips IPN. """
_logger.info('Beginning Sips IPN form_feedback with post data %s', pprint.pformat(post)) # debug
if not post:
- # SIPS sometimes send empty notification, the reason why is
+ # SIPS sometimes sends empty notifications, the reason why is
# unclear but they tend to pollute logs and do not provide any
# meaningful information; log as a warning instead of a traceback
_logger.warning('Sips: received empty notification; skip.')
@@ -41,8 +39,7 @@ class SipsController(http.Controller):
self.sips_validate_data(**post)
return ''
- @http.route([
- '/payment/sips/dpn'], type='http', auth="public", methods=['POST'], csrf=False)
+ @http.route('/payment/sips/dpn', type='http', auth="public", methods=['POST'], csrf=False)
def sips_dpn(self, **post):
""" Sips DPN """
try: