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
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ekaterina
erp5
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
Hide 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
...
@@ -14,17 +14,46 @@ else:
...
@@ -14,17 +14,46 @@ else:
import
time
import
time
class
PayzenSOAP
:
class
PayzenSOAP
:
"""SOAP communication
"""SOAP communication
Methods are returning list of:
Methods are returning list of:
* parsed response
* parsed response
* signature check (True or False)
* sent XML
* sent XML
* received XML
* received XML
SOAP protocol is assumed as untrusted and dangerous, users of those methods
SOAP protocol is assumed as untrusted and dangerous, users of those methods
are encouraged to log such messages for future debugging."""
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
):
def
soap_getInfo
(
self
,
transmissionDate
,
transactionId
):
"""Returns getInfo
"""Returns getInfo
transmissionDate is "raw" date in format YYYYMMDD, without any marks
transmissionDate is "raw" date in format YYYYMMDD, without any marks
transactionId is id of transaction for this date"""
transactionId is id of transaction for this date"""
client
=
suds
.
client
.
Client
(
self
.
wsdl_link
.
getUrlString
())
client
=
suds
.
client
.
Client
(
self
.
wsdl_link
.
getUrlString
())
...
@@ -49,7 +78,8 @@ else:
...
@@ -49,7 +78,8 @@ else:
signature
+=
self
.
getServicePassword
()
signature
+=
self
.
getServicePassword
()
kw
[
'wsSignature'
]
=
hashlib
.
sha1
(
signature
).
hexdigest
()
kw
[
'wsSignature'
]
=
hashlib
.
sha1
(
signature
).
hexdigest
()
data
=
client
.
service
.
getInfo
(
**
kw
)
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
):
class
PayzenService
(
XMLObject
,
PayzenSOAP
):
meta_type
=
'Payzen Service'
meta_type
=
'Payzen Service'
...
...
bt5/erp5_payzen_secure_payment/bt/revision
View file @
02ef12ac
24
25
\ No newline at end of file
\ 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