Commit cb546e14 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_stripe: add asserts to check stripe data

parent bd80ace5
......@@ -9,6 +9,9 @@ response.setHeader("Content-type", "application/json; charset=utf-8")
if context.REQUEST["method"] == "POST":
portal = context.getPortalObject()
data = json.loads(container.REQUEST.get("BODY") or "{}")
assert data, "BODY should not be empty"
assert "id" in data, "ID is missing"
assert data["object"] == "event", "Unexpected object"
system_event = portal.system_event_module.newContent(
title="WebHook Response",
portal_type="HTTP Exchange",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment