CheckoutFinland / checkout-finland-php-sdk

PHP SDK for using Checkout Finland payment service
https://www.checkout.fi
MIT License
5 stars 8 forks source link

Validating callback calls #18

Closed vlahde closed 3 years ago

vlahde commented 4 years ago

How to validate callback calls? These calls seem to only include cof-request-id header and none of the checkout- labeled headers as described in the documentation or am I again missing something? Thanks.

vlahde commented 4 years ago

Let me clarify my question because the problem still persist. I make the payment, it is successfull. I have defined callback urls and callback url is called. But as far as I understand the current documentation the callback request should contain headers in order to calculte hmac.

Using this like in the document:

$responseHeaders = array_column(array_map(function ($key, $value) { return [ $key, $value ]; }, array_keys(getallheaders()), array_values(getallheaders())), 1, 0);

Will only result in:

{ "Host": "credio.fi", "Accept-Encoding": "gzip, deflate", "user-agent": "Checkout Finland payment registration", "cof-request-id": "a23ed283-76f7-4d98-9e9f-462c6a03f9b5", "Connection": "close" }

So callback request headers don't seem to include any of checkout- headers as described in the document.

Can you help me?