phpclassic / php-shopify

PHP SDK for Shopify API
Apache License 2.0
568 stars 211 forks source link

Getting Error 500 #230

Open tayyabhayat opened 3 years ago

tayyabhayat commented 3 years ago

Hello @tareqtms I've started to create an app using your code but I am getting error 500.

I set up this with composer. Here is the code

require_once 'vendor/autoload.php';

$config = array(
'ShopUrl' => 'myshopify.myshopify.com',
'ApiKey' => '0fffb6*********************c94375',
'Password' => 'shpss_8a9**************************85e1796'
);

$shopify = new PHPShopify\ShopifySDK($config);

$productID = '6806572335303';
$product = $shopify->Product($productID)->get();

What I am getting in error log is following.

[16-Jun-2021 03:53:33 America/Boise] PHP Fatal error: Uncaught PHPShopify\Exception\ApiException: [API] Invalid API key or access token (unrecognized login or wrong password) in /home1/demoaspi/public_html/shopifyapp/vendor/phpclassic/php-shopify/lib/ShopifyResource.php:559 Stack trace:

0 /home1/demoaspi/public_html/shopifyapp/vendor/phpclassic/php-shopify/lib/ShopifyResource.php(347): PHPShopify\ShopifyResource->processResponse(Array, 'product')

1 /home1/demoaspi/public_html/shopifyapp/index.php(18): PHPShopify\ShopifyResource->get()

2 {main}

thrown in /home1/demoaspi/public_html/shopifyapp/vendor/phpclassic/php-shopify/lib/ShopifyResource.php on line 559

From the error log, isn't this "API secret key" a password? Please guide me if I am wrong..

I am getting this error on both "Custom app" and "Public app"

Thanks in advance.

Best regards, Muhammad Tayyab Hayat