Skip to content

Commit

Permalink
ACP-4589 Added option to add HTTP Status code to the WebhookResponse …
Browse files Browse the repository at this point in the history
…transfer to be able to have others allowed then the default 400 Bad Request. (#10)
  • Loading branch information
stereomon authored Jan 13, 2025
1 parent c073094 commit 984084c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function mapWebhookResponseTransferToSingleResourceGlueResponseTransfer(
$glueResponseTransfer->setHttpStatus(Response::HTTP_OK);

if ($webhookResponseTransfer->getIsSuccessful() !== true) {
$glueResponseTransfer->setHttpStatus(Response::HTTP_BAD_REQUEST);
$glueResponseTransfer->setHttpStatus($webhookResponseTransfer->getHttpStatusCode() ?? Response::HTTP_BAD_REQUEST);
$glueResponseTransfer->addError((new GlueErrorTransfer())->setMessage($webhookResponseTransfer->getMessage()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<property name="identifier" type="string" description="The identifier will be set from outside and used to find previously unprocessed webhooks and execute them when possible."/>
<property name="sequenceNumber" type="int" description="This number will be set from outside. When there were already unprocessed webhooks for the same identifier this number will be increased."/>
<property name="content" type="string"/>
<property name="httpStatusCode" type="int"/>
<property name="message" type="string"/>
</transfer>

Expand Down

0 comments on commit 984084c

Please sign in to comment.