forked from CGM_Public/pretix_original
Fixed bugs in the PayPal implementation
This commit is contained in:
@@ -17,7 +17,6 @@ logger = logging.getLogger('pretix.plugins.paypal')
|
|||||||
|
|
||||||
|
|
||||||
class Paypal(BasePaymentProvider):
|
class Paypal(BasePaymentProvider):
|
||||||
|
|
||||||
identifier = 'paypal'
|
identifier = 'paypal'
|
||||||
verbose_name = _('PayPal')
|
verbose_name = _('PayPal')
|
||||||
payment_form_fields = OrderedDict([
|
payment_form_fields = OrderedDict([
|
||||||
@@ -67,7 +66,7 @@ class Paypal(BasePaymentProvider):
|
|||||||
items = []
|
items = []
|
||||||
for cp in cart['positions']:
|
for cp in cart['positions']:
|
||||||
items.append({
|
items.append({
|
||||||
"name": cp.item.name,
|
"name": str(cp.item.name),
|
||||||
"description": str(cp.variation) if cp.variation else "",
|
"description": str(cp.variation) if cp.variation else "",
|
||||||
"quantity": cp.count,
|
"quantity": cp.count,
|
||||||
"price": str(cp.price),
|
"price": str(cp.price),
|
||||||
@@ -187,7 +186,7 @@ class Paypal(BasePaymentProvider):
|
|||||||
def order_pending_render(self, request, order) -> str:
|
def order_pending_render(self, request, order) -> str:
|
||||||
retry = True
|
retry = True
|
||||||
try:
|
try:
|
||||||
if order.payment_info and json.loads(order.payment_info)['state'] != 'pending':
|
if order.payment_info and json.loads(order.payment_info)['state'] == 'pending':
|
||||||
retry = False
|
retry = False
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user