Commit 5feaeac4 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_advanced_ecommerce_test: add wechat payment test

parent cb523ac3
<?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>
<?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>
<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
......@@ -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>1588089266.61</float>
<float>1589446600.14</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -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>1587975634.77</float>
<float>1589446592.66</float>
<string>UTC</string>
</tuple>
</state>
......
<?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>
......@@ -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>1587654313.75</float>
<float>1589446316.17</float>
<string>UTC</string>
</tuple>
</state>
......
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'
})
......@@ -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
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment