Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kasra Jamshidi
erp5
Commits
218b2a4d
Commit
218b2a4d
authored
12 years ago
by
Łukasz Nowak
Committed by
Alain Takoudjou
9 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Implement cancellation.
parent
55f2fd4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
bt5/erp5_payzen_secure_payment/DocumentTemplateItem/portal_components/document.erp5.PayzenService.py
...lateItem/portal_components/document.erp5.PayzenService.py
+54
-0
No files found.
bt5/erp5_payzen_secure_payment/DocumentTemplateItem/portal_components/document.erp5.PayzenService.py
View file @
218b2a4d
...
...
@@ -167,6 +167,60 @@ else:
return
[
data_kw
,
signature
,
last_sent
,
last_received
]
def
soap_cancel
(
self
,
transmissionDate
,
transactionId
,
comment
=
''
):
# prepare with passed parameters
kw
=
dict
(
transmissionDate
=
transmissionDate
,
transactionId
=
transactionId
,
comment
=
comment
)
signature_sorted_key_list
=
[
'shopId'
,
'transmissionDate'
,
'transactionId'
,
'sequenceNb'
,
'ctxMode'
,
'comment'
]
kw
.
update
(
ctxMode
=
self
.
getPayzenVadsCtxMode
(),
shopId
=
self
.
getServiceUsername
(),
sequenceNb
=
1
,
)
kw
[
'wsSignature'
]
=
self
.
_getSignature
(
kw
,
signature_sorted_key_list
)
# Note: Code shall not raise since now, as communication begin and caller
# will have to log sent/received messages.
client
=
suds
.
client
.
Client
(
self
.
wsdl_link
.
getUrlString
())
data
=
client
.
service
.
cancel
(
**
kw
)
# Note: Code shall not raise since now, as communication begin and caller
# will have to log sent/received messages.
try
:
data_kw
=
dict
(
data
)
for
k
in
data_kw
.
keys
():
v
=
data_kw
[
k
]
if
not
isinstance
(
v
,
str
):
data_kw
[
k
]
=
str
(
v
)
except
Exception
:
data_kw
=
{}
signature
=
False
LOG
(
'PayzenService'
,
WARNING
,
'Issue during processing data_kw:'
,
error
=
True
)
else
:
try
:
signature
=
self
.
_check_transactionInfoSignature
(
data
)
except
Exception
:
LOG
(
'PayzenService'
,
WARNING
,
'Issue during signature calculation:'
,
error
=
True
)
signature
=
False
try
:
last_sent
=
str
(
client
.
last_sent
())
except
Exception
:
LOG
(
'PayzenService'
,
WARNING
,
'Issue during converting last_sent to string:'
,
error
=
True
)
signature
=
False
try
:
last_received
=
str
(
client
.
last_received
())
except
Exception
:
LOG
(
'PayzenService'
,
WARNING
,
'Issue during converting last_received to string:'
,
error
=
True
)
signature
=
False
return
[
data_kw
,
signature
,
last_sent
,
last_received
]
class
PayzenService
(
XMLObject
,
PayzenSOAP
):
meta_type
=
'Payzen Service'
portal_type
=
'Payzen Service'
...
...
This diff is collapsed.
Click to expand it.
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