I tried using this library today and was getting errors like below when clicking the checkout button in the browser:
Error Code: InvalidSignatureError
I was following the documentation here. After struggling with this issue I tried removing the call to stripcslashes on the line below.
https://github.com/amzn/amazon-pay-api-sdk-php/blob/master/Amazon/Pay/API/Client.php#L404
Without stripcslashes it looked like $hashedButtonRequest = self::AMAZON_SIGNATURE_ALGORITHM . "\n" . $this->hexAndHash($payload);. With that change suddenly my checkouts were working. I also found that mangling the value passed to payloadJSON with stripcslashes got things working as an alternative to editing the library.
Anyway, the stripcslashes seems to be causing issues.