getAllHeaders(); $data = [ 'timestamp' => $header['x-timestamp'], 'signature' => $header['x-signature'], 'content' => $param ]; $result = $this->airwallex->checkSignature($data, 'secret'); if (!$result) { @header("HTTP/1.0 400 Bad Request"); exit; } $notifyData = json_decode($param, true); $orderNo = $notifyData['data']['object']['merchant_order_id'] ?: 0; if (empty($orderNo)) { @header("HTTP/1.0 400 Bad Request"); exit; } $prefix = $this->airwallex->getPrefix(); if (strpos($orderNo, $prefix) === false) { @header("HTTP/1.0 200 ok"); exit; } $type = $notifyData['name']; $orderId = str_replace($prefix, '', $orderNo); $transactionId = $notifyData['data']['object']['id'] ?: ''; $eventType = "payments_webhook_" . strtolower(str_replace(".", "_", $type)); $this->airwallex->$eventType($orderId, $transactionId); } }