diff --git a/src/Pay/Client.php b/src/Pay/Client.php index 225a8331f..bccc612d8 100644 --- a/src/Pay/Client.php +++ b/src/Pay/Client.php @@ -129,6 +129,11 @@ public function request(string $method, string $url, array $options = []): Respo $options['headers']['Content-Type'] = 'text/xml';/** @phpstan-ignore-line */ } } + + // 合并通过 withHeader 和 withHeaders 设置的信息 + if (!empty($this->prependHeaders)) { + $options['headers'] = array_merge($this->prependHeaders, $options['headers'] ?? []); + } return new Response($this->client->request($method, $url, $options), throw: $this->throw); }