diff --git a/src/pretix/plugins/paypal/payment.py b/src/pretix/plugins/paypal/payment.py index 8817b13322..e6a721d756 100644 --- a/src/pretix/plugins/paypal/payment.py +++ b/src/pretix/plugins/paypal/payment.py @@ -2,6 +2,7 @@ import json import logging import urllib.parse from collections import OrderedDict +from decimal import Decimal import paypalrestsdk from django import forms @@ -26,6 +27,11 @@ from pretix.plugins.paypal.models import ReferencedPayPalObject logger = logging.getLogger('pretix.plugins.paypal') +SUPPORTED_CURRENCIES = ['AUD', 'BRL', 'CAD', 'CZK', 'DKK', 'EUR', 'HKD', 'HUF', 'INR', 'ILS', 'JPY', 'MYR', 'MXN', + 'TWD', 'NZD', 'NOK', 'PHP', 'PLN', 'GBP', 'RUB', 'SGD', 'SEK', 'CHF', 'THB', 'USD'] + +LOCAL_ONLY_CURRENCIES = ['INR'] + class Paypal(BasePaymentProvider): identifier = 'paypal' @@ -106,10 +112,11 @@ class Paypal(BasePaymentProvider): return Tokeninfo.authorize_url({'scope': 'openid profile email'}) def settings_content_render(self, request): + settings_content = "" if self.settings.connect_client_id and not self.settings.secret: # Use PayPal connect if not self.settings.connect_user_id: - return ( + settings_content = ( "
{}
" "{}" ).format( @@ -120,7 +127,7 @@ class Paypal(BasePaymentProvider): _('Connect with {icon} PayPal').format(icon='') ) else: - return ( + settings_content = ( "" ).format( reverse('plugins:paypal:oauth.disconnect', kwargs={ @@ -130,12 +137,35 @@ class Paypal(BasePaymentProvider): _('Disconnect from PayPal') ) else: - return "%s%s