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

Initial Test Code not working? #6

Open
simplyrahul opened this issue May 24, 2020 · 1 comment
Open

Initial Test Code not working? #6

simplyrahul opened this issue May 24, 2020 · 1 comment

Comments

@simplyrahul
Copy link

Sorry, but I am a bit of noob when it comes to this:

But, I tried for 4-5 hours to test if my credentials were working using the code provided:
// Optionally check if the supplied credentials are valid
if ($client->validateCredentials()) {
// Credentials are valid
} else {
// Credentials are not valid
}

I modified it to this to test:

// Optionally check if the supplied credentials are valid
if ($client->validateCredentials()) {
echo "worked";
} else {
echo "didn't work";
}

It kept printing didn't work and I was confused as all my credentials were working in python and scratchboard.

Causally, I tested the next code by changing the date to 2020-05-22:
$fromDate = new DateTime('2016-01-01');
$orders = $client->ListOrders($fromDate);
foreach ($orders as $order) {
$items = $client->ListOrderItems($order['AmazonOrderId']);
print_r($order);
print_r($items);
}

And I got all the details. So basic noobs like me will face issue and give up if they don't understand it. Can someone check or explain me why the initial test was not working. I didn't change anything in the "$client = new MCS\MWSClient" and below area before testing both the codes and I tested it twice.

@forecho
Copy link
Owner

forecho commented Jun 19, 2020

validateCredentials() function is not a must.

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