Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
15502925
Commit
15502925
authored
Apr 21, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wechat_secure_payment: pylint on py3
parent
f92b71c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
bt5/erp5_wechat_secure_payment/DocumentTemplateItem/portal_components/document.erp5.WechatService.py
...lateItem/portal_components/document.erp5.WechatService.py
+5
-9
No files found.
bt5/erp5_wechat_secure_payment/DocumentTemplateItem/portal_components/document.erp5.WechatService.py
View file @
15502925
...
@@ -7,10 +7,7 @@ import random, string, hashlib, socket
...
@@ -7,10 +7,7 @@ import random, string, hashlib, socket
from
six.moves.urllib.request
import
Request
,
urlopen
from
six.moves.urllib.request
import
Request
,
urlopen
from
six.moves.urllib.parse
import
urlparse
from
six.moves.urllib.parse
import
urlparse
from
six
import
string_types
as
basestring
from
six
import
string_types
as
basestring
try
:
import
xml.etree.ElementTree
as
ET
import
xml.etree.cElementTree
as
ET
except
ImportError
:
import
xml.etree.ElementTree
as
ET
class
WechatException
(
Exception
):
class
WechatException
(
Exception
):
...
@@ -114,8 +111,8 @@ class WechatService(XMLObject):
...
@@ -114,8 +111,8 @@ class WechatService(XMLObject):
if
result_msg
==
"ok"
:
if
result_msg
==
"ok"
:
sandbox_signkey
=
result_dict_content
[
'sandbox_signkey'
]
sandbox_signkey
=
result_dict_content
[
'sandbox_signkey'
]
return
sandbox_signkey
return
sandbox_signkey
raise
Exception
(
result_dict_content
[
'result_msg'
].
encode
(
'utf-8'
))
raise
Wechat
Exception
(
result_dict_content
[
'result_msg'
].
encode
(
'utf-8'
))
raise
Exception
(
"Get sanbox key failed: "
+
str
(
result_dict_content
))
raise
Wechat
Exception
(
"Get sanbox key failed: "
+
str
(
result_dict_content
))
def
callWechatApi
(
self
,
URL
,
wechat_dict
):
def
callWechatApi
(
self
,
URL
,
wechat_dict
):
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
...
@@ -160,7 +157,7 @@ class WechatService(XMLObject):
...
@@ -160,7 +157,7 @@ class WechatService(XMLObject):
if
return_code
==
"SUCCESS"
:
if
return_code
==
"SUCCESS"
:
return
result_dict_content
return
result_dict_content
else
:
else
:
raise
Exception
(
u"ERROR could not communicate with Wechat (return_code {}: {})"
.
format
(
return_code
,
result_dict_content
.
get
(
"return_msg"
)))
raise
Wechat
Exception
(
u"ERROR could not communicate with Wechat (return_code {}: {})"
.
format
(
return_code
,
result_dict_content
.
get
(
"return_msg"
)))
def
getWechatPaymentURL
(
self
,
wechat_dict
):
def
getWechatPaymentURL
(
self
,
wechat_dict
):
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
...
@@ -173,7 +170,7 @@ class WechatService(XMLObject):
...
@@ -173,7 +170,7 @@ class WechatService(XMLObject):
if
result_code
==
"SUCCESS"
:
if
result_code
==
"SUCCESS"
:
return
wechat_answer
[
'code_url'
]
return
wechat_answer
[
'code_url'
]
else
:
else
:
raise
Exception
(
u"ERROR Wechat notified a problem (result_code {}: {})"
.
format
(
result_code
,
wechat_answer
.
get
(
"err_code_des"
)))
raise
Wechat
Exception
(
u"ERROR Wechat notified a problem (result_code {}: {})"
.
format
(
result_code
,
wechat_answer
.
get
(
"err_code_des"
)))
def
queryWechatOrderStatus
(
self
,
wechat_dict
):
def
queryWechatOrderStatus
(
self
,
wechat_dict
):
'''
'''
...
@@ -247,7 +244,6 @@ class WechatService(XMLObject):
...
@@ -247,7 +244,6 @@ class WechatService(XMLObject):
def
initialize
(
self
,
REQUEST
=
None
,
**
kw
):
def
initialize
(
self
,
REQUEST
=
None
,
**
kw
):
"""See Payment Service Interface Documentation"""
"""See Payment Service Interface Documentation"""
pass
def
navigate
(
self
,
wechat_dict
,
REQUEST
=
None
,
**
kw
):
def
navigate
(
self
,
wechat_dict
,
REQUEST
=
None
,
**
kw
):
"""Returns a redirection to the payment page"""
"""Returns a redirection to the payment page"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment