diff --git a/payment_environment/README.rst b/payment_environment/README.rst new file mode 100644 index 0000000..16a0e76 --- /dev/null +++ b/payment_environment/README.rst @@ -0,0 +1,124 @@ +======================================================== +Payment Acquirers' configuration with server_environment +======================================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github + :target: https://github.com/OCA/server-env/tree/13.0/payment_environment + :alt: OCA/server-env +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/server-env-13-0/server-env-13-0-payment_environment + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/254/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to configure payment acquirers using server_environment files. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +To install this module, you need to have the server_environment module +installed and properly configured. + +After installed, the environment configurable fields will be read from +the environment files. + +Configuration +============= + +With this module installed, the payment acquirers are configured in +the `server_environment_files` module (which is a module you should provide, +see the documentation of `server_environment` for more information). + +In the configuration file of each environment, for each payment acquirer you +may use the section `[payment_acquirer.technical_name]` to configure the +acquirer values, where "technical_name" is the acquirer's `tech_name`. + +This module alone only lets you configure the `state` field, which allows to +set the acquirer's environment. Most payment acquirers will define specific +fields to store their credentials, so glue modules are required to include them +in `_server_env_fields` if that's what you want. + +Example of config file :: + + [payment_acquirer.paypal] + state = test + +Usage +===== + +Once configured, Odoo will read the payment acquirer values from the +configuration file related to each environment defined in the main Odoo file. + +Known issues / Roadmap +====================== + +Due to the special nature of this addon, you cannot test it on the OCA runbot. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* `Camptocamp `_ + + * Iván Todorovich + +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. + +.. |maintainer-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px + :target: https://github.com/ivantodorovich + :alt: ivantodorovich + +Current `maintainer `__: + +|maintainer-ivantodorovich| + +This module is part of the `OCA/server-env `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/payment_environment/__init__.py b/payment_environment/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/payment_environment/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/payment_environment/__manifest__.py b/payment_environment/__manifest__.py new file mode 100644 index 0000000..fdaf852 --- /dev/null +++ b/payment_environment/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2021 Camptocamp SA +# @author Iván Todorovich +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) + +{ + "name": "Payment Acquirers' configuration with server_environment", + "summary": "Configure payment acquirers with server_environment", + "category": "Tools", + "version": "13.0.1.0.0", + "license": "LGPL-3", + "author": "Camptocamp, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/server-env", + "maintainers": ["ivantodorovich"], + "depends": ["payment", "server_environment"], + "data": ["views/payment_acquirer.xml"], +} diff --git a/payment_environment/i18n/payment_environment.pot b/payment_environment/i18n/payment_environment.pot new file mode 100644 index 0000000..04cf273 --- /dev/null +++ b/payment_environment/i18n/payment_environment.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * payment_environment +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: payment_environment +#: model:ir.model,name:payment_environment.model_payment_acquirer +msgid "Payment Acquirer" +msgstr "" diff --git a/payment_environment/models/__init__.py b/payment_environment/models/__init__.py new file mode 100644 index 0000000..14289a5 --- /dev/null +++ b/payment_environment/models/__init__.py @@ -0,0 +1 @@ +from . import payment_acquirer diff --git a/payment_environment/models/payment_acquirer.py b/payment_environment/models/payment_acquirer.py new file mode 100644 index 0000000..0709c5a --- /dev/null +++ b/payment_environment/models/payment_acquirer.py @@ -0,0 +1,23 @@ +# Copyright 2021 Camptocamp SA +# @author Iván Todorovich +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) + +from odoo import models + + +class PaymentAcquirer(models.Model): + _name = "payment.acquirer" + _inherit = [ + "payment.acquirer", + "server.env.techname.mixin", + "server.env.mixin", + ] + + @property + def _server_env_fields(self): + base_fields = super()._server_env_fields + acquirer_fields = { + "state": {}, + } + acquirer_fields.update(base_fields) + return acquirer_fields diff --git a/payment_environment/readme/CONFIGURE.rst b/payment_environment/readme/CONFIGURE.rst new file mode 100644 index 0000000..b103047 --- /dev/null +++ b/payment_environment/readme/CONFIGURE.rst @@ -0,0 +1,17 @@ +With this module installed, the payment acquirers are configured in +the `server_environment_files` module (which is a module you should provide, +see the documentation of `server_environment` for more information). + +In the configuration file of each environment, for each payment acquirer you +may use the section `[payment_acquirer.technical_name]` to configure the +acquirer values, where "technical_name" is the acquirer's `tech_name`. + +This module alone only lets you configure the `state` field, which allows to +set the acquirer's environment. Most payment acquirers will define specific +fields to store their credentials, so glue modules are required to include them +in `_server_env_fields` if that's what you want. + +Example of config file :: + + [payment_acquirer.paypal] + state = test diff --git a/payment_environment/readme/CONTRIBUTORS.rst b/payment_environment/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..902e23b --- /dev/null +++ b/payment_environment/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Camptocamp `_ + + * Iván Todorovich diff --git a/payment_environment/readme/DESCRIPTION.rst b/payment_environment/readme/DESCRIPTION.rst new file mode 100644 index 0000000..a95504e --- /dev/null +++ b/payment_environment/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows to configure payment acquirers using server_environment files. diff --git a/payment_environment/readme/INSTALL.rst b/payment_environment/readme/INSTALL.rst new file mode 100644 index 0000000..416f78f --- /dev/null +++ b/payment_environment/readme/INSTALL.rst @@ -0,0 +1,5 @@ +To install this module, you need to have the server_environment module +installed and properly configured. + +After installed, the environment configurable fields will be read from +the environment files. diff --git a/payment_environment/readme/ROADMAP.rst b/payment_environment/readme/ROADMAP.rst new file mode 100644 index 0000000..89b97ed --- /dev/null +++ b/payment_environment/readme/ROADMAP.rst @@ -0,0 +1 @@ +Due to the special nature of this addon, you cannot test it on the OCA runbot. diff --git a/payment_environment/readme/USAGE.rst b/payment_environment/readme/USAGE.rst new file mode 100644 index 0000000..87c3a7b --- /dev/null +++ b/payment_environment/readme/USAGE.rst @@ -0,0 +1,2 @@ +Once configured, Odoo will read the payment acquirer values from the +configuration file related to each environment defined in the main Odoo file. diff --git a/payment_environment/static/description/icon.png b/payment_environment/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/payment_environment/static/description/icon.png differ diff --git a/payment_environment/static/description/index.html b/payment_environment/static/description/index.html new file mode 100644 index 0000000..931832d --- /dev/null +++ b/payment_environment/static/description/index.html @@ -0,0 +1,462 @@ + + + + + + +Payment Acquirers' configuration with server_environment + + + +
+

