Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

11.0 qr payments #1109

Closed

Conversation

KolushovAlexandr
Copy link
Contributor

No description provided.

qr_payments/tools/async.py Outdated Show resolved Hide resolved
data['body'] = message['data']['order_short']

data['out_trade_no'] = (str(time.time()).replace('.', '') \
+ '{0:010}'.format(random.randint(1, 9999999999)) \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line under-indented for visual indent
the backslash is redundant between brackets

data['mch_id'] = request.env['ir.config_parameter'].get_param('wechat.mchId')
data['body'] = message['data']['order_short']

data['out_trade_no'] = (str(time.time()).replace('.', '') \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the backslash is redundant between brackets

import logging
import requests
import odoo
import json
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'json' imported but unused

Copy link
Contributor

@itpp-bot itpp-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 installable modules are updated:

├─ payment_wechat/
|  ├─ README.rst
|  ├─ __init__.py
|  ├─ __manifest__.py
|  ├─ controllers/
|  |  ├─ __init__.py
|  |  └─ p_w_controllers.py
|  ├─ demo/
|  |  └─ w_p_demo.xml
|  ├─ doc/
|  |  ├─ changelog.rst
|  |  └─ index.rst
|  ├─ models/
|  |  ├─ __init__.py
|  |  └─ wechat_models.py
|  ├─ static/
|  |  └─ description/
|  |     └─ icon.png
|  └─ views/
|     └─ views.xml
├─ pos_payment/
|  ├─ README.rst
|  ├─ __init__.py
|  ├─ __manifest__.py
|  ├─ doc/
|  |  ├─ changelog.rst
|  |  └─ index.rst
|  └─ static/
|     └─ description/
|        └─ icon.png
├─ pos_qr_scan/
|  ├─ README.rst
|  ├─ __init__.py
|  ├─ __manifest__.py
|  ├─ doc/
|  |  ├─ changelog.rst
|  |  └─ index.rst
|  ├─ static/
|  |  ├─ lib/
|  |  |  └─ jsqrcode/
|  |  |     ├─ COPYING
|  |  |     ├─ README
|  |  |     ├─ alignpat.js
|  |  |     ├─ bitmat.js
|  |  |     ├─ bmparser.js
|  |  |     ├─ datablock.js
|  |  |     ├─ databr.js
|  |  |     ├─ datamask.js
|  |  |     ├─ decoder.js
|  |  |     ├─ detector.js
|  |  |     ├─ errorlevel.js
|  |  |     ├─ findpat.js
|  |  |     ├─ formatinf.js
|  |  |     ├─ gf256.js
|  |  |     ├─ gf256poly.js
|  |  |     ├─ grid.js
|  |  |     ├─ qrcode.js
|  |  |     ├─ rsdecoder.js
|  |  |     └─ version.js
|  |  └─ src/
|  |     ├─ css/
|  |     |  └─ pos.css
|  |     ├─ description/
|  |     |  └─ icon.png
|  |     ├─ js/
|  |     |  └─ qr_scan.js
|  |     └─ xml/
|  |        └─ templates.xml
|  └─ views/
|     └─ assets.xml
├─ pos_wechat/
|  ├─ README.rst
|  ├─ __init__.py
|  ├─ __manifest__.py
|  ├─ data/
|  |  └─ account_journal_data.xml
|  ├─ doc/
|  |  ├─ changelog.rst
|  |  └─ index.rst
|  ├─ models/
|  |  ├─ __init__.py
|  |  ├─ account_journal.py
|  |  └─ wechat_micropay.py
|  ├─ static/
|  |  ├─ description/
|  |  |  └─ icon.png
|  |  └─ src/
|  |     └─ js/
|  |        ├─ tour.js
|  |        └─ wechat_pay.js
|  ├─ tests/
|  |  ├─ __init__.py
|  |  └─ test_micropay.py
|  └─ views/
|     └─ assets.xml
└─ wechat/
   ├─ README.rst
   ├─ __init__.py
   ├─ __manifest__.py
   ├─ controllers/
   |  ├─ __init__.py
   |  └─ wechat_controllers.py
   ├─ doc/
   |  ├─ changelog.rst
   |  └─ index.rst
   ├─ models/
   |  ├─ __init__.py
   |  ├─ ir_config_parameter.py
   |  ├─ wechat_micropay.py
   |  └─ wechat_order.py
   ├─ tests/
   |  ├─ __init__.py
   |  └─ test_wechat_order.py
   ├─ tools/
   |  ├─ __init__.py
   |  └─ async.py
   └─ views/
      └─ wechat_micropay_views.xml

Not installable modules remain unchanged.

sent by ✌️ Odoo Review Bot

`1.0.0`
-------

- Init version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

`1.0.0`
-------

- Init version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

`1.0.0`
-------

- Init version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

`1.0.0`
-------

- Init version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

`1.0.0`
-------

- Init version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

try:
# python 3
return method.__self__
except:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use bare 'except'

import threading


from odoo import api, tools
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'odoo.tools' imported but unused

]


def _patch_post(self, post_result):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too many blank lines (2)

'result_code': 'SUCCESS',
'openid': '123',
'total_fee': total_fee,
'order_ref': order_ref,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'order_ref'

# Try to compute url automatically
try:
scheme = request.httprequest.scheme
except:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not use bare 'except'


from odoo.tests.common import HttpCase, HOST, PORT, get_db_name
from odoo import api, SUPERUSER_ID
from odoo.addons.bus.models.bus import dispatch
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'odoo.addons.bus.models.bus.dispatch' imported but unused

# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import logging
import json
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'json' imported but unused

'terminal_ref': terminal_ref,
'pos_id': pos_id,
},
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

// TODO: do we need to extend init_from_JSON too ?
export_as_JSON: function(){
var res = PaymentlineSuper.prototype.export_as_JSON.apply(this, arguments);
res['micropay_id'] = this.micropay_id;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

['micropay_id'] is better written in dot notation.

micropay_id: msg['micropay_id'],
cashregister: this.wechat_cashregister,
pos: this});
newPaymentline.set_amount( msg['total_fee'] / 100.0 );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

['total_fee'] is better written in dot notation.

@KolushovAlexandr
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants