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 Gambier
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
Show 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):
...
@@ -500,45 +500,33 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
self
.
assertEqual
(
len
(
line_list
),
0
)
self
.
assertEqual
(
len
(
line_list
),
0
)
@
changeSkin
(
'Hosting'
)
@
changeSkin
(
'Hosting'
)
def
usePayzenManually
(
self
,
web_site
):
def
usePayzenManually
(
self
,
web_site
,
user_reference
):
# No more acknowledgment
acknowledgement_json
=
\
acknowledgement_json
=
\
web_site
.
AcknowledgementTool_getUserUnreadAcknowledgementJSON
()
web_site
.
AcknowledgementTool_getUserUnreadAcknowledgementJSON
()
acknowledgement_dict
=
json
.
loads
(
acknowledgement_json
)
acknowledgement_dict
=
json
.
loads
(
acknowledgement_json
)
self
.
assertTrue
(
'result'
in
acknowledgement_dict
,
"%s"
%
acknowledgement_dict
)
self
.
assertTrue
(
'result'
in
acknowledgement_dict
,
"%s"
%
acknowledgement_dict
)
message_list
=
acknowledgement_dict
[
'result'
]
message_list
=
acknowledgement_dict
[
'result'
]
self
.
assertEquals
(
len
(
message_list
),
1
,
"%s"
%
message_list
)
self
.
assertEquals
(
len
(
message_list
),
0
,
"%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
.
assertTrue
(
acknowledge_url
.
startswith
(
# User received an email for payment
'AcknowledgementTool_acknowledge?acknowledgement_url=event_module/'
),
email
=
'%s@example.com'
%
user_reference
"%s"
%
acknowledge_url
)
def
findMessage
(
email
,
body
):
for
candidate
in
reversed
(
self
.
portal
.
MailHost
.
getMessageList
()):
self
.
assertTrue
(
text_content
.
startswith
(
if
[
q
for
q
in
candidate
[
1
]
if
email
in
q
]
and
body
in
candidate
[
2
]:
'Please pay your payment by clicking <a href="accounting_module/'
),
return
candidate
[
2
]
"%s"
%
text_content
)
to_click_message
=
findMessage
(
email
,
'A new invoice has been generated.'
)
self
.
assertTrue
(
text_content
.
endswith
(
self
.
assertNotEqual
(
None
,
to_click_message
)
'/PaymentTransaction_redirectToManualPayzenPayment">here</a>.'
),
"%s"
%
text_content
)
# Pay to payzen
# Pay to payzen
to_click_url
=
re
.
search
(
'href="(.+?)"'
,
text_content
).
group
(
1
)
document_id
=
self
.
portal
.
portal_catalog
.
getResultValue
(
module
,
document_id
,
skin
=
to_click_url
.
split
(
'/'
)
portal_type
=
"Payment Transaction"
,
simulation_state
=
"started"
,
).
getId
()
click_result
=
\
click_result
=
\
web_site
.
accounting_module
[
document_id
].
\
web_site
.
accounting_module
[
document_id
].
\
PaymentTransaction_redirectToManualPayzenPayment
()
PaymentTransaction_redirectToManualPayzenPayment
()
# Acknowledge
event_url
=
str
(
acknowledge_url
.
split
(
'='
)[
-
1
])
web_site
.
AcknowledgementTool_acknowledge
(
acknowledgement_url
=
event_url
)
def
test
(
self
):
def
test
(
self
):
# some preparation
# some preparation
self
.
logout
()
self
.
logout
()
...
@@ -763,8 +751,7 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
...
@@ -763,8 +751,7 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
self
.
assertPersonDocumentCoverage
(
person
)
self
.
assertPersonDocumentCoverage
(
person
)
self
.
login
(
public_reference
)
self
.
login
(
public_reference
)
self
.
usePayzenManually
(
self
.
web_site
)
self
.
usePayzenManually
(
self
.
web_site
,
public_reference
)
self
.
login
(
friend_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
...
@@ -96,7 +96,7 @@ Do not hesitate to visit the web forum (http://community.slapos.org/forum) in ca
Regards,\n
Regards,\n
The slapos team\n
The slapos team\n
""" % portal.portal_preferences.getPreferredSlaposWebSiteUrl())\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.stop(comment=\'Requested manual payment.\')\n
mail_message.deliver(comment=\'Requested manual payment.\')\n
mail_message.deliver(comment=\'Requested manual payment.\')\n
\n
\n
...
...
master/bt5/slapos_payzen/bt/revision
View file @
b1694904
111
112
\ 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