-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
11.0 qr payments #1109
Conversation
i.e. use wechat as dependency, without pos_payment. pos_payment_wechat will work only with invoices
data['body'] = message['data']['order_short'] | ||
|
||
data['out_trade_no'] = (str(time.time()).replace('.', '') \ | ||
+ '{0:010}'.format(random.randint(1, 9999999999)) \ |
There was a problem hiding this comment.
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('.', '') \ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'json' imported but unused
cb24c13
to
26e8a69
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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, | ||
}, | ||
}) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 ); |
There was a problem hiding this comment.
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.
superseded by https://github.com/it-projects-llc/pos-addons/pull/1181 |
No description provided.