mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Stripe: Guard against invalid JSON in API
This commit is contained in:
@@ -39,6 +39,7 @@ import re
|
||||
import urllib.parse
|
||||
from collections import OrderedDict
|
||||
from decimal import Decimal
|
||||
from json import JSONDecodeError
|
||||
|
||||
import stripe
|
||||
from django import forms
|
||||
@@ -675,9 +676,12 @@ class StripeMethod(BasePaymentProvider):
|
||||
}
|
||||
|
||||
def api_refund_details(self, refund: OrderRefund):
|
||||
return {
|
||||
"id": refund.info_data.get("id", None),
|
||||
}
|
||||
try:
|
||||
return {
|
||||
"id": refund.info_data.get("id", None),
|
||||
}
|
||||
except JSONDecodeError:
|
||||
return {}
|
||||
|
||||
def payment_control_render(self, request, payment) -> str:
|
||||
if payment.info:
|
||||
|
||||
Reference in New Issue
Block a user