我正在尝试在我的服务器端验证应用程序订阅中的谷歌。
在我看来,我需要为此创建一个服务帐户。
我已经有一个“OldProject”链接到我的Google Play帐户,所以现在,我在项目“OldProject”下创建了一个服务帐户,在整个项目上具有“所有者角色”。
但由于某种原因,当我使用此服务帐户并尝试验证purchaseToken时,我收到错误“当前用户没有足够的权限来执行请求的操作”。
我正在使用这里的 PHP 验证器https://github.com/aporat/store-receipt-validator
但我不断收到此错误
got error = { "error": { "errors": [
{ "domain": "androidpublisher",
"reason": "permissionDenied",
"message": "The current user has insufficient permissions to perform the requested operation." } ],
"code": 401, "message": "The current user has insufficient permissions to perform the requested operation." } }
Run Code Online (Sandbox Code Playgroud)
是的,在 API 访问中,我已授予该用户作为所有应用程序的“管理员”权限
这是 PHP 代码
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
$root = realpath(dirname(dirname(__FILE__)));
$library = "$root/library";
$path = array($library, get_include_path());
set_include_path(implode(PATH_SEPARATOR, $path));
require_once $root . …Run Code Online (Sandbox Code Playgroud) android google-play google-play-services google-play-developer-api