Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0][IMP][payment_redsys] Don't die on missing dependencies #255

Merged
merged 2 commits into from Nov 23, 2015
Merged
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
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