Skip to content

Commit e2c9b02

Browse files
author
Ivan Yelizariev
committed
💣
1 parent 86bf188 commit e2c9b02

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

wechat/doc/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ Configuration
3030

3131
* ``wechat.app_id``
3232
* ``wechat.app_secret``
33-
* ``wechat.vendor_id``
34-
* ``wechat.sandbox`` -- set to ``0`` to disable and any other value to
35-
activate. It's disabled by default.
33+
* ``wechat.mch_id`` -- *Vendor ID*
34+
* ``wechat.sub_mch_id`` -- *Sub Vendor ID*
35+
* ``wechat.sandbox`` -- set to ``0`` or delete to disable. Any other value to means that sandbox is activated.

wechat/models/ir_config_parameter.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@ def get_wechat_pay_object(self):
1818
if sandbox:
1919
_logger.info('Sandbox Mode is used for WeChat API')
2020

21+
print ('ARGS', (
22+
self.get_param('wechat.app_id'),
23+
self.get_param('wechat.app_secret'),
24+
self.get_param('wechat.mch_id'),
25+
sandbox,
26+
self.get_param('wechat.sub_mch_id'),
27+
# TODO rest args
28+
# self.sub_mch_id = sub_mch_id
29+
# self.mch_cert = mch_cert
30+
# self.mch_key = mch_key
31+
# self.timeout = timeout
32+
))
2133
return WeChatPay(
2234
self.get_param('wechat.app_id'),
2335
self.get_param('wechat.app_secret'),
24-
self.get_param('wechat.vendor_id'),
36+
self.get_param('wechat.mch_id'),
2537
sandbox=sandbox,
26-
sub_mch_id=self.get_param('wechat.vendor_id'), # TODO make separate param. Keep this only for testing
38+
sub_mch_id=self.get_param('wechat.sub_mch_id'),
2739
# TODO rest args
2840
# self.sub_mch_id = sub_mch_id
2941
# self.mch_cert = mch_cert

wechat/models/wechat_order.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def create_qr(self, lines, total_fee, create_vals=None, **kwargs):
114114
"""
115115
debug = self.env['ir.config_parameter'].get_param('wechat.local_sandbox') == '1'
116116
vals = {
117+
'trade_type': 'NATIVE',
117118
'line_ids': [(0, 0, data) for data in lines],
118119
'debug': debug,
119120
}
@@ -145,7 +146,7 @@ def create_qr(self, lines, total_fee, create_vals=None, **kwargs):
145146
total_fee,
146147
body,
147148
total_fee,
148-
self._notify_url,
149+
self._notify_url(),
149150
out_trade_no=order.id,
150151
# TODO fee_type=record.currency_id.name
151152
)

0 commit comments

Comments
 (0)