Payment/Paypal: add warning about UTF-8 config

Closes #60
This commit is contained in:
Pedro Ferreira 2019-06-14 17:01:43 +02:00 committed by Adrian Moennich
parent 9db962aba2
commit a570a6bd4a
3 changed files with 21 additions and 2 deletions

View File

@ -7,6 +7,8 @@
from __future__ import unicode_literals
from flask_pluginengine import render_plugin_template
from wtforms.fields.core import StringField
from wtforms.fields.html5 import URLField
from wtforms.validators import DataRequired, Optional
@ -50,6 +52,10 @@ class PaypalPaymentPlugin(PaymentPluginMixin, IndicoPlugin):
'method_name': None,
'business': None}
def init(self):
super(PaypalPaymentPlugin, self).init()
self.template_hook('event-manage-payment-plugin-before-form', self._get_encoding_warning)
@property
def logo_url(self):
return url_for_plugin(self.name + '.static', filename='images/logo.png')
@ -67,3 +73,7 @@ class PaypalPaymentPlugin(PaymentPluginMixin, IndicoPlugin):
data['return_url'] = url_for_plugin('payment_paypal.success', registration.locator.uuid, _external=True)
data['cancel_url'] = url_for_plugin('payment_paypal.cancel', registration.locator.uuid, _external=True)
data['notify_url'] = url_for_plugin('payment_paypal.notify', registration.locator.uuid, _external=True)
def _get_encoding_warning(self, plugin=None, event=None):
if plugin == self:
return render_plugin_template('event_settings_encoding_warning.html')

View File

@ -0,0 +1,9 @@
{% from 'message_box.html' import message_box %}
{% call message_box('warning', fixed_width=true) %}
{%- trans link='<a href="https://www.paypal.com/al/smarthelp/article/why-did-i-get-the-error-paypal-cannot-process-this-transaction-because-of-a-problem-with-the-seller%27s-website-ts1628" target="_blank">'|safe, endlink='</a>'|safe -%}
Please make sure that you have your PayPal seller account configured to use <strong>UTF-8</strong> by default,
otherwise some transactions may end up not being acknowledged by Indico!<br>
You can find out how to set this up {{ link }}here{{ endlink }}.
{%- endtrans -%}
{% endcall %}

View File

@ -12,7 +12,7 @@ from setuptools import find_packages, setup
setup(
name='indico-plugin-payment-paypal',
version='1.0',
version='2.2-dev',
description='PayPal payments for Indico event registration fees',
url='https://github.com/indico/indico-plugins',
license='MIT',
@ -22,7 +22,7 @@ setup(
zip_safe=False,
include_package_data=True,
install_requires=[
'indico>=2.0'
'indico>=2.2.dev0'
],
classifiers=[
'Environment :: Plugins',