@ -211,7 +211,10 @@ class StripeBackend(BackendBase):
payment.paid_amount = payment.amount
payment.backend_extid = invoice['id']
if invoice['subscription']:
payment.backend_sub_id = invoice['subscription']['id']
if isinstance(invoice['subscription'], str):
payment.backend_sub_id = invoice['subscription']
else:
payment.backend_data = {'event_id': event['id']}
payment.save()