我有一个针对shohpify的后勤网络应用程序,但这显示了这条消息:
我读到,显然Shopify已经改变了他们希望您对应用程序进行身份验证的方式,此时我无法安装我的应用程序。
这是我的代码:
require __DIR__.'/vendor/autoload.php';
use phpish\shopify;
require __DIR__.'/conf.php';
# Guard: http://docs.shopify.com/api/authentication/oauth#verification
shopify\is_valid_request($_GET, SHOPIFY_APP_SHARED_SECRET) or die('Invalid Request! Request or redirect did not come from Shopify');
# Step 2: http://docs.shopify.com/api/authentication/oauth#asking-for-permission
if (!isset($_GET['code']))
{
$permission_url = shopify\authorization_url($_GET['shop'], SHOPIFY_APP_API_KEY, array('write_shipping', 'read_orders'));
die("<script> top.location.href='$permission_url'</script>");
}
答案 0 :(得分:2)
在GitHub上已经讨论过这个问题了。请参阅:https://github.com/phpish/shopify_app-skeleton/issues/19
作为快速解决方案,您可以在oauth.php中注释掉请求验证
# Guard: http://docs.shopify.com/api/authentication/oauth#verification
//shopify\is_valid_request($_GET, SHOPIFY_APP_SHARED_SECRET) or die('Invalid Request! Request or redirect did not come from Shopify');