Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Gabriel Monnerat
slapos.core
Commits
fefb8caa
Commit
fefb8caa
authored
May 13, 2013
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle refused payzen payment.
parent
3de0ab52
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PayzenEvent_processUpdate.xml
.../portal_skins/slapos_payzen/PayzenEvent_processUpdate.xml
+7
-0
master/bt5/slapos_payzen/TestTemplateItem/testSlapOSPayzenSkins.py
...5/slapos_payzen/TestTemplateItem/testSlapOSPayzenSkins.py
+21
-0
master/bt5/slapos_payzen/bt/revision
master/bt5/slapos_payzen/bt/revision
+1
-1
No files found.
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PayzenEvent_processUpdate.xml
View file @
fefb8caa
...
...
@@ -106,6 +106,7 @@ elif error_code == \'0\':\n
}\n
mark_transaction_id_list = [\'0\', \'1\', \'3\', \'4\', \'5\', \'10\', \'11\', \'12\']\n
continue_transaction_id_list = [\'6\']\n
cancel_transaction_id_list = [\'8\']\n
\n
transaction_status = data_kw[\'transactionStatus\']\n
\n
...
...
@@ -153,6 +154,12 @@ elif error_code == \'0\':\n
else:\n
payzen_event.confirm(comment=\'Expected to put transaction in stopped state, but achieved only %s state\' % transaction.getSimulationState())\n
\n
elif transaction_status in cancel_transaction_id_list:\n
payzen_event.confirm()\n
payzen_event.acknowledge(comment=\'Refused payzen payment.\')\n
if isTransitionPossible(transaction, \'cancel\'):\n
transaction.cancel(comment=\'Aborting refused payzen payment.\')\n
return\n
else:\n
payzen_event.confirm(comment=\'Transaction status %r (%r) is not supported\' \\\n
% (transaction_status, transaction_status_description))\n
...
...
master/bt5/slapos_payzen/TestTemplateItem/testSlapOSPayzenSkins.py
View file @
fefb8caa
...
...
@@ -585,6 +585,27 @@ return addToDate(DateTime(), to_add={'day': -1, 'second': -1}).toZone('UTC'), 'f
'Aborting unknown payzen payment.'
,
payment
.
workflow_history
[
'accounting_workflow'
][
-
1
][
'comment'
])
def
test_processUpdate_refusedPayzenPayment
(
self
):
event
=
self
.
createPayzenEvent
()
payment
=
self
.
createPaymentTransaction
()
event
.
edit
(
destination_value
=
payment
)
data_kw
=
{
'errorCode'
:
'0'
,
'transactionStatus'
:
'8'
,
}
event
.
PayzenEvent_processUpdate
(
data_kw
,
True
)
self
.
assertEquals
(
event
.
getValidationState
(),
"acknowledged"
)
self
.
assertEqual
(
'Refused payzen payment.'
,
event
.
workflow_history
[
'system_event_workflow'
][
-
1
][
'comment'
])
self
.
assertEquals
(
payment
.
getSimulationState
(),
"cancelled"
)
self
.
assertEqual
(
'Aborting refused payzen payment.'
,
payment
.
workflow_history
[
'accounting_workflow'
][
-
1
][
'comment'
])
class
TestSlapOSPayzenBase_getPayzenServiceRelativeUrl
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
...
...
master/bt5/slapos_payzen/bt/revision
View file @
fefb8caa
115
\ No newline at end of file
116
\ 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