Fix TypeError on retrying stripe sofort payments

This commit is contained in:
Raphael Michel
2017-11-04 15:03:43 +01:00
parent 1c7df4d9f7
commit decc8b9141

View File

@@ -743,9 +743,10 @@ class StripeSofort(StripeMethod):
def order_can_retry(self, order):
try:
d = json.loads(order.payment_info)
if order.payment_info:
d = json.loads(order.payment_info)
if d.get('object') == 'charge' and d.get('status') == 'pending':
return False
except ValueError:
return self._is_still_available(order=order)
return not (
d.get('object') == 'charge' and d.get('status') == 'pending'
)
pass
return self._is_still_available(order=order)