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

[17.0][MIG] payment_redsys: Migration to 17.0 #3511

Merged
merged 52 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
c29a2ec
[ADD] Nuevo modulo para pagos con tajeta (sermepa-redsys)
sergio-teruel Nov 5, 2014
a14de7e
[DEL] No crear un pago redsys por defecto al instalar
rlizana Jan 5, 2015
4a5404f
[FIX+IMP] payment_redsys: Descripción + error reference
sergio-teruel Jan 21, 2015
f8fcd3b
[FIX] payment_redsys: New module
pedrobaeza Apr 3, 2015
f2bf05f
[IMP] payment_redsys: Migracion a HMAC SHA-256
sergio-teruel Nov 13, 2015
aa2a3ba
[FIX] payment_redsys: Renaming class name yields unwanted side effect.
eantones Nov 23, 2015
5daef25
[IMP] payment_redsys: Change payment logo
sergio-teruel Nov 27, 2015
4e7f062
[IMP] payment_redsys: 3 enhancements:
eantones Nov 30, 2015
3453b6c
[IMP] payment_redsys: Change card icon in checkout process.
sergio-teruel Nov 30, 2015
a1ba06a
[FIX+IMP] payment_redsys: 2 things:
eantones Dec 1, 2015
2aac4fa
[IMP+FIX] payment_redsys: Logo tarjetas + Show order information afte…
sergio-teruel Dec 17, 2015
2627600
[IMP] payment_redsys: Add the discount on the order summary
eantones Mar 7, 2016
b4ea375
[IMP][8.0] payment_redsys: Pagar un porcentaje del pedido (#362)
sergio-teruel Aug 21, 2016
7aadc27
[MIG] payment_redsys: Migration to v9
sergio-teruel Dec 1, 2016
d0069f9
[MIG] payment_redsys: Migrated to 10.0
sergio-teruel May 14, 2017
5e9c7f4
[11.0][MIG] payment_redsys: Migration
sergio-teruel Nov 13, 2017
75835ff
[chg] Dependency from abandoned pycrypto to pycryptodome
m1k3lm Apr 8, 2018
d728347
[FIX] payment_redsys: Fix signature
igallart Jan 24, 2019
f3f0849
[IMP] payment_redsys: README by fragments
pedrobaeza Mar 22, 2019
714442c
[12.0][MIG] payment_redsys: Better test coverage
sergio-teruel Apr 1, 2019
9d96785
[IMP] payment_redsys: Better status code check
pedrobaeza Feb 9, 2018
8f0cfcc
Translated using Weblate (Spanish)
josepmy Jul 22, 2019
55d739b
[FIX] payment_redsys: Process order after gateway payment successful
sergio-teruel Feb 5, 2020
f2db5d9
[IMP] account_multicompany_easy_creation: black, isort, prettier
CarlosRoca13 May 13, 2020
ff2f2ba
[MIG] payment_redsys: Migration to v13.0
CarlosRoca13 May 13, 2020
e23709f
Translated using Weblate (Spanish)
danimv5 Jul 27, 2020
875dca1
Translated using Weblate (Catalan)
brendapaniagua Nov 6, 2020
2153706
[FIX+IMP] payment_redsys: Set Merchant titular as billing partner + E…
sergio-teruel Nov 19, 2020
6ef2b41
[MIG] payment_redsys: Migration to 14.0
joao-p-marques Jan 4, 2021
9fefd96
Translated using Weblate (Catalan)
danimv5 Mar 30, 2021
6b618c2
[IMP] payment_redsys: README improvement of DS_Order length limit
dalonsod Apr 28, 2021
978d015
[IMP] payment_redsys: Remove send_quotation + module_id in data file
manuelregidor Jul 23, 2021
f431be4
[IMP] payment_redsys: add 'Bizum' option to 'redsys_pay_method' field.
azucenatrey Jul 21, 2021
38770f4
[IMP] payment_redsys: Put real package on pypi
pedrobaeza Jan 12, 2022
fe8dc47
[FIX] payment_redsys: JSON request + wrong reference
chienandalu Jan 26, 2022
3acc28c
[FIX] payment_redsys: Use updated library + black formatting
pedrobaeza Mar 30, 2022
abd7066
[FIX] payment_redsys: feedback error string format
chienandalu Feb 7, 2023
54cae39
[MIG] payment_redsys: Migration to v15.0
sergio-teruel Mar 23, 2023
b6dcfad
[UPD] Update payment_redsys.pot
Apr 1, 2023
e75733d
[UPD] README.rst
OCA-git-bot Apr 1, 2023
e93a0bd
[OU-ADD] payment_redsys: set redirect_form_view_id to the acquirer (#…
May 19, 2023
ceed676
[16.0][MIG] payment_redsys: Migration to 16.0
Rferri44-S73 Jun 26, 2023
59168ba
[UPD] Update payment_redsys.pot
Jul 25, 2023
14ba213
[UPD] README.rst
OCA-git-bot Jul 25, 2023
752264b
Update translation files
weblate Jul 25, 2023
c9853c2
Update translation files
weblate Jul 25, 2023
00e297a
[UPD] README.rst
OCA-git-bot Sep 3, 2023
aa967de
Translated using Weblate (Spanish)
Ivorra78 Aug 21, 2023
63e7ed5
[FIX] payment_redsys: Missing parameter in method override
Sep 19, 2023
2edf3b4
oca-github-bot post-merge updates
OCA-git-bot Sep 20, 2023
9279543
[IMP] payment_redsys: pre-commit auto fixes
peluko00 Jun 12, 2024
3ff6b81
[MIG] payment_redsys: Migration to 17.0
peluko00 Jun 12, 2024
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
172 changes: 172 additions & 0 deletions payment_redsys/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
=======================
Pasarela de pago Redsys
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3f8fc93831f151db43caf34fec4b5601471c19bbc24744d96e0def83dada8e58
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-spain/tree/17.0/payment_redsys
:alt: OCA/l10n-spain
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-spain-17-0/l10n-spain-17-0-payment_redsys
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Este módulo añade la opción de pago a través de la pasarela de Redsys,
pudiendo seleccionar entre los métodos de pago: pago con tarjeta, pago
por transferencia, domiciliación y Bizum.

**Table of contents**

.. contents::
:local:

Installation
============

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

::

pip3 install pycryptodome

Configuration
=============

Parámetros
----------

- **Nombre del comercio**: Indicaremos el nombre del comercio.
- **Número de comercio (FUC)**: Indicaremos el número de comercio que
nuestra entidad nos ha comunicado.
- **Clave secreta de encriptación**: Indicaremos la clave de
encriptación que tiene el comercio.
- **Número de terminal**: Indicaremos el terminal del TPV.
- **Tipo de firma**: Seleccionaremos el tipo de firma del comercio.
- **Tipo de moneda**: Seleccionaremos la moneda de nuestro terminal TPV
(Normalmente EUR - Euros).
- **Tipo de transacción**: Indicaremos el tipo de transacción, 0.
- **Idioma TPV**: Indicaremos el idioma en el TPV.
- **Método de pago**: Indicaremos qué tipo de pago se debe aceptar,
pago con tarjeta, Bizum u otro de los disponibles.
- **Porcentaje de pago**: Indicar el porcentaje de pago que se permite,
si se deja a 0.0 se entiende 100%.

Nota
----

Se tiene que verificar la configuración del comercio en el módulo de
administración de Redsys, donde la opción “Parámetros en las URLs” debe
tener el valor “SI”.

En caso de que exista más de una base de datos en la instalación, cuando
la 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 el archivo de
configuración.

Para mostrar simultáneamente en el comercio electrónico varios de los
métodos de pago que proporciona Redsys, como pago con tarjeta y Bizum
por ejemplo, debemos duplicar el medio de pago y escoger en el campo
método de pago el que corresponda en cada caso.

En el caso de Bizum, el titular del TPV deberá solicitar al banco su
activación.

Known issues / Roadmap
======================

De acuerdo a los requisitos de Redsys, el tamaño máximo del número de
pedido resultante (``Ds_Order``) es de 12 caracteres. Este addon trunca
dicho dato en el comienzo de la transacción, con el resultado de que,
aunque Redsys la aceptará, no se finalizará el pedido pedido en Odoo al
retornar y entregará un Error 500 a Redsys. Para evitar esto, es
recomendable seleccionar secuencias de pedido que se ajusten a esta
limitación, en particular de 10 o menos caracteres, al ser la referencia
un número extendido a partir del pedido, que incluye un guion y un
número secuencial para posibles repeticiones de pago.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-spain/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20payment_redsys%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Sergio Teruel
- Carlos Dauden
- Carlos Roca
- João Marques

- Isaac Gallart <[email protected]>
- `Acysos S.L. <https://www.acysos.com>`__:

- Ignacio Ibeas <[email protected]>

- `Planes Asesoria y Soluciones Informaticas
S.L. <https://www.planesnet.com>`__:

- Luis Planes <[email protected]>

- `Studio73 <https://www.studio73.es/>`__:

- Rafa Ferri <[email protected]>

- `Factor Libre <https://factorlibre.com/>`__:

- Pablo De Andrés <[email protected]>

- `APSL-Nagarro <https://apsl.tech>`__:

- Antoni Marroig <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/17.0/payment_redsys>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions payment_redsys/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html

from . import models
from . import controllers
20 changes: 20 additions & 0 deletions payment_redsys/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2017 Tecnativa - Sergio Teruel
# Copyright 2020 Tecnativa - João Marques

{
"name": "Pasarela de pago Redsys",
"category": "Payment Acquirer",
"summary": "Payment Acquirer: Redsys Implementation",
"version": "17.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-spain",
"depends": ["payment", "website_sale"],
"external_dependencies": {"python": ["pycryptodome"]},
"data": [
"views/payment_provider.xml",
"views/payment_redsys_templates.xml",
"data/payment_redsys.xml",
],
"license": "AGPL-3",
"installable": True,
}
1 change: 1 addition & 0 deletions payment_redsys/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
51 changes: 51 additions & 0 deletions payment_redsys/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2016-2017 Tecnativa - Sergio Teruel
# Copyright 2019 Ignacio Ibeas <[email protected]>
# Copyright 2023 Planesnet - Luis Planes, Laia Espinosa, Raul Solana
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import logging
import pprint

from odoo import http
from odoo.http import request

_logger = logging.getLogger(__name__)


class RedsysController(http.Controller):
_return_url = "/payment/redsys/return"
_cancel_url = "/payment/redsys/cancel"
_exception_url = "/payment/redsys/error"
_reject_url = "/payment/redsys/reject"

@http.route(
[
"/payment/redsys/return",
"/payment/redsys/cancel",
"/payment/redsys/error",
"/payment/redsys/reject",
],
type="http",
auth="public",
csrf=False,
)
def redsys_return(self, **post):
"""Redsys."""
_logger.info(

Check warning on line 34 in payment_redsys/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

payment_redsys/controllers/main.py#L34

Added line #L34 was not covered by tests
"Redsys: entering form_feedback with post data %s", pprint.pformat(post)
)
if post:
request.env["payment.transaction"].sudo()._handle_notification_data(

Check warning on line 38 in payment_redsys/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

payment_redsys/controllers/main.py#L38

Added line #L38 was not covered by tests
"redsys", post
)
return request.redirect("/payment/status")

Check warning on line 41 in payment_redsys/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

payment_redsys/controllers/main.py#L41

Added line #L41 was not covered by tests

@http.route(
["/payment/redsys/result/<page>"],
type="http",
auth="public",
methods=["GET"],
website=True,
)
def redsys_result(self, page, **vals):
return request.redirect("/payment/status")

Check warning on line 51 in payment_redsys/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

payment_redsys/controllers/main.py#L51

Added line #L51 was not covered by tests
44 changes: 44 additions & 0 deletions payment_redsys/data/payment_redsys.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016-2017 Tecnativa - Sergio Teruel
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3). -->
<odoo noupdate="1">
<record id="payment_method_redsys" model="account.payment.method">
<field name="name">Redsys</field>
<field name="code">redsys</field>
<field name="payment_type">inbound</field>
</record>

<record id="payment_method_cc_bizum" model="payment.method">
<field name="name">Bizum</field>
<field name="code">Bizum</field>
<field name="image" type="base64" file="payment_redsys/static/img/bizum.png" />
</record>

<record id="payment_provider_redsys" model="payment.provider">
<field name="name">Redsys</field>
<field
name="image_128"
type="base64"
file="payment_redsys/static/description/icon.png"
/>
<field name="code">redsys</field>
<field name="company_id" ref="base.main_company" />
<field name="redirect_form_view_id" ref="redsys_form" />
<field name="redsys_merchant_name">Bussines name</field>
<field name="redsys_merchant_code">8888888</field>
<field name="redsys_merchant_description">Bussines description</field>
<field name="redsys_secret_key">xxxxxxxxxxxx -- SHA256</field>
<field name="module_id" ref="base.module_payment_redsys" />
<field
name="pre_msg"
><![CDATA[
<p>You will be redirected to the Redsys payment gateway after clicking on the payment button.</p>]]></field>
<field
name="payment_method_ids"
eval="[Command.set([
ref('payment_redsys.payment_method_cc_bizum'),
])]"
/>
</record>

</odoo>
Loading
Loading