Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
8b2a1731
Commit
8b2a1731
authored
May 15, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Plain Diff
Wechat payment
See merge request !1123
parents
4ec60c39
5feaeac4
Changes
26
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
2010 additions
and
34 deletions
+2010
-34
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_checkWechatPaymentStatus.py
...advanced_ecommerce/WebSection_checkWechatPaymentStatus.py
+1
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_checkWechatPaymentStatus.xml
...dvanced_ecommerce/WebSection_checkWechatPaymentStatus.xml
+70
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_finalizeShopping.py
...ns/erp5_advanced_ecommerce/WebSection_finalizeShopping.py
+2
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_finalizeShopping.xml
...s/erp5_advanced_ecommerce/WebSection_finalizeShopping.xml
+1
-1
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_viewWechatPayment.xml
.../erp5_advanced_ecommerce/WebSection_viewWechatPayment.xml
+109
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_viewWechatPayment/your_wechat_payment.xml
...erce/WebSection_viewWechatPayment/your_wechat_payment.xml
+322
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_viewWechatPaymentWidget.xml
...advanced_ecommerce/WebSection_viewWechatPaymentWidget.xml
+58
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_viewWechatPaymentWidget.zpt
...advanced_ecommerce/WebSection_viewWechatPaymentWidget.zpt
+73
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_image/wechat_description.png.png
...merce/advanced_ecommerce_image/wechat_description.png.png
+0
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_image/wechat_description.png.xml
...merce/advanced_ecommerce_image/wechat_description.png.xml
+36
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_image/wechat_image.png.png
...d_ecommerce/advanced_ecommerce_image/wechat_image.png.png
+0
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_image/wechat_image.png.xml
...d_ecommerce/advanced_ecommerce_image/wechat_image.png.xml
+36
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_layout/cart_box.xml
...advanced_ecommerce/advanced_ecommerce_layout/cart_box.xml
+26
-1
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/portal_categories/payment_mode/wechat.xml
...athTemplateItem/portal_categories/payment_mode/wechat.xml
+85
-0
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/portal_tests/advanced_ecommerce_zuite/test023WechatPayment.xml
...l_tests/advanced_ecommerce_zuite/test023WechatPayment.xml
+58
-0
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/portal_tests/advanced_ecommerce_zuite/test023WechatPayment.zpt
...l_tests/advanced_ecommerce_zuite/test023WechatPayment.zpt
+187
-0
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/sale_trade_condition_module/test_loyalty_reward_paypal.xml
...ale_trade_condition_module/test_loyalty_reward_paypal.xml
+3
-5
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/sale_trade_condition_module/test_sale_trade_condition.xml
...sale_trade_condition_module/test_sale_trade_condition.xml
+11
-5
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/sale_trade_condition_module/test_wechat_sale_trade_condition.xml
...ade_condition_module/test_wechat_sale_trade_condition.xml
+337
-0
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/sale_trade_condition_module/test_wechat_sale_trade_condition/default_payment_condition.xml
...wechat_sale_trade_condition/default_payment_condition.xml
+155
-0
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/web_site_module/ecommerce_example.xml
...st/PathTemplateItem/web_site_module/ecommerce_example.xml
+12
-15
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/web_site_module/ecommerce_example/wechat_payment.xml
...Item/web_site_module/ecommerce_example/wechat_payment.xml
+409
-0
bt5/erp5_advanced_ecommerce_test/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce_test/WebSection_viewConfirmPayment.py
..._advanced_ecommerce_test/WebSection_viewConfirmPayment.py
+11
-3
bt5/erp5_advanced_ecommerce_test/bt/template_keep_last_workflow_history_only_path_list
...est/bt/template_keep_last_workflow_history_only_path_list
+3
-1
bt5/erp5_advanced_ecommerce_test/bt/template_path_list
bt5/erp5_advanced_ecommerce_test/bt/template_path_list
+3
-0
bt5/erp5_wechat_secure_payment/DocumentTemplateItem/portal_components/document.erp5.WechatService.py
...lateItem/portal_components/document.erp5.WechatService.py
+2
-2
No files found.
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_checkWechatPaymentStatus.py
0 → 100644
View file @
8b2a1731
raise
NotImplementedError
(
'You should override this script'
)
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_checkWechatPaymentStatus.xml
0 → 100644
View file @
8b2a1731
<?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>
trade_no,**kw
</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>
WebSection_checkWechatPaymentStatus
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_finalizeShopping.py
View file @
8b2a1731
...
...
@@ -38,4 +38,5 @@ for amount in sale_order.getAggregatedAmountList():
# clean up shopping cart
context
.
WebSection_resetShoppingCart
()
# Display nice message
context
.
Base_redirect
(
'SaleOrder_viewThankYouMessage'
)
if
not
batch_mode
:
context
.
Base_redirect
(
'SaleOrder_viewThankYouMessage'
)
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_finalizeShopping.xml
View file @
8b2a1731
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
batch_mode=False
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_viewWechatPayment.xml
0 → 100644
View file @
8b2a1731
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ERP5 Form"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
enctype
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<list>
<string>
left
</string>
<string>
right
</string>
<string>
center
</string>
<string>
bottom
</string>
<string>
hidden
</string>
</list>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
bottom
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
center
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
left
</string>
</key>
<value>
<list>
<string>
your_wechat_payment
</string>
</list>
</value>
</item>
<item>
<key>
<string>
right
</string>
</key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSection_viewWechatPayment
</string>
</value>
</item>
<item>
<key>
<string>
method
</string>
</key>
<value>
<string>
POST
</string>
</value>
</item>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
WebSection_viewWechatPayment
</string>
</value>
</item>
<item>
<key>
<string>
row_length
</string>
</key>
<value>
<int>
4
</int>
</value>
</item>
<item>
<key>
<string>
stored_encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
unicode_mode
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_viewWechatPayment/your_wechat_payment.xml
0 → 100644
View file @
8b2a1731
This diff is collapsed.
Click to expand it.
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_viewWechatPaymentWidget.xml
0 → 100644
View file @
8b2a1731
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<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_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
WebSection_viewWechatPaymentWidget
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/WebSection_viewWechatPaymentWidget.zpt
0 → 100644
View file @
8b2a1731
<tal:block tal:define="payment_url python: request.get('payment_url', '');
price python: int(request.get('price', '0')) / 100.0;
trade_no python: request.get('trade_no', '')
" >
<p>请使用微信扫描下方二维码来完成支付</p>
<input id='trade_no' type="hidden" tal:attributes="value python: trade_no">
<h2 style="float:left;">支付 <span tal:content="python: price"></span> 元</h2>
<div style="clear:both"></div>
<div style="position:absolute;left:50%;">
<div class='qr_code' position='relative'>
<div class="qr_code_wrapper" style="line-height: 300px;
display:none;
text-align: center;
position: absolute;
font-size: 14px;
color: #fff;
background: rgba(0,0,0,.6);
width: 300px;
height: 300px;
cursor: pointer;">
<span style='display: block;font-size: 14px;color: #fff;margin-top: 10px;'>请点击继续</span>
</div>
<img class="wechat_qrcode" width="294" style="border: 1px solid grey;"
tal:attributes="src python:'Base_generateBarcodeImage?barcode_type=qrcode&data=%s' % payment_url">
</div>
<img src="advanced_ecommerce_image/wechat_description.png" width="300">
</div>
<script>
$(document).ready(function() {
var timer = 0,
wrapper = $(".qr_code_wrapper"),
trade_no = $('#trade_no').val(),
loop;
function restartCheckingIfNeeded() {
timer += 1;
if (timer > 40) {
wrapper.css("display", "block");
} else {
console.log('restart')
setTimeout(checkPaymentStatus, 3000);
}
}
function checkPaymentStatus(){
$.ajax({
url:'WebSection_checkWechatPaymentStatus',
data:{
trade_no: trade_no
},
success:function(result_dict){
result_dict = JSON.parse(result_dict);
if (result_dict['status'] == 'success') {
window.location.href="SaleOrder_viewThankYouMessage";
} else if (result_dict['status'] == 'cancelled') {
window.location.href="?portal_status_message=订单已取消"
} else {
restartCheckingIfNeeded();
}
},
error: function (error){
console.log(error);
restartCheckingIfNeeded();
}
});
}
checkPaymentStatus()
wrapper.click(function() {
timer = 0;
wrapper.css("display", "none");
setTimeout(checkPaymentStatus, 3000)
});
});
</script>
</tal:block>
\ No newline at end of file
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_image/wechat_description.png.png
0 → 100644
View file @
8b2a1731
7 KB
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_image/wechat_description.png.xml
0 → 100644
View file @
8b2a1731
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Image"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
wechat_description.png
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
image/png
</string>
</value>
</item>
<item>
<key>
<string>
height
</string>
</key>
<value>
<int>
86
</int>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
width
</string>
</key>
<value>
<int>
260
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_image/wechat_image.png.png
0 → 100644
View file @
8b2a1731
7.08 KB
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_image/wechat_image.png.xml
0 → 100644
View file @
8b2a1731
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Image"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
wechat_image.png
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
image/png
</string>
</value>
</item>
<item>
<key>
<string>
height
</string>
</key>
<value>
<int>
86
</int>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
width
</string>
</key>
<value>
<int>
103
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/advanced_ecommerce_layout/cart_box.xml
View file @
8b2a1731
...
...
@@ -9,7 +9,9 @@
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list/>
<list>
<string>
enabled
</string>
</list>
</value>
</item>
<item>
...
...
@@ -50,6 +52,12 @@
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
...
...
@@ -69,6 +77,10 @@
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
cart_box
</string>
</value>
...
...
@@ -87,4 +99,17 @@
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: not request.get(\'payment_url\', None) and len(here.SaleOrder_getShoppingCartItemList())
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/portal_categories/payment_mode/wechat.xml
0 → 100644
View file @
8b2a1731
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_folders_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Copy_or_Move_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Delete_objects_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
codification
</string>
</key>
<value>
<string>
WC
</string>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
WC
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
wechat
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Wechat
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/portal_tests/advanced_ecommerce_zuite/test023WechatPayment.xml
0 → 100644
View file @
8b2a1731
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate"
/>
</pickle>
<pickle>
<dictionary>
<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_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test023WechatPayment
</string>
</value>
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<unicode></unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/portal_tests/advanced_ecommerce_zuite/test023WechatPayment.zpt
0 → 100644
View file @
8b2a1731
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
xmlns:metal=
"http://xml.zope.org/namespaces/metal"
>
<head>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
<title>
Test Front Page
</title>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test Front Page
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tal:block
metal:use-macro=
"here/ZuiteAdvancedECommerce_CommonTemplate/macros/login_as_super_user"
/>
<tr>
<td>
openAndWait
</td>
<td>
${base_url}/PurchasePackingList_deliver
</td>
<td></td>
</tr>
<tr>
<td>
verifyTextPresent
</td>
<td>
Done
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/wait_for_activities"
/>
<tal:block
metal:use-macro=
"here/ZuiteAdvancedECommerce_CommonTemplate/macros/logout"
/>
<tal:block
metal:use-macro=
"here/ZuiteAdvancedECommerce_CommonTemplate/macros/reset_shopcart"
/>
<tr>
<td>
setTimeout
</td>
<td>
300000
</td>
<td></td>
</tr>
<tr>
<td>
openAndWait
</td>
<td>
${base_url}/web_site_module/ecommerce_example
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class="header_login"]
</td>
<td></td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
//a[contains(@href, "test_normal_product")]
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//select[@name="field_your_buy_quantity"]
</td>
<td>
2
</td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
//input[@value="Add to cart"]
</td>
<td></td>
</tr>
<tr>
<td>
verifyTextPresent
</td>
<td>
Added to cart.
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementPresent
</td>
<td>
//td[@class="cart_middle"]//div[contains(text(), "280")]
</td>
<td></td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
//div[@class="left"]//div[contains(@class, "checkout")]//a[contains(@href, "cart")]
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementPresent
</td>
<td>
//div[contains(@class, "shopping_cart_renderer")]
</td>
<td></td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
//input[@value="wechat"]
</td>
<td></td>
</tr>
<tr>
<td>
verifyTextPresent
</td>
<td>
Shopping Cart Updated
</td>
<td></td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
//input[@value="Update Shipping Method"]
</td>
<td>
</tr>
<tr>
<td>
check
</td>
<td>
//input[@value="service_module/test_deliver_mode"]
</td>
<td></td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
//input[@value="Update Shipping Method"]
</td>
<td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
//input[@value="Confirm Order"]
</td>
<td></td>
</tr>
<tr>
<td>
type
</td>
<td>
//input[@name="__ac_name"]
</td>
<td>
1
</td>
</tr>
<tr>
<td>
type
</td>
<td>
//input[@name="__ac_password"]
</td>
<td>
1
</td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
//input[@value="Login"]
</td>
<td></td>
</tr>
<tr>
<td>
clickAndWait
</td>
<td>
//input[@value="Proceed to Payment"]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//img[@class="wechat_qrcode"]
</td>
<td></td>
</tr>
<tr>
<td>
verifyElementPresent
</td>
<td>
//span[contains(text(), '282.0')]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='qr_code_wrapper' and contains(@style,'display: block')]
</td>
<td></td>
</tr>
<tr>
<td>
click
</td>
<td>
//div[@class='qr_code_wrapper' and contains(@style,'display: block')]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementNotPresent
</td>
<td>
//div[@class='qr_code_wrapper' and contains(@style,'display: block')]
</td>
<td></td>
</tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
//div[@class='qr_code_wrapper' and contains(@style,'display: none')]
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/sale_trade_condition_module/test_loyalty_reward_paypal.xml
View file @
8b2a1731
...
...
@@ -125,9 +125,7 @@
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<none/>
</value>
<value>
<string>
2
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
...
...
@@ -306,7 +304,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
983.
33462.55055.26197
</string>
</value>
<value>
<string>
983.
57486.40881.52155
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -324,7 +322,7 @@
</tuple>
<state>
<tuple>
<float>
158
8089266.61
</float>
<float>
158
9446600.14
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/sale_trade_condition_module/test_sale_trade_condition.xml
View file @
8b2a1731
...
...
@@ -99,6 +99,10 @@
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
no_loyalty_reward_paypal
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
...
...
@@ -113,11 +117,13 @@
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Sale Trade Condition
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
test_sale_trade_condition
</string>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<none/>
</value>
<value>
<string>
2
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
...
...
@@ -296,7 +302,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
983.
31553.28432.33262
</string>
</value>
<value>
<string>
983.
57486.40881.52155
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -314,7 +320,7 @@
</tuple>
<state>
<tuple>
<float>
158
7975634.77
</float>
<float>
158
9446592.66
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/sale_trade_condition_module/test_wechat_sale_trade_condition.xml
0 → 100644
View file @
8b2a1731
This diff is collapsed.
Click to expand it.
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/sale_trade_condition_module/test_wechat_sale_trade_condition/default_payment_condition.xml
0 → 100644
View file @
8b2a1731
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Payment Condition"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
payment_mode/wechat
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
default_payment_condition
</string>
</value>
</item>
<item>
<key>
<string>
payment_end_of_month
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Payment Condition
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<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"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<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>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</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=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1589444608.09
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"Message"
module=
"Products.ERP5Type.Message"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string>
Object copied from ${source_item}
</string>
</value>
</item>
<item>
<key>
<string>
domain
</string>
</key>
<value>
<string>
erp5_ui
</string>
</value>
</item>
<item>
<key>
<string>
mapping
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
source_item
</string>
</key>
<value>
<string>
/erp5/sale_trade_condition_module/test_sale_trade_condition
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
message
</string>
</key>
<value>
<string>
Object copied from ${source_item}
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/web_site_module/ecommerce_example.xml
View file @
8b2a1731
...
...
@@ -452,6 +452,7 @@
<value>
<tuple>
<string>
paypal
</string>
<string>
wechat
</string>
</tuple>
</value>
</item>
...
...
@@ -572,9 +573,7 @@
</item>
<item>
<key>
<string>
site_delivery_message_template
</string>
</key>
<value>
<none/>
</value>
<value>
<string>
test_deliver_info
</string>
</value>
</item>
<item>
<key>
<string>
site_loyalty_agreement_template
</string>
</key>
...
...
@@ -582,21 +581,21 @@
<none/>
</value>
</item>
<item>
<key>
<string>
site_loyalty_explanation_template
</string>
</key>
<value>
<string>
test_loyalty_explanation
</string>
</value>
</item>
<item>
<key>
<string>
site_map_section_parent
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
site_message_template
</string>
</key>
<value>
<none/>
</value>
<value>
<string>
test_site_warning
</string>
</value>
</item>
<item>
<key>
<string>
site_payment_message_template
</string>
</key>
<value>
<none/>
</value>
<value>
<string>
test_payment_info
</string>
</value>
</item>
<item>
<key>
<string>
site_product_individual_variation
</string>
</key>
...
...
@@ -610,9 +609,7 @@
</item>
<item>
<key>
<string>
site_return_message_template
</string>
</key>
<value>
<none/>
</value>
<value>
<string>
test_return_info
</string>
</value>
</item>
<item>
<key>
<string>
skin_selection_name
</string>
</key>
...
...
@@ -848,7 +845,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
<value>
<string>
super_user
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -862,7 +859,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
983.
26197.28731.24251
</string>
</value>
<value>
<string>
983.
57522.65528.2594
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -880,7 +877,7 @@
</tuple>
<state>
<tuple>
<float>
158
7654313.75
</float>
<float>
158
9446316.17
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_advanced_ecommerce_test/PathTemplateItem/web_site_module/ecommerce_example/wechat_payment.xml
0 → 100644
View file @
8b2a1731
This diff is collapsed.
Click to expand it.
bt5/erp5_advanced_ecommerce_test/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce_test/WebSection_viewConfirmPayment.py
View file @
8b2a1731
payment_mode
=
payment_mode
.
lower
()
person
=
context
.
ERP5Site_getAuthenticatedMemberPersonValue
()
context
.
WebSection_persistShoppingCart
(
shopping_cart
,
person
)
return
context
.
Base_redirect
(
'view'
,
sale_order
=
context
.
WebSection_persistShoppingCart
(
shopping_cart
,
person
)
if
payment_mode
==
'paypal'
:
return
context
.
Base_redirect
(
'view'
,
keep_items
=
{
"portal_status_message"
:
"payment confirmed"
})
if
payment_mode
==
'wechat'
:
return
context
.
Base_redirect
(
'wechat_payment'
,
keep_items
=
{
'trade_no'
:
sale_order
.
getReference
().
encode
(
'utf-8'
),
'price'
:
int
(
round
((
shopping_cart
.
SaleOrder_getFinalPrice
()
*
100
),
0
)),
'payment_url'
:
'weixin'
})
bt5/erp5_advanced_ecommerce_test/bt/template_keep_last_workflow_history_only_path_list
View file @
8b2a1731
...
...
@@ -28,4 +28,6 @@ sale_trade_condition_module/test_loyalty_reward_paypal
sale_trade_condition_module/test_loyalty_reward_paypal/**
service_module/test_loyalty_discount
service_module/test_loyalty_using_point
service_module/test_loyalty_collect_point
\ No newline at end of file
service_module/test_loyalty_collect_point
sale_trade_condition_module/test_wechat_sale_trade_condition
sale_trade_condition_module/test_wechat_sale_trade_condition/**
\ No newline at end of file
bt5/erp5_advanced_ecommerce_test/bt/template_path_list
View file @
8b2a1731
currency_module/test_eur
organisation_module/test_warehouse
portal_categories/colour**
portal_categories/payment_mode/wechat
portal_categories/product_line/shipping/post
portal_categories/size/paris**
portal_tests/advanced_ecommerce_zuite
...
...
@@ -20,6 +21,8 @@ sale_trade_condition_module/test_loyalty_reward_paypal
sale_trade_condition_module/test_loyalty_reward_paypal/**
sale_trade_condition_module/test_sale_trade_condition
sale_trade_condition_module/test_sale_trade_condition/**
sale_trade_condition_module/test_wechat_sale_trade_condition
sale_trade_condition_module/test_wechat_sale_trade_condition/**
service_module/test_deliver_mode
service_module/test_deliver_mode/**
service_module/test_loyalty_collect_point
...
...
bt5/erp5_wechat_secure_payment/DocumentTemplateItem/portal_components/document.erp5.WechatService.py
View file @
8b2a1731
...
...
@@ -248,10 +248,10 @@ class WechatService(XMLObject):
'In Navigate'
,
error
=
False
)
portal
=
self
.
getPortalObject
()
base_url
=
portal
.
absolute_url
(
)
base_url
=
wechat_dict
.
pop
(
'base_url'
,
'%s/#wechat_payment'
%
portal
.
absolute_url
()
)
return
self
.
REQUEST
.
RESPONSE
.
redirect
(
"%s
/#wechat_payment
?trade_no=%s&price=%s&payment_url=%s"
%
(
"%s?trade_no=%s&price=%s&payment_url=%s"
%
(
base_url
,
wechat_dict
[
'out_trade_no'
],
wechat_dict
[
'total_fee'
],
...
...
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