Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
02ef12ac
Commit
02ef12ac
authored
Oct 11, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check incoming data signature.
parent
2a85fcdf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
5 deletions
+35
-5
bt5/erp5_payzen_secure_payment/DocumentTemplateItem/PayzenService.py
...yzen_secure_payment/DocumentTemplateItem/PayzenService.py
+34
-4
bt5/erp5_payzen_secure_payment/bt/revision
bt5/erp5_payzen_secure_payment/bt/revision
+1
-1
No files found.
bt5/erp5_payzen_secure_payment/DocumentTemplateItem/PayzenService.py
View file @
02ef12ac
...
...
@@ -17,11 +17,40 @@ else:
Methods are returning list of:
* parsed response
* signature check (True or False)
* sent XML
* received XML
SOAP protocol is assumed as untrusted and dangerous, users of those methods
are encouraged to log such messages for future debugging."""
def
_check_transcationInfoSignature
(
self
,
data
):
received_sorted_keys
=
[
'errorCode'
,
'extendedErrorCode'
,
'transactionStatus'
,
'shopId'
,
'paymentMethod'
,
'contractNumber'
,
'orderId'
,
'orderInfo'
,
'orderInfo2'
,
'orderInfo3'
,
'transmissionDate'
,
'transactionId'
,
'sequenceNb'
,
'amount'
,
'initialAmount'
,
'devise'
,
'cvAmount'
,
'cvDevise'
,
'presentationDate'
,
'type'
,
'multiplePaiement'
,
'ctxMode'
,
'cardNumber'
,
'cardNetwork'
,
'cardType'
,
'cardCountry'
,
'cardExpirationDate'
,
'customerId'
,
'customerTitle'
,
'customerName'
,
'customerPhone'
,
'customerMail'
,
'customerAddress'
,
'customerZipCode'
,
'customerCity'
,
'customerCountry'
,
'customerLanguage'
,
'customerIP'
,
'transactionCondition'
,
'vadsEnrolled'
,
'vadsStatus'
,
'vadsECI'
,
'vafdsXID'
,
'vadsCAVVAlgorithm'
,
'vadsCAVV'
,
'vadsSignatureValid'
,
'directoryServer'
,
'authMode'
,
'markAmount'
,
'markDevise'
,
'markDate'
,
'markNb'
,
'markResult'
,
'markCVV2_CVC2'
,
'authAmount'
,
'authDevise'
,
'authDate'
,
'authNb'
,
'authResult'
,
'authCVV2_CVC2'
,
'warrantlyResult'
,
'captureDate'
,
'captureNumber'
,
'rapprochementStatut'
,
'refoundAmount'
,
'refundDevise'
,
'timestamp'
]
signature
=
''
for
k
in
received_sorted_keys
:
v
=
getattr
(
data
,
k
,
None
)
if
v
is
not
None
:
signature
+=
str
(
v
)
+
'+'
else
:
signature
+=
'+'
signature
+=
self
.
getServicePassword
()
signature
=
hashlib
.
sha1
(
signature
).
hexdigest
()
return
signature
==
data
.
signature
def
soap_getInfo
(
self
,
transmissionDate
,
transactionId
):
"""Returns getInfo
...
...
@@ -49,7 +78,8 @@ else:
signature
+=
self
.
getServicePassword
()
kw
[
'wsSignature'
]
=
hashlib
.
sha1
(
signature
).
hexdigest
()
data
=
client
.
service
.
getInfo
(
**
kw
)
return
[
data
,
str
(
client
.
last_sent
()),
str
(
client
.
last_received
())]
return
[
data
,
self
.
_check_transcationInfoSignature
(
data
),
str
(
client
.
last_sent
()),
str
(
client
.
last_received
())]
class
PayzenService
(
XMLObject
,
PayzenSOAP
):
meta_type
=
'Payzen Service'
...
...
bt5/erp5_payzen_secure_payment/bt/revision
View file @
02ef12ac
24
\ No newline at end of file
25
\ No newline at end of file
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