diff --git a/payment_cielo/README.rst b/payment_cielo/README.rst index ab23c6c83968..a1aada57e027 100644 --- a/payment_cielo/README.rst +++ b/payment_cielo/README.rst @@ -1,6 +1,6 @@ -============ -Payent Cielo -============ +============= +Payment Cielo +============= .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -17,13 +17,13 @@ Payent Cielo :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--brazil-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-brazil/tree/12.0/payment_cielo + :target: https://github.com/OCA/l10n-brazil/tree/14.0/payment_cielo :alt: OCA/l10n-brazil .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-brazil-12-0/l10n-brazil-12-0-payment_cielo + :target: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-payment_cielo :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-brazil&target_branch=12.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-brazil&target_branch=14.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -67,7 +67,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -112,6 +112,6 @@ Current `maintainer `__: |maintainer-DiegoParadeda| -This module is part of the `OCA/l10n-brazil `_ project on GitHub. +This module is part of the `OCA/l10n-brazil `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/payment_cielo/__manifest__.py b/payment_cielo/__manifest__.py index 8351740d68fe..6d44fe74f716 100644 --- a/payment_cielo/__manifest__.py +++ b/payment_cielo/__manifest__.py @@ -2,10 +2,10 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - "name": "Payent Cielo", + "name": "Payment Cielo", "summary": """ Payment Acquirer: Cielo Implementation""", - "version": "12.0.3.2.1", + "version": "14.0.1.0.0", "development_status": "Alpha", "license": "AGPL-3", "author": "KMEE INFORMATICA LTDA,Odoo Community Association (OCA)", diff --git a/payment_cielo/controllers/main.py b/payment_cielo/controllers/main.py index 63e06fb3ddcc..9845ae905e87 100644 --- a/payment_cielo/controllers/main.py +++ b/payment_cielo/controllers/main.py @@ -31,60 +31,6 @@ def cielo_s2s_create_json_3ds(self, verify_validity=False, **kwargs): .s2s_process(kwargs) ) - if not token: - res = { - "result": False, - } - return res - - res = { - "result": True, - "short_name": token.short_name, - "3d_secure": False, - "verified": False, - } - - return res - - @http.route(["/payment/cielo/s2s/create_json"], type="json", auth="public") - def cielo_s2s_create_json(self, **kwargs): - acquirer_id = int(kwargs.get("acquirer_id")) - acquirer = request.env["payment.acquirer"].browse(acquirer_id) - if not kwargs.get("partner_id"): - kwargs["partner_id"] = request.env.user.partner_id.id - return acquirer.s2s_process(kwargs).id - - @http.route(["/payment/cielo/s2s/create"], type="http", auth="public") - def cielo_s2s_create(self, **post): - acquirer_id = int(post.get("acquirer_id")) - acquirer = request.env["payment.acquirer"].browse(acquirer_id) - error = None - try: - acquirer.s2s_process(post) - except Exception as e: - error = str(e) - - return_url = post.get("return_url", "/") - if error: - separator = "?" if werkzeug.urls.url_parse(return_url).query == "" else "&" - return_url += "{}{}".format( - separator, werkzeug.urls.url_encode({"error": error}) - ) - - return werkzeug.utils.redirect(return_url) - - @http.route( - ["/payment/cielo/s2s/create_json_3ds"], type="json", auth="public", csrf=False - ) - def cielo_s2s_create_json_3ds(self, verify_validity=False, **kwargs): - if not kwargs.get("partner_id"): - kwargs["partner_id"] = request.env.user.partner_id.id - token = ( - request.env["payment.acquirer"] - .browse(int(kwargs.get("acquirer_id"))) - .s2s_process(kwargs) - ) - if not token: res = { "result": False, @@ -107,9 +53,8 @@ def cielo_s2s_create_json_3ds(self, verify_validity=False, **kwargs): @http.route(["/payment/cielo/create_charge"], type="json", auth="public") def cielo_create_charge(self, **post): - """Create a payment transaction - - Expects the result from the user input from checkout.js popup""" + """Create a payment transaction. + Expect the result from the user input from checkout.js popup.""" TX = request.env["payment.transaction"] tx = None if post.get("tx_ref"): @@ -153,7 +98,7 @@ def cielo_create_charge(self, **post): request.env["payment.transaction"].sudo().with_context( lang=None ).form_feedback(response, "cielo") - # add the payment transaction into the session to let the page - # /payment/process to handle it + # Add the payment transaction into the session to let the page + # /payment/process handle it. PaymentProcessing.add_payment_transaction(tx) return "/payment/process" diff --git a/payment_cielo/data/payment_acquirer_data.xml b/payment_cielo/data/payment_acquirer_data.xml index 86262baa13d1..6c98f42e6b20 100644 --- a/payment_cielo/data/payment_acquirer_data.xml +++ b/payment_cielo/data/payment_acquirer_data.xml @@ -4,7 +4,7 @@ Cielo @@ -13,7 +13,7 @@ - test + test -Payent Cielo +Payment Cielo -
-

Payent Cielo

+
+

Payment Cielo

-

Alpha License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runboat

+

Alpha License: AGPL-3 OCA/l10n-brazil Translate me on Weblate Try me on Runboat

Payment Acquirer: Cielo Implementation

Important

@@ -414,7 +414,7 @@

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.

+feedback.

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

@@ -439,13 +439,15 @@

Other credits

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +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:

DiegoParadeda

-

This module is part of the OCA/l10n-brazil project on GitHub.

+

This module is part of the OCA/l10n-brazil project on GitHub.

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

diff --git a/payment_cielo/tests/test_cielo.py b/payment_cielo/tests/test_cielo.py index 928bdfd80a05..b97422c8096a 100644 --- a/payment_cielo/tests/test_cielo.py +++ b/payment_cielo/tests/test_cielo.py @@ -34,9 +34,7 @@ class CieloTest(CieloCommon): filter_post_data_parameters=["MerchantOrderId", "SoftDescriptor"], ) def test_10_cielo_s2s(self): - self.assertEqual( - self.cielo.environment, "test", "test without test environment" - ) + self.assertEqual(self.cielo.state, "test", "test without test state") # Add Cielo credentials self.cielo.write( @@ -88,9 +86,7 @@ def test_10_cielo_s2s(self): def test_20_cielo_s2s(self): # Test invalid card - self.assertEqual( - self.cielo.environment, "test", "test without test environment" - ) + self.assertEqual(self.cielo.state, "test", "test without test state") # Add Cielo credentials self.cielo.write( @@ -100,7 +96,7 @@ def test_20_cielo_s2s(self): } ) - # Create payment meethod for Cielo + # Create payment method for Cielo try: payment_token = self.env["payment.token"].create( {