Skip to content

Commit

Permalink
[REF] Add license, improve readme and remove unnecessary functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiano-one authored and marcelsavegnago committed Jun 20, 2022
1 parent c52cec7 commit 58b634a
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 97 deletions.
15 changes: 10 additions & 5 deletions payment_pagseguro/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ Payment Acquirer: PagSeguro Implementation
Installation
============

This module depends on:

* payment
This module depends on * payment and web_tour such to function correctly.

Configuration
=============
Expand All @@ -46,13 +44,20 @@ This module will require registering in eCommerce PagSeguro https://acesso.pagse

To configure your API keys go to Invoicing -> Configuration -> Payment Acquirers -> PagSeguro.

The credentials Token and PublicKey and can only be acquired by contacting PagSeguro via e-mail.

The credential Token and can only be acquired via the PagSeguro user account.
On your account, go to "Venda Online" > "Integrações". Then, click on "Gerar Token".

* full manual for API:

https://dev.pagseguro.uol.com.br/reference/pagseguro-reference-intro

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

This module will require registering in eCommerce PagSeguro https://acesso.pagseguro.uol.com.br/

To configure your API keys go to Invoicing -> Configuration -> Payment Acquirers -> PagSeguro.

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

Expand Down
3 changes: 3 additions & 0 deletions payment_pagseguro/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2020 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import controllers

Expand Down
2 changes: 1 addition & 1 deletion payment_pagseguro/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"summary": """Payment Acquirer: PagSeguro Implementation""",
"version": "12.0.1.0.0",
"license": "AGPL-3",
"author": "KMEE,Odoo Community Association (OCA)",
"author": "KMEE, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-brazil",
"depends": [
"payment",
Expand Down
3 changes: 3 additions & 0 deletions payment_pagseguro/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Copyright 2020 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import main
3 changes: 3 additions & 0 deletions payment_pagseguro/controllers/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2020 KMEE INFORMATICA LTDA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import requests
import werkzeug

Expand Down
8 changes: 5 additions & 3 deletions payment_pagseguro/data/payment_acquirer_data.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--Copyright 2020 KMEE-->
<!--License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).-->
<odoo>
<data noupdate="0">
<record id="payment_acquirer_pagseguro" model="payment.acquirer">
Expand All @@ -9,9 +11,9 @@
file="payment_pagseguro/static/src/img/pag_seguro_icon.jpg"
/>
<field name="provider">pagseguro</field>
<field name="company_id" ref="base.main_company" />
<field name="view_template_id" ref="pagseguro_form" />
<field name="registration_view_template_id" ref="pagseguro_s2s_form" />
<field name="company_id" ref="base.main_company"/>
<field name="view_template_id" ref="pagseguro_form"/>
<field name="registration_view_template_id" ref="pagseguro_s2s_form"/>
<field name="environment">test</field>
<field name="save_token">none</field>
<field name="payment_flow">s2s</field>
Expand Down
3 changes: 3 additions & 0 deletions payment_pagseguro/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2020 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import payment_acquirer
from . import payment_token
from . import payment_transaction
26 changes: 0 additions & 26 deletions payment_pagseguro/models/payment_acquirer.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Copyright 2020 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import requests

from odoo import api, fields, models
from odoo.http import request


class PaymentAcquirerPagseguro(models.Model):
Expand All @@ -17,30 +15,6 @@ class PaymentAcquirerPagseguro(models.Model):
groups="base.group_user",
)

def _get_pagseguro_environment(self):
return (
request.env["payment.acquirer"]
.search([("provider", "=", "pagseguro")])
.environment
)

@api.multi
def _get_pagseguro_api_public_key(self):
"""Get pagseguro API public key to tokenize card information"""
api_url_public_keys = "https://%s/public-keys/" % (
self._get_pagseguro_api_url()
)

r = requests.post(
api_url_public_keys,
headers=self._get_pagseguro_api_headers(),
json={"type": "card"},
)
res = r.json()
public_key = res.get("public_key")

return public_key

@api.multi
def pagseguro_s2s_form_validate(self, data):
"""Validates user input"""
Expand Down
4 changes: 1 addition & 3 deletions payment_pagseguro/readme/INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
This module depends on:

* payment
This module depends on * payment and web_tour such to function correctly.
3 changes: 3 additions & 0 deletions payment_pagseguro/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module will require registering in eCommerce PagSeguro https://acesso.pagseguro.uol.com.br/

