Skip to content

Commit

Permalink
Merge pull request #255 from grupoesoc/redsys-deps
Browse files Browse the repository at this point in the history
[8.0][IMP][payment_redsys] Don't die on missing dependencies
  • Loading branch information
pedrobaeza committed Nov 23, 2015
2 parents 1772454 + 439ddd7 commit c73d78a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions payment_redsys/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,11 @@ pasarela de pago envía el formulario a "/payment/redsys/return" odoo no sabe
con que base de datos procesar esta información.
Por lo que hay que establecer los parametros **dbfilter** y **dbname** en
**openerp-server.conf**.

Instalación
-----------

Para utilizar este módulo, necesita la biblioteca `pycrypto
<https://pypi.python.org/pypi/pycrypto>`_ instalada en su sistema::

pip install pycrypto
6 changes: 6 additions & 0 deletions payment_redsys/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
'version': '8.0.1.0.0',
'author': "Incaser Informatica S.L.,Odoo Community Association (OCA)",
'depends': ['payment'],
"external_dependencies": {
"python": [
"Crypto.Cipher.DES3",
],
"bin": [],
},
'data': [
'views/redsys.xml',
'views/payment_acquirer.xml'
Expand Down
6 changes: 5 additions & 1 deletion payment_redsys/models/redsys.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from Crypto.Cipher import DES3
import hashlib
import hmac
import base64
Expand All @@ -11,6 +10,11 @@
from openerp.tools.float_utils import float_compare
_logger = logging.getLogger(__name__)

try:
from Crypto.Cipher import DES3
except ImportError:
_logger.info("Missing dependency (pycrypto). See README.")


class AcquirerRedsys(models.Model):
_inherit = 'payment.acquirer'
Expand Down

0 comments on commit c73d78a

Please sign in to comment.