|
@@ -22,7 +22,7 @@ class ApplepayController extends Controller
|
|
|
|
|
|
|
|
public function hook()
|
|
public function hook()
|
|
|
{
|
|
{
|
|
|
- $header = request()->header();
|
|
|
|
|
|
|
+ $header = $this->getAllHeaders();
|
|
|
$rawBody = request()->getContent();
|
|
$rawBody = request()->getContent();
|
|
|
$event = json_decode($rawBody, true);
|
|
$event = json_decode($rawBody, true);
|
|
|
$signatureResult = $this->applepay->webhookSignature($header, $event);
|
|
$signatureResult = $this->applepay->webhookSignature($header, $event);
|
|
@@ -44,5 +44,18 @@ class ApplepayController extends Controller
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ public function getAllHeaders()
|
|
|
|
|
+ {
|
|
|
|
|
+ $headers = array();
|
|
|
|
|
+ foreach ($_SERVER as $key => $value) {
|
|
|
|
|
+ if (substr($key, 0, 5) === 'HTTP_') {
|
|
|
|
|
+ $key = substr($key, 5);
|
|
|
|
|
+ $key = str_replace('_', ' ', $key);
|
|
|
|
|
+ $key = str_replace(' ', '-', $key);
|
|
|
|
|
+ $key = strtolower($key);
|
|
|
|
|
+ $headers[$key] = $value;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return $headers;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|