handle capture ressource

This commit is contained in:
Lukas Bockstaller
2026-08-06 12:49:24 +02:00
parent 588abffdd3
commit 70c55730a3
+5 -2
View File
@@ -361,10 +361,13 @@ def webhook(request, *args, **kwargs):
return HttpResponse("Not interested in this resource type", status=200)
# Retrieve the Charge ID of the refunded payment
if event_json['resource_type'] == 'refund':
if event_json['resource_type'] == 'checkout-order':
payloadid = event_json['resource']['id']
elif event_json['resource_type'] == 'refund' or event_json['resource_type'] == 'capture':
payloadid = get_link(event_json['resource']['links'], 'up')['href'].split('/')[-1]
else:
payloadid = event_json['resource']['id']
logger.exception('Unknown webhook ressource received. Event data: %s' % str(event_json))
return HttpResponse("Unable to handle ressource", status=200)
refs = [payloadid]
if event_json['resource'].get('supplementary_data', {}).get('related_ids', {}).get('order_id'):