我在最后几天尝试了很多东西,但现在我没有想法:(
我想验证在我的Android应用程序中创建的inAppPurchase.
1)我在google API控制台中创建了一个新的服务帐户.
1a)服务帐户列出了非权限,并具有"可以查看"权限
2)我使用的是最新版本的https://github.com/google/google-api-php-client
3)PHP脚本中的代码片段:
$client = new Google_Client();
$client->setApplicationName('myAppName' );
$client->setClientId('123456789123-vxoasdt8qwe6awerc9ysdfmjysdfysf64werweria8fh.apps.googleusercontent.com');
$key = file_get_contents('/shr/data/stor/b516cexx3123asdf3988345d8133e7f86bfas2553-privatekey.p12');
$service_account_name = '123456789123-vxoasdt8qwe6awerc9ysdfmjysdfysf64werweria8fh@developer.gserviceaccount.com';
$client->setScopes(array('https://www.googleapis.com/auth/androidpublisher') );
$cred = new Google_Auth_AssertionCredentials( $service_account_name, array('https://www.googleapis.com/auth/androidpublisher'), $key );
$client->setAssertionCredentials($cred);
try {
$service = new Google_Service_AndroidPublisher( $client );
$googleApiResult = $service->inapppurchases->get($externalAppId, $externalProductId, $purchaseToken);
} catch (Exception $e) {
var_dump( $e->getMessage() );
}
Run Code Online (Sandbox Code Playgroud)
4)Google的回复:
获取https://www.googleapis.com/androidpublisher/v1.1/applications/de.test.myapp/inapp/de.test.inapp.google.balance5eur/purchases/[PURCHASETOKEN] :( 401)当前用户已拥有权限不足以执行请求的操作.
[PURCHASETOKEN]是我从谷歌收到的购买代币
5)将$ cred-> sub ='foo@bar.de'设置为我的邮件地址
刷新OAuth2令牌时出错,消息:'{"error":"unauthorized_client","error_description":"请求中未经授权的客户端或范围".}"
在Cordova/Phonegap中是否有可能使用SIP?我还没找到任何插件.WebRTC的支持也不可用(但根据其路线图计划在2.x中).
我正在拼命寻找从PHP生成SNMP陷阱的方法.我知道使用snmpget的方法的构建,但我无法弄清楚如何发送SNMP陷阱.
有人知道它的类/代码片段吗?除了使用exec调用cli工具之外,搜索网络并没有提出任何其他内容,这对我来说绝对没有选择.
我怀疑使用socket_create和相应的功能来手动生成UDP包是必要的...