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
Cédric Le Ninivin
slapos.core
Commits
fa4bfbf9
Commit
fa4bfbf9
authored
Sep 28, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Alarm for plan the payed subscription requests.
parent
41c05b89
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
263 additions
and
0 deletions
+263
-0
master/bt5/slapos_subscription_request/PathTemplateItem/portal_alarms/slapos_subscription_request_process_draft.xml
...rtal_alarms/slapos_subscription_request_process_draft.xml
+95
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Alarm_processDraftSubscriptionRequest.py
...cription_request/Alarm_processDraftSubscriptionRequest.py
+12
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Alarm_processDraftSubscriptionRequest.xml
...ription_request/Alarm_processDraftSubscriptionRequest.xml
+62
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyPaymentTransaction.py
...n_request/SubscriptionRequest_verifyPaymentTransaction.py
+31
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyPaymentTransaction.xml
..._request/SubscriptionRequest_verifyPaymentTransaction.xml
+62
-0
master/bt5/slapos_subscription_request/bt/template_path_list
master/bt5/slapos_subscription_request/bt/template_path_list
+1
-0
No files found.
master/bt5/slapos_subscription_request/PathTemplateItem/portal_alarms/slapos_subscription_request_process_draft.xml
0 → 100644
View file @
fa4bfbf9
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_processDraftSubscriptionRequest
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_subscription_request_process_draft
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute_frequency
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1357002060.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Process Draft Subscription Requests
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Alarm_processDraftSubscriptionRequest.py
0 → 100644
View file @
fa4bfbf9
from
DateTime
import
DateTime
portal
=
context
.
getPortalObject
()
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
"Subscription Request"
,
validation_state
=
"draft"
,
method_id
=
"SubscriptionRequest_verifyPaymentTransaction"
,
activity_kw
=
{
tag
:
tag
}
)
context
.
activate
(
after_tag
=
tag
).
getId
()
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/Alarm_processDraftSubscriptionRequest.xml
0 → 100644
View file @
fa4bfbf9
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
tag, fixit, params
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_processDraftSubscriptionRequest
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyPaymentTransaction.py
0 → 100644
View file @
fa4bfbf9
sale_invoice_transaction
=
context
.
getCausalityValue
(
portal_type
=
"Sale Invoice Transaction"
)
if
sale_invoice_transaction
is
None
:
context
.
cancel
(
comment
=
"No sale invoice transaction attached, so subscription is cancelled"
)
return
if
sale_invoice_transaction
.
getSimulationState
()
in
[
"draft"
,
"cancelled"
,
"deleted"
]:
context
.
cancel
(
comment
=
"Invoice is cancelled, so subscription is cancelled"
)
return
payment_transaction
=
sale_invoice_transaction
.
getCausalityRelatedValue
(
portal_type
=
"Payment Transaction"
)
if
payment_transaction
.
getSimulationState
()
in
[
"draft"
,
"cancelled"
,
"deleted"
]:
context
.
cancel
(
comment
=
"Payment is cancelled, so subscription is cancelled"
)
sale_invoice_transaction
.
cancel
(
comment
=
"Payment is cancelled, so invoice is cancelled"
)
return
# Check if payment_transaction is payed.
if
payment_transaction
.
getSimulationState
()
!=
"stopped"
:
# Nothing to do bug wait the payment
return
if
context
.
getSpecialise
(
portal_type
=
"Subscription Condition"
)
is
not
None
:
# Ensure Subscription is updated
context
.
SubscriptionRequest_applyCondition
()
# Send notification to Our Mantainers via portal notifications
#
context
.
plan
(
comment
=
"Payment is consider valid."
)
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyPaymentTransaction.xml
0 → 100644
View file @
fa4bfbf9
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SubscriptionRequest_verifyPaymentTransaction
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_subscription_request/bt/template_path_list
View file @
fa4bfbf9
...
...
@@ -3,4 +3,5 @@ accounting_module/slapos_pre_payment_template/**
accounting_module/template_pre_payment_subscription_sale_invoice_transaction
accounting_module/template_pre_payment_subscription_sale_invoice_transaction/**
notification_message_module/slapos-free-trial-token
portal_alarms/slapos_subscription_request_process_**
portal_alarms/slapos_trial_process_**
\ 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