diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000000..6e77cbed28 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-payment_sequra @ git+https://github.com/OCA/account-payment.git@refs/pull/901/head#subdirectory=payment_sequra diff --git a/website_sale_payment_sequra_simulator/README.rst b/website_sale_payment_sequra_simulator/README.rst new file mode 100644 index 0000000000..2c617f93f6 --- /dev/null +++ b/website_sale_payment_sequra_simulator/README.rst @@ -0,0 +1,87 @@ +===================================== +Website Payment Sale SeQura Simulator +===================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:4d2429fe3d2281c12bb0c6727248bfb252741518203b8fe19474a1eabdcece9c + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fe--commerce-lightgray.png?logo=github + :target: https://github.com/OCA/e-commerce/tree/18.0/website_sale_payment_sequra_simulator + :alt: OCA/e-commerce +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_payment_sequra_simulator + :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/e-commerce&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds support for SeQura payment simulator widget on product +pages, allowing customers to view available financing options. + +**Table of contents** + +.. contents:: + :local: + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Tecnativa + +Contributors +------------ + +- `Tecnativa `__: + + - Juan Carlos Oñate + +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-juancarlosonate-tecnativa| image:: https://github.com/juancarlosonate-tecnativa.png?size=40px + :target: https://github.com/juancarlosonate-tecnativa + :alt: juancarlosonate-tecnativa + +Current `maintainer `__: + +|maintainer-juancarlosonate-tecnativa| + +This module is part of the `OCA/e-commerce `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/website_sale_payment_sequra_simulator/__init__.py b/website_sale_payment_sequra_simulator/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/website_sale_payment_sequra_simulator/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/website_sale_payment_sequra_simulator/__manifest__.py b/website_sale_payment_sequra_simulator/__manifest__.py new file mode 100644 index 0000000000..bed8f84b14 --- /dev/null +++ b/website_sale_payment_sequra_simulator/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2025 Juan Carlos Oñate - Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Website Payment Sale SeQura Simulator", + "summary": "Adds SeQura payment simulator.", + "version": "18.0.1.0.0", + "category": "Accounting/Payment Providers", + "author": "Tecnativa, Odoo Community Association (OCA)", + "maintainers": ["juancarlosonate-tecnativa"], + "license": "AGPL-3", + "website": "https://github.com/OCA/e-commerce", + "depends": ["website_sale", "payment_sequra"], + "data": [ + "views/payment_provider_views.xml", + "views/templates.xml", + ], + "installable": True, +} diff --git a/website_sale_payment_sequra_simulator/models/__init__.py b/website_sale_payment_sequra_simulator/models/__init__.py new file mode 100644 index 0000000000..7070c03b00 --- /dev/null +++ b/website_sale_payment_sequra_simulator/models/__init__.py @@ -0,0 +1 @@ +from . import payment_provider diff --git a/website_sale_payment_sequra_simulator/models/payment_provider.py b/website_sale_payment_sequra_simulator/models/payment_provider.py new file mode 100644 index 0000000000..f54f819cb2 --- /dev/null +++ b/website_sale_payment_sequra_simulator/models/payment_provider.py @@ -0,0 +1,30 @@ +# Copyright 2025 Juan Carlos Oñate - Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + + +class PaymentProvider(models.Model): + _inherit = "payment.provider" + + sequra_asset_key = fields.Char( + string="SeQura Asset Key", + help="Asset Key provided by SeQura for the widget integration", + ) + sequra_script_uri = fields.Char( + string="SeQura Script URI", + compute="_compute_sequra_script_uri", + help="Script URI is automatically determined based on provider " + "state (test/production)", + ) + + @api.depends("state") + def _compute_sequra_script_uri(self): + for provider in self: + if provider.state == "test": + provider.sequra_script_uri = ( + "https://sandbox.sequracdn.com/assets/sequra-checkout.min.js" + ) + else: + provider.sequra_script_uri = ( + "https://live.sequracdn.com/assets/sequra-checkout.min.js" + ) diff --git a/website_sale_payment_sequra_simulator/pyproject.toml b/website_sale_payment_sequra_simulator/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/website_sale_payment_sequra_simulator/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/website_sale_payment_sequra_simulator/readme/CONTRIBUTORS.md b/website_sale_payment_sequra_simulator/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..a4415b28c3 --- /dev/null +++ b/website_sale_payment_sequra_simulator/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [Tecnativa](https://www.tecnativa.com): + - Juan Carlos Oñate diff --git a/website_sale_payment_sequra_simulator/readme/DESCRIPTION.md b/website_sale_payment_sequra_simulator/readme/DESCRIPTION.md new file mode 100644 index 0000000000..0c829eba99 --- /dev/null +++ b/website_sale_payment_sequra_simulator/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module adds support for SeQura payment simulator widget on product +pages, allowing customers to view available financing options. diff --git a/website_sale_payment_sequra_simulator/static/description/icon.png b/website_sale_payment_sequra_simulator/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/website_sale_payment_sequra_simulator/static/description/icon.png differ diff --git a/website_sale_payment_sequra_simulator/static/description/index.html b/website_sale_payment_sequra_simulator/static/description/index.html new file mode 100644 index 0000000000..02e91a7c15 --- /dev/null +++ b/website_sale_payment_sequra_simulator/static/description/index.html @@ -0,0 +1,429 @@ + + + + + +Website Payment Sale SeQura Simulator + + + +
+

Website Payment Sale SeQura Simulator

+ + +

Beta License: AGPL-3 OCA/e-commerce Translate me on Weblate Try me on Runboat

+

This module adds support for SeQura payment simulator widget on product +pages, allowing customers to view available financing options.

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

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:

+

juancarlosonate-tecnativa

+

This module is part of the OCA/e-commerce project on GitHub.

+

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

+
+
+
+ + diff --git a/website_sale_payment_sequra_simulator/views/payment_provider_views.xml b/website_sale_payment_sequra_simulator/views/payment_provider_views.xml new file mode 100644 index 0000000000..f08081e186 --- /dev/null +++ b/website_sale_payment_sequra_simulator/views/payment_provider_views.xml @@ -0,0 +1,20 @@ + + + + payment.provider.form.sequra + payment.provider + + + + + + + + + + + diff --git a/website_sale_payment_sequra_simulator/views/templates.xml b/website_sale_payment_sequra_simulator/views/templates.xml new file mode 100644 index 0000000000..db23e75ea6 --- /dev/null +++ b/website_sale_payment_sequra_simulator/views/templates.xml @@ -0,0 +1,86 @@ + + + + + + +