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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
26c4d8f1
Commit
26c4d8f1
authored
Dec 18, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_wechat: Price isn't a negative value
parent
e725b1e7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testSlapOSWechatWorkflow.py
...m/portal_components/test.erp5.testSlapOSWechatWorkflow.py
+6
-3
master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testSlapOSWechatWorkflow.xml
.../portal_components/test.erp5.testSlapOSWechatWorkflow.xml
+1
-3
master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.py
...ce_workflow/scripts/WechatEvent_generateNavigationPage.py
+1
-1
No files found.
master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testSlapOSWechatWorkflow.py
View file @
26c4d8f1
...
@@ -22,7 +22,6 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixinWithAbort
...
@@ -22,7 +22,6 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixinWithAbort
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
import
difflib
import
transaction
import
transaction
HARDCODED_PRICE
=
99.6
HARDCODED_PRICE
=
99.6
...
@@ -84,6 +83,7 @@ class TestSlapOSWechatInterfaceWorkflow(SlapOSTestCaseMixinWithAbort):
...
@@ -84,6 +83,7 @@ class TestSlapOSWechatInterfaceWorkflow(SlapOSTestCaseMixinWithAbort):
)
)
payment_transaction_id
=
payment
.
getId
().
encode
(
'utf-8'
)
payment_transaction_id
=
payment
.
getId
().
encode
(
'utf-8'
)
total_fee
=
int
(
HARDCODED_PRICE
*
100
)
before_date
=
DateTime
()
before_date
=
DateTime
()
self
.
_simulatePaymentTransaction_getTotalPayablePrice
()
self
.
_simulatePaymentTransaction_getTotalPayablePrice
()
try
:
try
:
...
@@ -112,13 +112,16 @@ class TestSlapOSWechatInterfaceWorkflow(SlapOSTestCaseMixinWithAbort):
...
@@ -112,13 +112,16 @@ class TestSlapOSWechatInterfaceWorkflow(SlapOSTestCaseMixinWithAbort):
# Event state
# Event state
self
.
assertEqual
(
event
.
getValidationState
(),
"acknowledged"
)
self
.
assertEqual
(
event
.
getValidationState
(),
"acknowledged"
)
expected_url
=
"http://example.org/#wechat_payment?trade_no=%s&price=1&payment_url="
%
(
payment_transaction_id
)
expected_url
=
"http://example.org/#wechat_payment?trade_no=%s&price=%s&payment_url="
%
\
(
payment_transaction_id
,
total_fee
)
# Event message state
# Event message state
event_message_list
=
event
.
contentValues
(
portal_type
=
"Wechat Event Message"
)
event_message_list
=
event
.
contentValues
(
portal_type
=
"Wechat Event Message"
)
self
.
assertEqual
(
len
(
event_message_list
),
1
)
self
.
assertEqual
(
len
(
event_message_list
),
1
)
message
=
event_message_list
[
0
]
message
=
event_message_list
[
0
]
self
.
assertEqual
(
message
.
getTitle
(),
'Shown Page'
)
self
.
assertEqual
(
message
.
getTitle
(),
'Shown Page'
)
self
.
assertTrue
(
expected_url
in
message
.
getTextContent
())
self
.
assertTrue
(
expected_url
in
message
.
getTextContent
(),
"%s not in %s"
%
(
expected_url
,
message
.
getTextContent
()))
transaction
.
abort
()
transaction
.
abort
()
...
...
master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testSlapOSWechatWorkflow.xml
View file @
26c4d8f1
...
@@ -45,9 +45,7 @@
...
@@ -45,9 +45,7 @@
<item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<value>
<tuple>
<tuple/>
<string>
W: 25, 0: Unused import difflib (unused-import)
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
...
master/bt5/slapos_wechat/WorkflowTemplateItem/portal_workflow/wechat_interface_workflow/scripts/WechatEvent_generateNavigationPage.py
View file @
26c4d8f1
...
@@ -11,7 +11,7 @@ if transaction_id is None:
...
@@ -11,7 +11,7 @@ if transaction_id is None:
wechat_dict
=
{
wechat_dict
=
{
'out_trade_no'
:
payment_transaction
.
getId
().
encode
(
'utf-8'
),
'out_trade_no'
:
payment_transaction
.
getId
().
encode
(
'utf-8'
),
'total_fee'
:
str
(
int
(
round
((
payment_transaction
.
PaymentTransaction_getTotalPayablePrice
()
*
-
100
),
0
))),
'total_fee'
:
str
(
int
(
round
((
payment_transaction
.
PaymentTransaction_getTotalPayablePrice
()
*
100
),
0
))),
'fee_type'
:
payment_transaction
.
getResourceValue
().
Currency_getIntegrationMapping
(),
'fee_type'
:
payment_transaction
.
getResourceValue
().
Currency_getIntegrationMapping
(),
'body'
:
"Rapid Space Virtual Machine"
.
encode
(
'utf-8'
)
'body'
:
"Rapid Space Virtual Machine"
.
encode
(
'utf-8'
)
}
}
...
...
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