Commit 606415d7 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_wechat: Drop unused script

   Script was renamed long ago but never used in the end.
parent ed2c746f
......@@ -189,7 +189,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',
......
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()])
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</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>web_site=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>PaymentTransaction_redirectToWechatPayment</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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