Validate signature in the IPN
-
Merci à Mathieu pour ce plugin bien utile ! (now switching to English for the benefit of others).
I have installed the plugin and I’m running it in test mode at the moment. Everything works fine except the validation of the signature received from PayPlug in the IPN. This is probably because I can’t get hold of the correct PayPlug public key – and their support team seems to think that since I use this plugin, this is not their problem.I’m building my code on an example I found in the PayPlug API doc, with basically these steps:
$headers = getallheaders(); $headers = array_change_key_case($headers, CASE_UPPER); $signature = base64_decode($headers['PAYPLUG-SIGNATURE']); $body = file_get_contents('php://input'); $data = json_decode($body); $publicKey = openssl_pkey_get_public($pbkey); $isSignatureValid = (openssl_verify($body , $signature, $publicKey, OPENSSL_ALGO_SHA1) === 1);
This always fails, probably because I don’t have the correct value in
$pbkey
.
All other data received in the IPN looks fine.Any ideas?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Validate signature in the IPN’ is closed to new replies.