From 28a1371035fae9892e1ceeb6c9edd7ddda806ed5 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 14 Mar 2019 16:14:36 +0000 Subject: [PATCH] [FIX] payment_ogone: send client info in S2S tx data The client IP and email are useful pieces of information for auditing transactions, and are used by the Fraud Detection Module(s) of Ingenico. closes odoo/odoo#32058 Signed-off-by: Toufik Benjaa (tbe) --- addons/payment_ogone/models/payment.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/payment_ogone/models/payment.py b/addons/payment_ogone/models/payment.py index c78149af1d2..8bf9ee730c2 100644 --- a/addons/payment_ogone/models/payment.py +++ b/addons/payment_ogone/models/payment.py @@ -15,6 +15,7 @@ from odoo import api, fields, models, _ from odoo.addons.payment.models.payment_acquirer import ValidationError from odoo.addons.payment_ogone.controllers.main import OgoneController from odoo.addons.payment_ogone.data import ogone +from odoo.http import request from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, ustr from odoo.tools.float_utils import float_compare, float_repr, float_round @@ -356,9 +357,14 @@ class PaymentTxOgone(models.Model): 'ECI': 9, # Recurring (from eCommerce) 'ALIAS': self.payment_token_id.acquirer_ref, 'RTIMEOUT': 30, - 'PARAMPLUS' : url_encode(param_plus) + 'PARAMPLUS': url_encode(param_plus), + 'EMAIL': self.partner_id.email or '', + 'CN': self.partner_id.name or '', } + if request: + data['REMOTE_ADDR'] = request.httprequest.remote_addr + if kwargs.get('3d_secure'): data.update({ 'FLAG3D': 'Y',