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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
eb4e2d2d
Commit
eb4e2d2d
authored
May 09, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_payzen: No need provide web_site object anymore since we rely on scripts now.
parent
295aff9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
12 deletions
+6
-12
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToManualPayzenPayment.py
...ayzen/PaymentTransaction_redirectToManualPayzenPayment.py
+4
-4
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToManualPayzenPayment.xml
...yzen/PaymentTransaction_redirectToManualPayzenPayment.xml
+1
-1
master/bt5/slapos_payzen/TestTemplateItem/portal_components/test.erp5.testSlapOSPayzenSkins.py
...Item/portal_components/test.erp5.testSlapOSPayzenSkins.py
+1
-7
No files found.
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToManualPayzenPayment.py
View file @
eb4e2d2d
...
@@ -2,9 +2,9 @@ from zExceptions import Unauthorized
...
@@ -2,9 +2,9 @@ from zExceptions import Unauthorized
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
def
wrapWithShadow
(
payment_transaction
,
web_site
,
person_relative_url
):
def
wrapWithShadow
(
payment_transaction
,
person_relative_url
):
vads_url_dict
=
payment_transaction
.
PaymentTransaction_getVADSUrlDict
(
web_site
)
vads_url_dict
=
payment_transaction
.
PaymentTransaction_getVADSUrlDict
()
_
,
transaction_id
=
payment_transaction
.
PaymentTransaction_getPayzenId
()
_
,
transaction_id
=
payment_transaction
.
PaymentTransaction_getPayzenId
()
vads_url_already_registered
=
vads_url_dict
.
pop
(
'vads_url_already_registered'
)
vads_url_already_registered
=
vads_url_dict
.
pop
(
'vads_url_already_registered'
)
...
@@ -25,10 +25,10 @@ def wrapWithShadow(payment_transaction, web_site, person_relative_url):
...
@@ -25,10 +25,10 @@ def wrapWithShadow(payment_transaction, web_site, person_relative_url):
if
person
is
None
:
if
person
is
None
:
if
not
portal
.
portal_membership
.
isAnonymousUser
():
if
not
portal
.
portal_membership
.
isAnonymousUser
():
return
wrapWithShadow
(
context
,
web_site
,
context
.
getDestinationSection
())
return
wrapWithShadow
(
context
,
context
.
getDestinationSection
())
raise
Unauthorized
(
"You must be logged in"
)
raise
Unauthorized
(
"You must be logged in"
)
return
person
.
Person_restrictMethodAsShadowUser
(
return
person
.
Person_restrictMethodAsShadowUser
(
shadow_document
=
person
,
shadow_document
=
person
,
callable_object
=
wrapWithShadow
,
callable_object
=
wrapWithShadow
,
argument_list
=
[
context
,
web_site
,
person
.
getRelativeUrl
()])
argument_list
=
[
context
,
person
.
getRelativeUrl
()])
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToManualPayzenPayment.xml
View file @
eb4e2d2d
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
web_site=None
</string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/slapos_payzen/TestTemplateItem/portal_components/test.erp5.testSlapOSPayzenSkins.py
View file @
eb4e2d2d
...
@@ -686,11 +686,6 @@ class TestSlapOSPayzenBase_getPayzenServiceRelativeUrl(SlapOSTestCaseMixinWithAb
...
@@ -686,11 +686,6 @@ class TestSlapOSPayzenBase_getPayzenServiceRelativeUrl(SlapOSTestCaseMixinWithAb
class
TestSlapOSPayzenPaymentTransaction_redirectToManualPayzenPayment
(
class
TestSlapOSPayzenPaymentTransaction_redirectToManualPayzenPayment
(
SlapOSTestCaseMixinWithAbort
):
SlapOSTestCaseMixinWithAbort
):
def
test_PaymentTransaction_redirectToManualPayzenPayment
(
self
):
payment
=
self
.
createPaymentTransaction
()
self
.
assertRaises
(
ValueError
,
payment
.
PaymentTransaction_redirectToManualPayzenPayment
)
def
_simulatePaymentTransaction_getVADSUrlDict
(
self
):
def
_simulatePaymentTransaction_getVADSUrlDict
(
self
):
script_name
=
'PaymentTransaction_getVADSUrlDict'
script_name
=
'PaymentTransaction_getVADSUrlDict'
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
...
@@ -714,7 +709,6 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
...
@@ -714,7 +709,6 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
if
script_name
in
self
.
portal
.
portal_skins
.
custom
.
objectIds
():
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
self
.
portal
.
portal_skins
.
custom
.
manage_delObjects
(
script_name
)
def
test_PaymentTransaction_redirectToManualPayzenPayment_unauthorzied
(
self
):
def
test_PaymentTransaction_redirectToManualPayzenPayment_unauthorzied
(
self
):
payment
=
self
.
createPaymentTransaction
()
payment
=
self
.
createPaymentTransaction
()
self
.
_simulatePaymentTransaction_getVADSUrlDict
()
self
.
_simulatePaymentTransaction_getVADSUrlDict
()
...
@@ -730,7 +724,7 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
...
@@ -730,7 +724,7 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self
.
tic
()
self
.
tic
()
project
=
self
.
addProject
()
project
=
self
.
addProject
()
person
=
self
.
makePerson
(
project
)
person
=
self
.
makePerson
(
project
)
invoice
=
self
.
createStoppedSaleInvoiceTransaction
(
invoice
=
self
.
createStoppedSaleInvoiceTransaction
(
destination_section_value
=
person
,
destination_section_value
=
person
,
destination_project_value
=
project
destination_project_value
=
project
)
)
...
...
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