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
Roque
slapos.core
Commits
06723fd9
Commit
06723fd9
authored
May 27, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: Do not propagate website as parameter
Use acquisition properly.
parent
7a6d0409
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_createExternalPaymentTransactionFromOutstandingAmountAndRedirect.py
...rnalPaymentTransactionFromOutstandingAmountAndRedirect.py
+9
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/PaymentTransaction_redirectToManualPayment.py
...lapos_panel/PaymentTransaction_redirectToManualPayment.py
+1
-1
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/PaymentTransaction_redirectToManualPayment.xml
...apos_panel/PaymentTransaction_redirectToManualPayment.xml
+1
-1
No files found.
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Base_createExternalPaymentTransactionFromOutstandingAmountAndRedirect.py
View file @
06723fd9
portal
=
context
.
getPortalObject
()
# Get entity from context to preserve path
entity
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
outstanding_amount
=
context
web_site
=
outstanding_amount
.
getWebSiteValue
()
assert
outstanding_amount
.
getLedgerUid
()
==
portal
.
portal_categories
.
ledger
.
automated
.
getUid
()
assert
outstanding_amount
.
getDestinationSectionUid
()
==
entity
.
getUid
()
assert
web_site
is
not
None
payment_mode
=
outstanding_amount
.
Base_getPaymentModeForCurrency
(
outstanding_amount
.
getPriceCurrencyUid
())
...
...
@@ -32,6 +38,9 @@ def wrapWithShadow(entity, outstanding_amount, payment_mode):
)
raise
ValueError
(
"Unsupported outstanding amount type: %s"
%
(
portal_type
))
# Ensure to re-take the entity under a proper acquisition context
entity
=
web_site
.
restrictedTraverse
(
entity
.
getRelativeUrl
())
payment_transaction
=
entity
.
Person_restrictMethodAsShadowUser
(
shadow_document
=
entity
,
callable_object
=
wrapWithShadow
,
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/PaymentTransaction_redirectToManualPayment.py
View file @
06723fd9
if
(
context
.
getPaymentMode
()
==
"wechat"
):
return
context
.
PaymentTransaction_redirectToManualWechatPayment
(
web_site
=
web_site
)
return
context
.
PaymentTransaction_redirectToManualWechatPayment
()
elif
(
context
.
getPaymentMode
()
==
"payzen"
):
return
context
.
PaymentTransaction_redirectToManualPayzenPayment
()
else
:
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/PaymentTransaction_redirectToManualPayment.xml
View file @
06723fd9
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
web_site=None
</string>
</value>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
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