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
Thomas Leymonerie
slapos.core
Commits
b1694904
Commit
b1694904
authored
Mar 04, 2013
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mail is send when payment is generated.
parent
967c72f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
32 deletions
+19
-32
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSERP5DefaultScenario.py
...os_erp5/TestTemplateItem/testSlapOSERP5DefaultScenario.py
+17
-30
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_sendManualPayzenPaymentUrl.xml
..._payzen/PaymentTransaction_sendManualPayzenPaymentUrl.xml
+1
-1
master/bt5/slapos_payzen/bt/revision
master/bt5/slapos_payzen/bt/revision
+1
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSERP5DefaultScenario.py
View file @
b1694904
...
...
@@ -500,45 +500,33 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
self
.
assertEqual
(
len
(
line_list
),
0
)
@
changeSkin
(
'Hosting'
)
def
usePayzenManually
(
self
,
web_site
):
def
usePayzenManually
(
self
,
web_site
,
user_reference
):
# No more acknowledgment
acknowledgement_json
=
\
web_site
.
AcknowledgementTool_getUserUnreadAcknowledgementJSON
()
acknowledgement_dict
=
json
.
loads
(
acknowledgement_json
)
self
.
assertTrue
(
'result'
in
acknowledgement_dict
,
"%s"
%
acknowledgement_dict
)
message_list
=
acknowledgement_dict
[
'result'
]
self
.
assertEquals
(
len
(
message_list
),
1
,
"%s"
%
message_list
)
message
=
message_list
[
0
]
self
.
assertTrue
(
'acknowledge_url'
in
message
,
"%s"
%
message
)
self
.
assertTrue
(
'text_content'
in
message
,
"%s"
%
message
)
acknowledge_url
=
message
[
'acknowledge_url'
]
text_content
=
message
[
'text_content'
]
self
.
assertEquals
(
len
(
message_list
),
0
,
"%s"
%
message_list
)
self
.
assertTrue
(
acknowledge_url
.
startswith
(
'AcknowledgementTool_acknowledge?acknowledgement_url=event_module/'
),
"%s"
%
acknowledge_url
)
self
.
assertTrue
(
text_content
.
startswith
(
'Please pay your payment by clicking <a href="accounting_module/'
),
"%s"
%
text_content
)
self
.
assertTrue
(
text_content
.
endswith
(
'/PaymentTransaction_redirectToManualPayzenPayment">here</a>.'
),
"%s"
%
text_content
)
# User received an email for payment
email
=
'%s@example.com'
%
user_reference
def
findMessage
(
email
,
body
):
for
candidate
in
reversed
(
self
.
portal
.
MailHost
.
getMessageList
()):
if
[
q
for
q
in
candidate
[
1
]
if
email
in
q
]
and
body
in
candidate
[
2
]:
return
candidate
[
2
]
to_click_message
=
findMessage
(
email
,
'A new invoice has been generated.'
)
self
.
assertNotEqual
(
None
,
to_click_message
)
# Pay to payzen
to_click_url
=
re
.
search
(
'href="(.+?)"'
,
text_content
).
group
(
1
)
module
,
document_id
,
skin
=
to_click_url
.
split
(
'/'
)
document_id
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Payment Transaction"
,
simulation_state
=
"started"
,
).
getId
()
click_result
=
\
web_site
.
accounting_module
[
document_id
].
\
PaymentTransaction_redirectToManualPayzenPayment
()
# Acknowledge
event_url
=
str
(
acknowledge_url
.
split
(
'='
)[
-
1
])
web_site
.
AcknowledgementTool_acknowledge
(
acknowledgement_url
=
event_url
)
def
test
(
self
):
# some preparation
self
.
logout
()
...
...
@@ -763,8 +751,7 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
self
.
assertPersonDocumentCoverage
(
person
)
self
.
login
(
public_reference
)
self
.
usePayzenManually
(
self
.
web_site
)
self
.
usePayzenManually
(
self
.
web_site
,
public_reference
)
self
.
login
(
friend_reference
)
self
.
usePayzenManually
(
self
.
web_site
)
self
.
usePayzenManually
(
self
.
web_site
,
friend_reference
)
\ No newline at end of file
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_sendManualPayzenPaymentUrl.xml
View file @
b1694904
...
...
@@ -96,7 +96,7 @@ Do not hesitate to visit the web forum (http://community.slapos.org/forum) in ca
Regards,\n
The slapos team\n
""" % portal.portal_preferences.getPreferredSlaposWebSiteUrl())\n
mail_message.start(
comment=\'Requested manual payment.\')\n
portal.portal_workflow.doActionFor(mail_message, \'start_action\', send_mail=True,
comment=\'Requested manual payment.\')\n
mail_message.stop(comment=\'Requested manual payment.\')\n
mail_message.deliver(comment=\'Requested manual payment.\')\n
\n
...
...
master/bt5/slapos_payzen/bt/revision
View file @
b1694904
111
\ No newline at end of file
112
\ 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