Closed ariefrizkyr closed 3 years ago
I tried to install the plugin to the root domain, however, the notification handling is not working and it didn't update the order status.
I found that the Common/JokulUtils.php code looks like this:
public function generateSignatureNotification($headers, $body, $secret) { $digest = base64_encode(hash('sha256', $body, true)); $rawSignature = "Client-Id:" . $headers['Client-Id'] . "\n" . "Request-Id:" . $headers['Request-Id'] . "\n" . "Request-Timestamp:" . $headers['Request-Timestamp'] . "\n" . "Request-Target:" ."/wordpress/wp-json/jokul/notification". "\n" . "Digest:" . $digest; $signature = base64_encode(hash_hmac('sha256', $rawSignature, htmlspecialchars_decode($secret), true)); return 'HMACSHA256=' . $signature; }
The Request-Target is set fixed into the /wordpress/ path. I will make a pull request to set the path relative.
Request-Target
/wordpress/
So, if my website is https://example.com/ then it will not work. Also, if my website is https://example.com/other-path/ It will not work neither.
https://example.com/
https://example.com/other-path/
I tried to install the plugin to the root domain, however, the notification handling is not working and it didn't update the order status.
I found that the Common/JokulUtils.php code looks like this:
The
Request-Target
is set fixed into the/wordpress/
path. I will make a pull request to set the path relative.So, if my website is
https://example.com/
then it will not work. Also, if my website ishttps://example.com/other-path/
It will not work neither.