Commit 982fbf10 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_payzen: Use wechat if the currency is CNY

This isn't the most suitable script for this anymore or some extra configurations can be used.
parent cf909735
portal = context.getPortalObject()
integration_site = portal.restrictedTraverse(portal.portal_preferences.getPreferredPayzenIntegrationSite())
relative_url = context.getRelativeUrl()
if relative_url == 'currency_module/CNY':
integration_site = portal.restrictedTraverse(portal.portal_preferences.getPreferredWechatIntegrationSite())
else:
integration_site = portal.restrictedTraverse(portal.portal_preferences.getPreferredPayzenIntegrationSite())
# Only EUR is supported for now
assert relative_url == 'currency_module/EUR'
assert relative_url in ('currency_module/EUR', 'currency_module/CNY')
return integration_site.getMappingFromCategory('resource/%s' % relative_url).split('/', 1)[-1]
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