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'] ?: ''; switch ($type) { case 'payment_intent.succeeded': case 'payment_intent.requires_capture': $this->airwallex->paymentSucceeded($orderId, $transactionId); break; default: // 对于未知事件类型,记录日志但仍返回成功 @header("HTTP/1.0 200 ok"); break; } } }