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
141
Merge Requests
141
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
40b10a34
Commit
40b10a34
authored
Feb 14, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
payzen_secure_payment: python3 support
parent
4c4e26bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
bt5/erp5_payzen_secure_payment/DocumentTemplateItem/portal_components/document.erp5.PayzenService.py
...lateItem/portal_components/document.erp5.PayzenService.py
+1
-1
bt5/erp5_payzen_secure_payment/TestTemplateItem/portal_components/test.erp5.testERP5PayzenSecurePayment.py
...ortal_components/test.erp5.testERP5PayzenSecurePayment.py
+6
-6
No files found.
bt5/erp5_payzen_secure_payment/DocumentTemplateItem/portal_components/document.erp5.PayzenService.py
View file @
40b10a34
...
...
@@ -141,7 +141,7 @@ class PayzenService(XMLObject, PayzenREST):
v
=
str
(
v
)
signature
+=
v
+
'+'
signature
+=
self
.
getServicePassword
()
return
hashlib
.
sha1
(
signature
).
hexdigest
()
return
hashlib
.
sha1
(
signature
.
encode
(
'utf-8'
)
).
hexdigest
()
def
_getFieldList
(
self
,
payzen_dict
):
payzen_dict
.
update
(
...
...
bt5/erp5_payzen_secure_payment/TestTemplateItem/portal_components/test.erp5.testERP5PayzenSecurePayment.py
View file @
40b10a34
...
...
@@ -112,19 +112,19 @@ class TestERP5PayzenSecurePayment(TestERP5PayzenSecurePaymentMixin):
def
test_getSignature_dict_simple
(
self
):
self
.
assertEqual
(
self
.
service
.
_getSignature
({
'key'
:
'value'
},
[
'key'
]),
sha1
(
'value+'
+
self
.
service_password
)
sha1
(
(
'value+'
+
self
.
service_password
).
encode
()
)
)
def
test_getSignature_dict_key_sort
(
self
):
self
.
assertEqual
(
self
.
service
.
_getSignature
({
'key'
:
'value'
,
'key1'
:
'value1'
},
[
'key'
,
'key1'
]),
sha1
(
'value+value1+'
+
self
.
service_password
)
sha1
(
(
'value+value1+'
+
self
.
service_password
).
encode
()
)
)
self
.
assertEqual
(
self
.
service
.
_getSignature
({
'key'
:
'value'
,
'key1'
:
'value1'
},
[
'key1'
,
'key'
]),
sha1
(
'value1+value+'
+
self
.
service_password
)
sha1
(
(
'value1+value+'
+
self
.
service_password
).
encode
()
)
)
def
test_getSignature_dict_date_as_datetime
(
self
):
...
...
@@ -132,7 +132,7 @@ class TestERP5PayzenSecurePayment(TestERP5PayzenSecurePaymentMixin):
d
=
{
'key'
:
now
}
self
.
assertEqual
(
self
.
service
.
_getSignature
(
d
,
[
'key'
]),
sha1
(
now
.
strftime
(
'%Y%m%d'
)
+
'+'
+
self
.
service_password
)
sha1
(
(
now
.
strftime
(
'%Y%m%d'
)
+
'+'
+
self
.
service_password
).
encode
()
)
)
# dict was updated
self
.
assertEqual
(
d
[
'key'
],
now
)
...
...
@@ -154,8 +154,8 @@ class TestERP5PayzenSecurePayment(TestERP5PayzenSecurePaymentMixin):
self
.
portal
.
changeSkin
(
None
)
try
:
result
=
self
.
service
.
navigate
(
pt_id
,
{
"key"
:
'value'
})
signature
=
sha1
(
'value+INTERACTIVE+ERP5+TEST+REGISTER+SINGLE+0123456+V2+'
+
self
.
service_password
)
signature
=
sha1
(
(
'value+INTERACTIVE+ERP5+TEST+REGISTER+SINGLE+0123456+V2+'
+
self
.
service_password
)
.
encode
())
self
.
assertEqual
(
result
,
"""key=key value=value
key=signature value=%s
key=vads_action_mode value=INTERACTIVE
...
...
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