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
Léo-Paul Géneau
slapos.core
Commits
71e9f196
Commit
71e9f196
authored
Oct 05, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_subscription_request: Check for the list of payment as simulation can create more.
parent
64a037a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyReservationPaymentTransaction.py
...ubscriptionRequest_verifyReservationPaymentTransaction.py
+17
-4
No files found.
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_verifyReservationPaymentTransaction.py
View file @
71e9f196
...
...
@@ -15,16 +15,29 @@ if sale_invoice_transaction.getSimulationState() in ["draft", "cancelled", "dele
context
.
cancel
(
comment
=
"Invoice is cancelled, so subscription is cancelled"
)
return
payment_transaction
=
sale_invoice_transaction
.
getCausalityRelatedValue
(
payment_transaction
_list
=
sale_invoice_transaction
.
getCausalityRelatedValueList
(
portal_type
=
"Payment Transaction"
)
if
payment_transaction
.
getSimulationState
()
in
[
"draft"
,
"cancelled"
,
"deleted"
]:
cancel_subscription_request
=
None
is_paid
=
False
for
payment_transaction
in
payment_transaction_list
:
if
cancel_subscription_request
!=
False
and
payment_transaction
.
getSimulationState
()
in
[
"draft"
,
"cancelled"
,
"deleted"
]:
cancel_subscription_request
=
True
if
payment_transaction
.
getSimulationState
()
==
"stopped"
:
cancel_subscription_request
=
False
is_paid
=
True
if
cancel_subscription_request
:
context
.
cancel
(
comment
=
"Payment is cancelled, so subscription is cancelled"
)
sale_invoice_transaction
.
cancel
(
comment
=
"Payment is cancelled, so invoice is cancelled"
)
return
for
payment_transaction
in
payment_transaction_list
:
if
payment_transaction
.
getSimulationState
()
==
"started"
:
payment_transaction
.
cancel
(
"Subscription is been cancelled"
)
# Check if payment_transaction is payed.
if
payment_transaction
.
getSimulationState
()
!=
"stopped"
:
if
not
is_paid
:
# Nothing to do bug wait the payment
return
...
...
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