Payment Acquirers’ configuration with server_environment

+ + +

Beta License: LGPL-3 OCA/server-env Translate me on Weblate Try me on Runbot

+

This module allows to configure payment acquirers using server_environment files.

+

Table of contents

+ +
+

Installation

+

To install this module, you need to have the server_environment module +installed and properly configured.

+

After installed, the environment configurable fields will be read from +the environment files.

+
+
+

Configuration

+

With this module installed, the payment acquirers are configured in +the server_environment_files module (which is a module you should provide, +see the documentation of server_environment for more information).

+

In the configuration file of each environment, for each payment acquirer you +may use the section [payment_acquirer.technical_name] to configure the +acquirer values, where “technical_name” is the acquirer’s tech_name.

+

This module alone only lets you configure the state field, which allows to +set the acquirer’s environment. Most payment acquirers will define specific +fields to store their credentials, so glue modules are required to include them +in _server_env_fields if that’s what you want.

+

Example of config file

+
+[payment_acquirer.paypal]
+state = test
+
+
+
+

Usage

+

Once configured, Odoo will read the payment acquirer values from the +configuration file related to each environment defined in the main Odoo file.

+
+
+

Known issues / Roadmap

+

Due to the special nature of this addon, you cannot test it on the OCA runbot.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

Current maintainer:

+

ivantodorovich

+

This module is part of the OCA/server-env project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/payment_environment/views/payment_acquirer.xml b/payment_environment/views/payment_acquirer.xml new file mode 100644 index 0000000..9883d86 --- /dev/null +++ b/payment_environment/views/payment_acquirer.xml @@ -0,0 +1,18 @@ + + + + + payment.acquirer + + + + + + + + +