Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client error - Truncated response - 400 Bad Request #23

Open
ghost opened this issue Apr 19, 2021 · 2 comments
Open

Client error - Truncated response - 400 Bad Request #23

ghost opened this issue Apr 19, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 19, 2021

  • Laravel Amazon MWS Version: 0.1
  • PHP Version: 7.4

Description:

This is my implementation:
function orders() { $response = AmazonMWS::orders()->get("1234-1234-1234"); return $response; }

My .env has the correct credentials, but I got a Client error = SignatureDoesNotMatch

Is something missing? Thanks

@ghost ghost changed the title Client error - Truncated response Client error - Truncated response - 400 Bad Request Apr 19, 2021
@LooxisDev
Copy link
Contributor

LooxisDev commented Apr 20, 2021

Hi @jessmnk92 , thanks for trying out this package.
The package doesn't handle Exceptions, but you can try catch it for yourself and read out the error response.
This package is using the Guzzle HTTP Client. Here is something about the Exceptions: https://docs.guzzlephp.org/en/stable/quickstart.html#exceptions
It's truncated by default

try {
            return AmazonMWS::orders()->get("1234-1234-1234");
        } catch (\GuzzleHttp\Exception\RequestException $e) {
            \Log::error($e->getResponse()->getBody()->getContents());
        }

You can log or dump your exception to get the Full Error Response.
But you need to check which Exception is the right one you are catching. Could be RequestException or ServerException.

SignatureDoesNotMatch
Sounds like something is missing for the signature building.
Which marketplace do you set as the default?

Does the list() method work for you? Maybe your Amazon Order ID in the get() method does not exist.
"1234-1234-1234" was just a dummy

Also:
Your wrote your are using the 0.1 version.
Try to update to one of the latest releases:
https://github.com/looxis/laravel-amazon-mws/releases

@sakibanda
Copy link

I faced the same issue when updated secret key and found for some reason secret_key is not same as MWS_SECRET_KEY in .env

Is this variable cache somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants