Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion payment_payfip/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'name': "Intermédiaire de paiement PayFIP",
'version': '13.0.25.11.06',
'version': '13.0.26.07.07',
'summary': """Intermédiaire de paiement : Implémentation de PayFIP""",
'author': "Horanet",
'website': "https://www.horanet.com/",
Expand Down
48 changes: 15 additions & 33 deletions payment_payfip/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-16 08:42+0000\n"
"PO-Revision-Date: 2024-04-16 08:42+0000\n"
"POT-Creation-Date: 2026-07-08 12:58+0000\n"
"PO-Revision-Date: 2026-07-08 12:58+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -47,11 +47,7 @@ msgstr ""
"</p>"

#. module: payment_payfip
#: code:addons/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#, python-format
msgid ""
Expand All @@ -77,11 +73,7 @@ msgid "Abandoned payment (A)"
msgstr "Paiement abandonné (A)"

#. module: payment_payfip
#: code:addons/odoo/addons/payment_payfip/controllers/main.py:0
#: code:addons/payment_payfip/controllers/main.py:0
#: code:addons/payment_payfip/odoo/addons/payment_payfip/controllers/main.py:0
#: code:addons/payment_payfip/payment_payfip/controllers/main.py:0
#: code:addons/payment_payfip/setup/payment_payfip/odoo/addons/payment_payfip/controllers/main.py:0
#: code:addons/setup/payment_payfip/odoo/addons/payment_payfip/controllers/main.py:0
#, python-format
msgid "Accepted payment, order has been updated."
Expand All @@ -92,6 +84,13 @@ msgstr "Paiement accepté, la facture à été mise à jour."
msgid "Activation mode"
msgstr "Mode activation"

#. module: payment_payfip
#: code:addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_transaction.py:0
#, python-format
msgid "An error occurred, please retry later."
msgstr "Une erreur est survenue, veuillez réessayer plus tard"

#. module: payment_payfip
#: model_terms:ir.ui.view,arch_db:payment_payfip.transaction_form_payfip
msgid "Check PayFIP transaction"
Expand Down Expand Up @@ -130,11 +129,7 @@ msgid "Form action URL"
msgstr "URL de renvoi du formulaire"

#. module: payment_payfip
#: code:addons/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#, python-format
msgid ""
Expand Down Expand Up @@ -164,7 +159,7 @@ msgstr "Autres cas (Z)"
#: model_terms:ir.ui.view,arch_db:payment_payfip.transaction_form_payfip
#: model:payment.acquirer,name:payment_payfip.payment_acquirer_payfip
msgid "PayFIP"
msgstr "PayFIP"
msgstr ""

#. module: payment_payfip
#: model:ir.model.fields,field_description:payment_payfip.field_payment_transaction__payfip_amount
Expand All @@ -182,27 +177,16 @@ msgid "PayFIP: Draft payments recovered"
msgstr "PayFIP : Paiements en brouillons réévalués"

#. module: payment_payfip
#: code:addons/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/payment_payfip/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#: code:addons/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_acquirer.py:0
#, python-format
msgid "PayFIP: activation mode can be set in test environment only."
msgstr "PayFIP : l'activation ne peut être déclenchée qu'en environement de test"
msgstr ""
"PayFIP : l'activation ne peut être déclenchée qu'en environement de test"

#. module: payment_payfip
#: code:addons/odoo/addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/odoo/addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/payment_payfip/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/payment_payfip/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/payment_payfip/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/payment_payfip/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_transaction.py:0
#: code:addons/setup/payment_payfip/odoo/addons/payment_payfip/models/inherited_payment_transaction.py:0
#, python-format
Expand All @@ -220,11 +204,7 @@ msgid "Payment Transaction"
msgstr "Transaction"

#. module: payment_payfip
#: code:addons/odoo/addons/payment_payfip/controllers/main.py:0
#: code:addons/payment_payfip/controllers/main.py:0
#: code:addons/payment_payfip/odoo/addons/payment_payfip/controllers/main.py:0
#: code:addons/payment_payfip/payment_payfip/controllers/main.py:0
#: code:addons/payment_payfip/setup/payment_payfip/odoo/addons/payment_payfip/controllers/main.py:0
#: code:addons/setup/payment_payfip/odoo/addons/payment_payfip/controllers/main.py:0
#, python-format
msgid "Payment failure, order has been cancelled."
Expand All @@ -238,7 +218,9 @@ msgstr "Fournisseur"
#. module: payment_payfip
#: model:ir.model.fields,help:payment_payfip.field_payment_transaction__payfip_operation_identifier
msgid "Reference of the request of TX as stored in the acquirer database"
msgstr "Référence de la demande de transaction telle que stockée dans la base de donnée de l'acquéreur."
msgstr ""
"Référence de la demande de transaction telle que stockée dans la base de "
"donnée de l'acquéreur."

#. module: payment_payfip
#: model:ir.model.fields,field_description:payment_payfip.field_payment_transaction__payfip_return_url
Expand Down
41 changes: 31 additions & 10 deletions payment_payfip/models/inherited_payment_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytz
import uuid

from docutils.nodes import reference
from odoo import api, fields, models, _
from odoo.tools import float_round

Expand Down Expand Up @@ -60,19 +61,39 @@ class PayFIPTransaction(models.Model):

# region CRUD (overrides)
@api.model
def create(self, vals):
res = super(PayFIPTransaction, self).create(vals)
if res.acquirer_id.provider == 'payfip':
prec = self.env['decimal.precision'].precision_get('Product Price')
email = res.partner_email
amount = int(float_round(res.amount * 100.0, prec))
def payfip_create(self, vals):
res = dict()
idop = ''
acquirer_reference = ''
acquirer = self.env['payment.acquirer'].browse(vals['acquirer_id'])
prec = self.env['decimal.precision'].precision_get('Product Price')
partner_email = vals.get('partner_email', False)
amount_val = vals.get('amount', 0)
if not vals.get('reference', False):
res['reference'] = self._compute_reference(values=vals)
reference_val = res['reference']
else:
reference_val = vals.get('reference', '')
if partner_email and reference_val and amount_val > 0:
amount = int(float_round(amount_val * 100.0, prec))
# Les caractères spéciaux ne sont pas autorisés par Payfip dans l'objet
reference = res.reference.replace('/', ' slash ').replace('-', 'x')
reference = reference_val.replace('/', ' slash ').replace('-', 'x')
acquirer_reference = '%.15d' % int(uuid.uuid4().int % 899999999999999)
res.acquirer_reference = acquirer_reference
idop = res.acquirer_id.payfip_get_id_op_from_web_service(email, amount, reference, acquirer_reference)
res.payfip_operation_identifier = idop
idop = acquirer.payfip_get_id_op_from_web_service(partner_email, amount,
reference, acquirer_reference)
else:
_logger.error(
'An error occurred before idOp negociation with PayFIP web service. '
'Missing data in transaction.'
)

if idop:
res.update({
'acquirer_reference': acquirer_reference,
'payfip_operation_identifier': idop,
})
else:
raise ValueError(_('An error occurred, please retry later.'))
return res

# endregion
Expand Down