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
Paul Graydon
slapos.core
Commits
010cd409
Commit
010cd409
authored
Dec 13, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Make external payment configuration optional
See merge request
nexedi/slapos.core!586
parents
ed2c746f
be8e2565
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
391 additions
and
81 deletions
+391
-81
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_getVADSUrlDict.py
...ns/slapos_accounting/PaymentTransaction_getVADSUrlDict.py
+5
-2
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_getVADSUrlDict.xml
...s/slapos_accounting/PaymentTransaction_getVADSUrlDict.xml
+0
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_redirectToManualContactUsPayment.py
...ng/PaymentTransaction_redirectToManualContactUsPayment.py
+22
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_redirectToManualContactUsPayment.xml
...g/PaymentTransaction_redirectToManualContactUsPayment.xml
+9
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_redirectToManualFreePayment.py
...ounting/PaymentTransaction_redirectToManualFreePayment.py
+2
-2
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_redirectToManualFreePayment.xml
...unting/PaymentTransaction_redirectToManualFreePayment.xml
+0
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_redirectToManualSlapOSPayment.py
...g/SaleInvoiceTransaction_redirectToManualSlapOSPayment.py
+13
-3
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
...Item/portal_components/test.erp5.testSlapOSCodingStyle.py
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js.js
...em/web_page_module/rjs_gadget_slapos_payment_result_js.js
+8
-0
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js.xml
...m/web_page_module/rjs_gadget_slapos_payment_result_js.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_site_module/hostingjs.xml
...slapos_jio/PathTemplateItem/web_site_module/hostingjs.xml
+20
-2
master/bt5/slapos_payzen/PathTemplateItem/sale_trade_condition_module/payzen_sale_trade_condition.xml
...le_trade_condition_module/payzen_sale_trade_condition.xml
+87
-8
master/bt5/slapos_payzen/PathTemplateItem/sale_trade_condition_module/slapos_manual_accounting_trade_condition.xml
...ition_module/slapos_manual_accounting_trade_condition.xml
+161
-9
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/Base_getPayzenServiceRelativeUrl.py
...l_skins/slapos_payzen/Base_getPayzenServiceRelativeUrl.py
+11
-2
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToManualPayzenPayment.py
...ayzen/PaymentTransaction_redirectToManualPayzenPayment.py
+0
-3
master/bt5/slapos_payzen/TestTemplateItem/portal_components/test.erp5.testSlapOSPayzenSkins.py
...Item/portal_components/test.erp5.testSlapOSPayzenSkins.py
+15
-0
master/bt5/slapos_payzen/bt/template_keep_last_workflow_history_only_path_list
...zen/bt/template_keep_last_workflow_history_only_path_list
+2
-0
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.py
...est/SubscriptionRequestModule_requestSubscriptionProxy.py
+6
-4
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.py
...l_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.py
+12
-2
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToManualWechatPayment.py
...echat/PaymentTransaction_redirectToManualWechatPayment.py
+0
-3
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py
...apos_wechat/PaymentTransaction_redirectToWechatPayment.py
+0
-35
master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testSlapOSWechatSkins.py
...Item/portal_components/test.erp5.testSlapOSWechatSkins.py
+14
-1
No files found.
master/bt5/slapos_
jio/SkinTemplateItem/portal_skins/slapos_hal_json_style
/PaymentTransaction_getVADSUrlDict.py
→
master/bt5/slapos_
accounting/SkinTemplateItem/portal_skins/slapos_accounting
/PaymentTransaction_getVADSUrlDict.py
View file @
010cd409
...
...
@@ -2,15 +2,18 @@
if
web_site
is
None
:
web_site
=
context
.
getWebSiteValue
()
if
web_site
is
None
:
raise
ValueError
(
"This script must be called from a web site"
)
base_url
=
web_site
.
absolute_url
()
payment_transaction_url
=
context
.
getRelativeUrl
()
base
=
web_site
.
getLayoutProperty
(
"configuration_payment_url_template"
,
"%(url)s/#/%(payment)s?page=slap_payment_result&result=%(result)s"
)
"%(url)s/#/%(payment
_transaction_url
)s?page=slap_payment_result&result=%(result)s"
)
base_substitution_dict
=
{
"url"
:
base_url
,
"payment"
:
payment_transaction_url
,
"payment
_transaction_url
"
:
payment_transaction_url
,
"result"
:
"__RESULT__"
}
...
...
master/bt5/slapos_
jio/SkinTemplateItem/portal_skins/slapos_hal_json_style
/PaymentTransaction_getVADSUrlDict.xml
→
master/bt5/slapos_
accounting/SkinTemplateItem/portal_skins/slapos_accounting
/PaymentTransaction_getVADSUrlDict.xml
View file @
010cd409
File moved
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_redirectToManualContactUsPayment.py
0 → 100644
View file @
010cd409
""" Return a dict with vads_urls required for payzen."""
if
web_site
is
None
:
web_site
=
context
.
getWebSiteValue
()
if
context
.
PaymentTransaction_getTotalPayablePrice
()
==
0
:
# This script cannot be used if Payment has a value to pay
raise
ValueError
(
"Payment Transaction has a non zero total"
)
base_url
=
web_site
.
absolute_url
()
payment_transaction_url
=
context
.
getRelativeUrl
()
base
=
web_site
.
getLayoutProperty
(
"configuration_payment_url_template"
,
"%(url)s/#/%(payment_transaction_url)s?page=slap_payment_result&result=%(result)s"
)
base_substitution_dict
=
{
"url"
:
base_url
,
"payment_transaction_url"
:
payment_transaction_url
,
"result"
:
"contact_us"
}
redirect_url
=
base
%
base_substitution_dict
return
context
.
REQUEST
.
RESPONSE
.
redirect
(
redirect_url
)
master/bt5/slapos_
wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechat
Payment.xml
→
master/bt5/slapos_
accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_redirectToManualContactUs
Payment.xml
View file @
010cd409
...
...
@@ -52,9 +52,17 @@
<key>
<string>
_params
</string>
</key>
<value>
<string>
web_site=None
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PaymentTransaction_redirectTo
Wechat
Payment
</string>
</value>
<value>
<string>
PaymentTransaction_redirectTo
ManualContactUs
Payment
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
master/bt5/slapos_
jio/SkinTemplateItem/portal_skins/slapos_hal_json_style
/PaymentTransaction_redirectToManualFreePayment.py
→
master/bt5/slapos_
accounting/SkinTemplateItem/portal_skins/slapos_accounting
/PaymentTransaction_redirectToManualFreePayment.py
View file @
010cd409
...
...
@@ -10,11 +10,11 @@ base_url = web_site.absolute_url()
payment_transaction_url
=
context
.
getRelativeUrl
()
base
=
web_site
.
getLayoutProperty
(
"configuration_payment_url_template"
,
"%(url)s/#/%(payment)s?page=slap_payment_result&result=%(result)s"
)
"%(url)s/#/%(payment
_transaction_url
)s?page=slap_payment_result&result=%(result)s"
)
base_substitution_dict
=
{
"url"
:
base_url
,
"payment"
:
payment_transaction_url
,
"payment
_transaction_url
"
:
payment_transaction_url
,
"result"
:
"free"
}
...
...
master/bt5/slapos_
jio/SkinTemplateItem/portal_skins/slapos_hal_json_style
/PaymentTransaction_redirectToManualFreePayment.xml
→
master/bt5/slapos_
accounting/SkinTemplateItem/portal_skins/slapos_accounting
/PaymentTransaction_redirectToManualFreePayment.xml
View file @
010cd409
File moved
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_redirectToManualSlapOSPayment.py
View file @
010cd409
...
...
@@ -13,9 +13,19 @@ payment = entity.Person_restrictMethodAsShadowUser(
if
web_site
is
None
:
web_site
=
context
.
getWebSiteValue
()
total_price
=
entity
.
Person_restrictMethodAsShadowUser
(
shadow_document
=
entity
,
callable_object
=
payment
.
PaymentTransaction_getTotalPayablePrice
,
argument_list
=
[])
if
total_price
>=
0
:
return
payment
.
PaymentTransaction_redirectToManualFreePayment
(
web_site
=
web_site
)
if
payment_mode
==
"wechat"
:
return
payment
.
PaymentTransaction_redirectToManualWechatPayment
(
web_site
=
web_site
)
if
payment
.
Base_getWechatServiceRelativeUrl
():
return
payment
.
PaymentTransaction_redirectToManualWechatPayment
(
web_site
=
web_site
)
elif
payment_mode
==
"payzen"
:
return
payment
.
PaymentTransaction_redirectToManualPayzenPayment
(
web_site
=
web_site
)
if
payment
.
Base_getPayzenServiceRelativeUrl
():
return
payment
.
PaymentTransaction_redirectToManualPayzenPayment
(
web_site
=
web_site
)
r
aise
ValueError
(
"%s isn't an acceptable payment mode"
%
payment_mod
e
)
r
eturn
payment
.
PaymentTransaction_redirectToManualContactUsPayment
(
web_site
=
web_sit
e
)
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
View file @
010cd409
...
...
@@ -167,6 +167,8 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_accounting/SaleInvoiceTransaction_isTotalPriceEqualAccounting'
,
'slapos_accounting/SaleInvoiceTransaction_isTotalPriceMatchingSalePackingList'
,
'slapos_accounting/SaleInvoiceTransaction_isTradeModelCorrect'
,
'slapos_accounting/PaymentTransaction_redirectToManualFreePayment'
,
'slapos_accounting/PaymentTransaction_redirectToManualContactUsPayment'
,
'slapos_accounting/SalePackingList_jumpToRelatedAggregatedSalePackingList'
,
'slapos_accounting/SalePackingList_jumpToRelatedGroupedSalePackingList'
,
'slapos_accounting/SalePackingList_postSlapOSAggregatedDeliveryBuilder'
,
...
...
@@ -189,7 +191,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_consumption/SoftwareRelease_getAverageConsumedMemory'
,
'slapos_wechat/Base_queryWechatOrderStatusByTradeNo'
,
'slapos_wechat/ERP5Site_receiveWechatPaymentCallback'
,
'slapos_wechat/PaymentTransaction_redirectToWechatPayment'
,
'slapos_payzen/PayzenEvent_isPaymentExpired'
,
'slapos_deploy_theme/WebPage_getDeploySubstitutionMappingDict'
,
'slapos_deploy_theme/WebPage_viewAsWeb'
,
...
...
@@ -233,7 +234,6 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_hal_json_style/Organisation_getAssociatedPersonList'
,
'slapos_hal_json_style/Organisation_hasItem'
,
'slapos_hal_json_style/PasswordTool_changeUserPassword'
,
'slapos_hal_json_style/PaymentTransaction_redirectToManualFreePayment'
,
'slapos_hal_json_style/Person_getAssignmentDestinationList'
,
'slapos_hal_json_style/Person_getCloudContractRelated'
,
'slapos_hal_json_style/Person_requestComputeNode'
,
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js.js
View file @
010cd409
...
...
@@ -59,6 +59,14 @@
page_title
=
"
Payment Unfinished
"
;
message
=
"
You have not finished your payment.
"
;
advice
=
"
Please consider continuing it as soon as possible, otherwise you will be not able to use full functionality.
"
;
}
else
if
(
options
.
result
===
"
free
"
)
{
page_title
=
"
This payment is free
"
;
message
=
"
You are trying to pay a Free invoice.
"
;
advice
=
"
Please, contact us by opening a ticket to ask more information.
"
;
}
else
if
(
options
.
result
===
"
contact_us
"
)
{
page_title
=
"
Please, contact us
"
;
message
=
"
You are trying to pay an invoice, but the automatic payments are disabled currently.
"
;
advice
=
"
Please contact us by opening a ticket with the invoice information, we will provide you an alternative way to pay.
"
;
}
else
if
(
options
.
result
===
"
already_registered
"
)
{
page_title
=
"
Payment already registered
"
;
message
=
"
Your payment had already been registered.
"
;
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_slapos_payment_result_js.xml
View file @
010cd409
...
...
@@ -238,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
100
4.20858.14913.1565
0
</string>
</value>
<value>
<string>
100
6.58340.40727.2362
0
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>
1
668439460.43
</float>
<float>
1
701887958.96
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_site_module/hostingjs.xml
View file @
010cd409
...
...
@@ -353,6 +353,16 @@
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
configuration_payment_url_template
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
...
...
@@ -446,6 +456,14 @@
<key>
<string>
configuration_payment_result
</string>
</key>
<value>
<string>
slap_payment_result
</string>
</value>
</item>
<item>
<key>
<string>
configuration_payment_url_template
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
%(url)s/#/%(payment_transaction_url)s?page=slap_payment_result&result=%(result)s
]]>
</string>
</value>
</item>
<item>
<key>
<string>
configuration_precache_manifest_script_list
</string>
</key>
<value>
<string>
WebSection_getHostingJSPrecacheManifestList\n
...
...
@@ -708,7 +726,7 @@ WebSection_getJsonEditorPrecacheManifestList</string> </value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
101
0.52641.3080.21452
</string>
</value>
<value>
<string>
101
2.36758.49018.20019
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -728,7 +746,7 @@ WebSection_getJsonEditorPrecacheManifestList</string> </value>
</tuple>
<state>
<tuple>
<float>
170
0245844.87
</float>
<float>
170
1890500.23
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_payzen/PathTemplateItem/sale_trade_condition_module/payzen_sale_trade_condition.xml
View file @
010cd409
...
...
@@ -14,9 +14,7 @@
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -27,9 +25,7 @@
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -40,9 +36,7 @@
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -54,9 +48,7 @@
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -108,6 +100,12 @@
<none/>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
...
...
@@ -141,4 +139,85 @@
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<tuple>
<float>
1702404222.37
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_payzen/PathTemplateItem/sale_trade_condition_module/slapos_manual_accounting_trade_condition.xml
View file @
010cd409
...
...
@@ -14,9 +14,7 @@
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -27,9 +25,7 @@
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -40,9 +36,7 @@
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -54,9 +48,7 @@
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Author
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
...
...
@@ -93,7 +85,9 @@
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
<tuple>
<string>
price_currency/currency_module/EUR
</string>
</tuple>
</value>
</item>
<item>
...
...
@@ -130,6 +124,12 @@
<none/>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAc=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
...
...
@@ -195,4 +195,156 @@
<none/>
</pickle>
</record>
<record
id=
"7"
aka=
"AAAAAAAAAAc="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAg=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAk=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"8"
aka=
"AAAAAAAAAAg="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1013.8578.12822.45056
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<tuple>
<float>
1702404310.04
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"9"
aka=
"AAAAAAAAAAk="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<tuple>
<float>
1702400771.68
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/Base_getPayzenServiceRelativeUrl.py
View file @
010cd409
...
...
@@ -3,7 +3,16 @@ if REQUEST is not None:
raise
Unauthorized
portal
=
context
.
getPortalObject
()
payment_service
=
portal
.
portal_secure_payments
.
find
(
service_reference
=
portal
.
portal_preferences
.
getPreferredPayzenPaymentServiceReference
())
service_reference
=
portal
.
portal_preferences
.
getPreferredPayzenPaymentServiceReference
()
if
not
service_reference
:
return
try
:
payment_service
=
portal
.
portal_secure_payments
.
find
(
service_reference
=
service_reference
)
except
ValueError
:
# If service is not found, return None
# this might allow the side handle disabled service configuration.
return
return
payment_service
.
getRelativeUrl
()
master/bt5/slapos_payzen/SkinTemplateItem/portal_skins/slapos_payzen/PaymentTransaction_redirectToManualPayzenPayment.py
View file @
010cd409
...
...
@@ -2,9 +2,6 @@ from zExceptions import Unauthorized
portal
=
context
.
getPortalObject
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
getattr
(
context
,
"PaymentTransaction_getVADSUrlDict"
,
None
)
is
None
:
raise
ValueError
(
"PaymentTransaction_getVADSUrlDict is missing on this site"
)
def
wrapWithShadow
(
payment_transaction
,
web_site
,
person_relative_url
):
vads_url_dict
=
payment_transaction
.
PaymentTransaction_getVADSUrlDict
(
web_site
)
...
...
master/bt5/slapos_payzen/TestTemplateItem/portal_components/test.erp5.testSlapOSPayzenSkins.py
View file @
010cd409
...
...
@@ -170,6 +170,8 @@ class TestSlapOSPaymentTransaction_createPayzenEvent(SlapOSTestCaseMixinWithAbor
REQUEST
=
{})
def
test_createPayzenEvent_newPayment
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_payzen_test
.
setReference
(
"PSERV-Payzen-Test"
)
self
.
tic
()
payment_transaction
=
self
.
createPaymentTransaction
()
payzen_event
=
payment_transaction
.
PaymentTransaction_createPayzenEvent
()
self
.
assertEqual
(
payzen_event
.
getPortalType
(),
"Payzen Event"
)
...
...
@@ -178,6 +180,8 @@ class TestSlapOSPaymentTransaction_createPayzenEvent(SlapOSTestCaseMixinWithAbor
self
.
assertEqual
(
payzen_event
.
getDestination
(),
payment_transaction
.
getRelativeUrl
())
def
test_createPayzenEvent_kwParameter
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_payzen_test
.
setReference
(
"PSERV-Payzen-Test"
)
self
.
tic
()
payment_transaction
=
self
.
createPaymentTransaction
()
payzen_event
=
payment_transaction
.
PaymentTransaction_createPayzenEvent
(
title
=
'foo'
)
...
...
@@ -666,9 +670,18 @@ class TestSlapOSPayzenBase_getPayzenServiceRelativeUrl(SlapOSTestCaseMixinWithAb
REQUEST
=
{})
def
test_getPayzenServiceRelativeUrl_default_result
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_payzen_test
.
setReference
(
"PSERV-Payzen-Test"
)
self
.
tic
()
result
=
self
.
portal
.
Base_getPayzenServiceRelativeUrl
()
self
.
assertEqual
(
result
,
'portal_secure_payments/slapos_payzen_test'
)
def
test_getPayzenServiceRelativeUrl_not_found
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_payzen_test
.
setReference
(
"disabled"
)
self
.
tic
()
result
=
self
.
portal
.
Base_getPayzenServiceRelativeUrl
()
self
.
assertEqual
(
result
,
None
)
class
TestSlapOSPayzenPaymentTransaction_redirectToManualPayzenPayment
(
SlapOSTestCaseMixinWithAbort
):
...
...
@@ -712,6 +725,8 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self
.
_dropPaymentTransaction_getVADSUrlDict
()
def
test_PaymentTransaction_redirectToManualPayzenPayment_redirect
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_payzen_test
.
setReference
(
"PSERV-Payzen-Test"
)
self
.
tic
()
person
=
self
.
makePerson
()
invoice
=
self
.
createStoppedSaleInvoiceTransaction
(
destination_section
=
person
.
getRelativeUrl
())
...
...
master/bt5/slapos_payzen/bt/template_keep_last_workflow_history_only_path_list
0 → 100644
View file @
010cd409
sale_trade_condition_module/payzen_sale_trade_condition
sale_trade_condition_module/slapos_manual_accounting_trade_condition
\ No newline at end of file
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequestModule_requestSubscriptionProxy.py
View file @
010cd409
...
...
@@ -20,8 +20,6 @@ if email in ["", None]:
)
return
context
.
REQUEST
.
RESPONSE
.
redirect
(
redirect_url
)
if
token
:
error
=
""
try
:
...
...
@@ -105,14 +103,18 @@ if target_language == "zh": # Wechat payment
def
wrapRedirectWithShadow
(
payment_transaction
,
web_site
):
# getTotalPayble returns a negative value
if
payment_transaction
.
PaymentTransaction_getTotalPayablePrice
()
<
0
:
return
payment_transaction
.
PaymentTransaction_redirectToManualWechatPayment
(
web_site
)
if
payment_transaction
.
Base_getWechatServiceRelativeUrl
():
return
payment_transaction
.
PaymentTransaction_redirectToManualWechatPayment
(
web_site
)
return
payment_transaction
.
PaymentTransaction_redirectToManualContactUsPayment
(
web_site
)
return
payment_transaction
.
PaymentTransaction_redirectToManualFreePayment
(
web_site
)
else
:
# Payzen payment
def
wrapRedirectWithShadow
(
payment_transaction
,
web_site
):
# getTotalPayble returns a negative value
if
payment_transaction
.
PaymentTransaction_getTotalPayablePrice
()
<
0
:
return
payment_transaction
.
PaymentTransaction_redirectToManualPayzenPayment
(
web_site
)
if
payment_transaction
.
Base_getPayzenServiceRelativeUrl
():
return
payment_transaction
.
PaymentTransaction_redirectToManualPayzenPayment
(
web_site
)
return
payment_transaction
.
PaymentTransaction_redirectToManualContactUsPayment
(
web_site
)
return
payment_transaction
.
PaymentTransaction_redirectToManualFreePayment
(
web_site
)
return
person
.
Person_restrictMethodAsShadowUser
(
...
...
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/Base_getWechatServiceRelativeUrl.py
View file @
010cd409
...
...
@@ -3,7 +3,17 @@ if REQUEST is not None:
raise
Unauthorized
portal
=
context
.
getPortalObject
()
payment_service
=
portal
.
portal_secure_payments
.
find
(
service_reference
=
portal
.
portal_preferences
.
getPreferredWechatPaymentServiceReference
())
service_reference
=
portal
.
portal_preferences
.
getPreferredWechatPaymentServiceReference
()
if
not
service_reference
:
return
try
:
payment_service
=
portal
.
portal_secure_payments
.
find
(
service_reference
=
service_reference
)
except
ValueError
:
# If service is not found, return None
# this might allow the side handle disabled service configuration.
return
return
payment_service
.
getRelativeUrl
()
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToManualWechatPayment.py
View file @
010cd409
...
...
@@ -2,9 +2,6 @@ from zExceptions import Unauthorized
portal
=
context
.
getPortalObject
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
getattr
(
context
,
"PaymentTransaction_getVADSUrlDict"
,
None
)
is
None
:
raise
ValueError
(
"PaymentTransaction_getVADSUrlDict is missing on this site"
)
def
wrapWithShadow
(
payment_transaction
,
web_site
,
person_relative_url
):
vads_url_dict
=
payment_transaction
.
PaymentTransaction_getVADSUrlDict
(
web_site
)
...
...
master/bt5/slapos_wechat/SkinTemplateItem/portal_skins/slapos_wechat/PaymentTransaction_redirectToWechatPayment.py
deleted
100644 → 0
View file @
ed2c746f
from
zExceptions
import
Unauthorized
portal
=
context
.
getPortalObject
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
def
wrapWithShadow
(
payment_transaction
,
web_site
,
person_relative_url
):
vads_url_dict
=
payment_transaction
.
PaymentTransaction_getVADSUrlDict
(
web_site
)
# ???
#_ , transaction_id = payment_transaction.PaymentTransaction_getWechatId()
# vads_url_already_registered = vads_url_dict.pop('vads_url_already_registered')
# if transaction_id is not None:
# return context.REQUEST.RESPONSE.redirect(vads_url_already_registered)
system_event
=
payment_transaction
.
PaymentTransaction_createWechatEvent
(
title
=
'User navigation script for %s'
%
payment_transaction
.
getTitle
(),
destination_section
=
person_relative_url
,
)
# Why I need to login ???
system_event
.
generateWechatPaymentPage
(
**
vads_url_dict
)
'''
return system_event.contentValues(
portal_type="Wechat Event Message")[0].getTextContent()
'''
if
person
is
None
:
if
not
portal
.
portal_membership
.
isAnonymousUser
():
return
wrapWithShadow
(
context
,
web_site
,
context
.
getDestinationSection
())
raise
Unauthorized
(
"You must be logged in"
)
return
person
.
Person_restrictMethodAsShadowUser
(
shadow_document
=
person
,
callable_object
=
wrapWithShadow
,
argument_list
=
[
context
,
web_site
,
person
.
getRelativeUrl
()])
master/bt5/slapos_wechat/TestTemplateItem/portal_components/test.erp5.testSlapOSWechatSkins.py
View file @
010cd409
...
...
@@ -169,6 +169,7 @@ class TestSlapOSPaymentTransaction_createWechatEvent(SlapOSTestCaseMixinWithAbor
REQUEST
=
{})
def
test_createWechatEvent_newPayment
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_wechat_test
.
setReference
(
"PSERV-Wechat-Test"
)
payment_transaction
=
self
.
createPaymentTransaction
()
wechat_event
=
payment_transaction
.
PaymentTransaction_createWechatEvent
()
self
.
assertEqual
(
wechat_event
.
getPortalType
(),
"Wechat Event"
)
...
...
@@ -177,6 +178,8 @@ class TestSlapOSPaymentTransaction_createWechatEvent(SlapOSTestCaseMixinWithAbor
self
.
assertEqual
(
wechat_event
.
getDestination
(),
payment_transaction
.
getRelativeUrl
())
def
test_createWechatEvent_kwParameter
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_wechat_test
.
setReference
(
"PSERV-Wechat-Test"
)
self
.
tic
()
payment_transaction
=
self
.
createPaymentTransaction
()
wechat_event
=
payment_transaction
.
PaymentTransaction_createWechatEvent
(
title
=
'foo'
)
...
...
@@ -523,7 +526,6 @@ return addToDate(DateTime(), to_add={'day': -1, 'second': -1}).toZone('UTC'), 'f
payment
.
workflow_history
[
'accounting_workflow'
][
-
1
][
'comment'
])
class
TestSlapOSWechatBase_getWechatServiceRelativeUrl
(
SlapOSTestCaseMixinWithAbort
):
def
test_getWechatServiceRelativeUrl_REQUEST_disallowed
(
self
):
self
.
assertRaises
(
Unauthorized
,
...
...
@@ -531,9 +533,18 @@ class TestSlapOSWechatBase_getWechatServiceRelativeUrl(SlapOSTestCaseMixinWithAb
REQUEST
=
{})
def
test_getWechatServiceRelativeUrl_default_result
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_wechat_test
.
setReference
(
"PSERV-Wechat-Test"
)
self
.
tic
()
result
=
self
.
portal
.
Base_getWechatServiceRelativeUrl
()
self
.
assertEqual
(
result
,
'portal_secure_payments/slapos_wechat_test'
)
def
test_getWechatServiceRelativeUrl_not_found
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_wechat_test
.
setReference
(
"disabled"
)
self
.
tic
()
result
=
self
.
portal
.
Base_getWechatServiceRelativeUrl
()
self
.
assertEqual
(
result
,
None
)
class
TestSlapOSWechatPaymentTransaction_redirectToManualWechatPayment
(
SlapOSTestCaseMixinWithAbort
):
...
...
@@ -577,6 +588,7 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
self
.
_dropPaymentTransaction_getVADSUrlDict
()
def
test_PaymentTransaction_redirectToManualWechatPayment_redirect
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_wechat_test
.
setReference
(
"PSERV-Wechat-Test"
)
person
=
self
.
makePerson
()
invoice
=
self
.
createStoppedSaleInvoiceTransaction
(
payment_mode
=
"wechat"
,
...
...
@@ -621,6 +633,7 @@ return dict(vads_url_already_registered="%s/already_registered" % (payment_trans
transaction
.
abort
()
def
test_PaymentTransaction_redirectToManualWechatPayment_redirect_with_website
(
self
):
self
.
portal
.
portal_secure_payments
.
slapos_wechat_test
.
setReference
(
"PSERV-Wechat-Test"
)
person
=
self
.
makePerson
()
invoice
=
self
.
createStoppedSaleInvoiceTransaction
(
payment_mode
=
"wechat"
,
...
...
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