To configure your API keys go to Invoicing -> Configuration -> Payment Acquirers -> PagSeguro.
38 changes: 21 additions & 17 deletions payment_pagseguro/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,64 +374,68 @@ <h1 class="title">Payment PagSeguro</h1>
<ul class="simple">
<li><a class="reference internal" href="#installation" id="id1">Installation</a></li>
<li><a class="reference internal" href="#configuration" id="id2">Configuration</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
<li><a class="reference internal" href="#other-credits" id="id7">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="id3">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li>
<li><a class="reference internal" href="#other-credits" id="id8">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="id9">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#id1">Installation</a></h1>
<p>This module depends on:</p>
<ul class="simple">
<li>payment</li>
</ul>
<p>This module depends on * payment and web_tour such to function correctly.</p>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id2">Configuration</a></h1>
<p>This module will require registering in eCommerce PagSeguro <a class="reference external" href="https://acesso.pagseguro.uol.com.br/">https://acesso.pagseguro.uol.com.br/</a></p>
<p>To configure your API keys go to Invoicing -&gt; Configuration -&gt; Payment Acquirers -&gt; PagSeguro.</p>
<p>The credentials Token and PublicKey and can only be acquired by contacting PagSeguro via e-mail.</p>
<p>The credential Token and can only be acquired via the PagSeguro user account.
On your account, go to “Venda Online” &gt; “Integrações”. Then, click on “Gerar Token”.</p>
<ul class="simple">
<li>full manual for API:</li>
</ul>
<p><a class="reference external" href="https://dev.pagseguro.uol.com.br/reference/pagseguro-reference-intro">https://dev.pagseguro.uol.com.br/reference/pagseguro-reference-intro</a></p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#id3">Known issues / Roadmap</a></h1>
<p>This module will require registering in eCommerce PagSeguro <a class="reference external" href="https://acesso.pagseguro.uol.com.br/">https://acesso.pagseguro.uol.com.br/</a></p>
<p>To configure your API keys go to Invoicing -&gt; Configuration -&gt; Payment Acquirers -&gt; PagSeguro.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#id4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-brazil/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/l10n-brazil/issues/new?body=module:%20payment_pagseguro%0Aversion:%20feature/pag_seguro%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
<h1><a class="toc-backref" href="#id5">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
<h2><a class="toc-backref" href="#id6">Authors</a></h2>
<ul class="simple">
<li>KMEE</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<h2><a class="toc-backref" href="#id7">Contributors</a></h2>
<ul class="simple">
<li>Luis Felipe Miléo &lt;<a class="reference external" href="mailto:mileo&#64;kmee.com.br">mileo&#64;kmee.com.br</a>&gt;</li>
<li>Cristiano Rodrigues &lt;<a class="reference external" href="mailto:cristiano.rodrigues&#64;kmee.com.br">cristiano.rodrigues&#64;kmee.com.br</a>&gt;</li>
<li>Kilian Macedo &lt;<a class="reference external" href="mailto:kilian.macedo&#64;kmee.com.br">kilian.macedo&#64;kmee.com.br</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#id7">Other credits</a></h2>
<h2><a class="toc-backref" href="#id8">Other credits</a></h2>
<p>The development of this module has been supported by:</p>
<p><a class="reference external" href="https:/www.kmee.com.br">KMEE INFORMATICA LTDA</a></p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
<h2><a class="toc-backref" href="#id9">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
Expand Down
7 changes: 5 additions & 2 deletions payment_pagseguro/static/src/js/pagseguro_tokenize_card.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020 KMEE
// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

/* global PagSeguro*/
/* eslint no-undef: "error"*/
odoo.define("payment_pagseguro.pagseguro_tokenize_card", function (require) {
Expand Down Expand Up @@ -73,7 +76,7 @@ odoo.define("payment_pagseguro.pagseguro_tokenize_card", function (require) {
"cc_cvc": '',
"data_set": ds.dataset.createRoute
});

return rpc.query({
route: formData.data_set,
params: formData,
Expand Down Expand Up @@ -108,7 +111,7 @@ odoo.define("payment_pagseguro.pagseguro_tokenize_card", function (require) {

/**
* @override
*
*
* This function is triggered when you click on the "pay now" button.
*/
payEvent: function (ev) {
Expand Down
3 changes: 3 additions & 0 deletions payment_pagseguro/static/src/js/pagseguro_tour.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2020 KMEE
// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

odoo.define("payment_pagseguro.tour", function (require){
"use strict";

Expand Down
3 changes: 3 additions & 0 deletions payment_pagseguro/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Copyright 2020 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import test_pagseguro
9 changes: 5 additions & 4 deletions payment_pagseguro/views/payment_acquirer.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2020 KMEE
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<!-- Copyright 2020 KMEE -->
<!-- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>

<data noupdate="1">

<record model="ir.ui.view" id="payment_acquirer_form_view" >
<field name="name">payment.acquirer.form (in payment_pagseguro)</field>
<field name="model">payment.acquirer</field>
Expand All @@ -17,7 +18,7 @@
</xpath>
</field>
</record>

</data>

</odoo>
Loading

0 comments on commit 58b634a

Please sign in to comment.