correctifs webhoook
This commit is contained in:
parent
67d6f66f59
commit
aff562f664
@ -205,16 +205,18 @@ class PEPPOL_Webhook_controller {
|
||||
* @param array $payload Données complètes du webhook.
|
||||
* @return bool|WP_Error
|
||||
*/
|
||||
private static function process_webhook_event(string $event, string $document_id, array $payload): bool|WP_Error {
|
||||
private static function process_webhook_event(string $event, string $document_id, array $payload) {
|
||||
$document_data = $payload['document'] ?? [];
|
||||
|
||||
// Déterminer le nouveau statut selon l'événement
|
||||
$new_status = match ($event) {
|
||||
'document.sent' => 'sent',
|
||||
'document.error' => 'error',
|
||||
'document.completed' => 'completed',
|
||||
default => null,
|
||||
};
|
||||
$new_status = null;
|
||||
if ($event === 'document.sent') {
|
||||
$new_status = 'sent';
|
||||
} elseif ($event === 'document.error') {
|
||||
$new_status = 'error';
|
||||
} elseif ($event === 'document.completed') {
|
||||
$new_status = 'completed';
|
||||
}
|
||||
|
||||
if ($new_status === null) {
|
||||
return new WP_Error(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user