-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d18fefd
commit 2c0f7db
Showing
18 changed files
with
1,180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
========================= | ||
Monetico Payment Acquirer | ||
========================= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:91e6c262ca7224be33209224b2b47eb7926fdf58181691b6a4615aded5a21674 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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--france-lightgray.png?logo=github | ||
:target: https://github.com/OCA/l10n-france/tree/14.0/payment_monetico | ||
:alt: OCA/l10n-france | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/l10n-france-14-0/l10n-france-14-0-payment_monetico | ||
: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-france&target_branch=14.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Payment Acquirer for `Monetico <https://www.monetico-paiement.fr/>`_ french payment gateway. | ||
|
||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-france/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-france/issues/new?body=module:%20payment_monetico%0Aversion:%2014.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 | ||
~~~~~~~ | ||
|
||
* Akretion | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Akretion <https://www.akretion.com>`_: | ||
|
||
* Florian Mounier | ||
|
||
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-france <https://github.com/OCA/l10n-france/tree/14.0/payment_monetico>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import controllers | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2024 Akretion (http://www.akretion.com). | ||
# @author Florian Mounier <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Monetico Payment Acquirer", | ||
"summary": "Accept payments with Monetico secure payment gateway.", | ||
"version": "14.0.1.0.0", | ||
"license": "AGPL-3", | ||
"category": "Accounting", | ||
"author": "Akretion,Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/l10n-france", | ||
"depends": ["payment"], | ||
"data": [ | ||
"views/payment_views.xml", | ||
"views/payment_monetico_templates.xml", | ||
"data/payment_acquirer_data.xml", | ||
], | ||
"images": ["static/description/icon.png"], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Copyright 2024 Akretion (http://www.akretion.com). | ||
# @author Florian Mounier <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
import logging | ||
import pprint | ||
|
||
import werkzeug | ||
|
||
from odoo import http | ||
from odoo.http import request | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
class MoneticoController(http.Controller): | ||
_notify_url = "/payment/monetico/webhook/" | ||
_return_url = "/payment/monetico/return/" | ||
|
||
def monetico_validate_data(self, **post): | ||
monetico = request.env["payment.acquirer"].search( | ||
[("provider", "=", "monetico")], limit=1 | ||
) | ||
values = dict(post) | ||
shasign = values.pop("MAC", False) | ||
if shasign.upper() != monetico._monetico_generate_shasign(values).upper(): | ||
_logger.debug("Monetico: validated data") | ||
return ( | ||
request.env["payment.transaction"] | ||
.sudo() | ||
.form_feedback(post, "monetico") | ||
) | ||
_logger.warning("Monetico: data are corrupted") | ||
return False | ||
|
||
@http.route( | ||
"/payment/monetico/webhook/", | ||
type="http", | ||
auth="public", | ||
methods=["POST"], | ||
csrf=False, | ||
) | ||
def monetico_webhook(self, **post): | ||
"""Monetico IPN.""" | ||
_logger.info( | ||
"Beginning Monetico IPN form_feedback with post data %s", | ||
pprint.pformat(post), | ||
) | ||
if not post: | ||
_logger.warning("Monetico: received empty notification; skip.") | ||
else: | ||
self.monetico_validate_data(**post) | ||
return "" | ||
|
||
@http.route( | ||
"/payment/monetico/return", | ||
type="http", | ||
auth="public", | ||
methods=["POST"], | ||
csrf=False, | ||
save_session=False, | ||
) | ||
def monetico_return(self, **post): | ||
"""Monetico DPN.""" | ||
try: | ||
_logger.info( | ||
"Beginning Monetico DPN form_feedback with post data %s", | ||
pprint.pformat(post), | ||
) | ||
self.monetico_validate_data(**post) | ||
except Exception: | ||
pass | ||
return werkzeug.utils.redirect("/payment/process") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- | ||
Copyright 2024 Akretion (http://www.akretion.com). | ||
@author Florian Mounier <[email protected]> | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
--> | ||
<odoo> | ||
<data noupdate="1"> | ||
|
||
<record id="payment_acquirer_monetico" model="payment.acquirer"> | ||
<field name="name">Monetico</field> | ||
<field | ||
name="image_128" | ||
type="base64" | ||
file="payment_monetico/static/src/img/logo.png" | ||
/> | ||
<field name="provider">monetico</field> | ||
<field name="state">test</field> | ||
<field name="company_id" ref="base.main_company" /> | ||
<field name="view_template_id" ref="payment_monetico.monetico_form" /> | ||
|
||
<field name="monetico_ept">0000001</field> | ||
<field name="monetico_company_code">company_code</field> | ||
<field | ||
name="monetico_secret" | ||
>12345678901234567890123456789012345678P0</field> | ||
|
||
<field name="description" type="html"> | ||
<p>Accept payments with Monetico secure payment gateway.</p> | ||
<ul class="list-inline"> | ||
<li class="list-inline-item"><i | ||
class="fa fa-check" | ||
/>Online Payment</li> | ||
<li class="list-inline-item"><i class="fa fa-check" />eCommerce</li> | ||
</ul> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import payment |
Oops, something went wrong.