<?php include_once('./src/Google_Client.php'); include_once('./src/contrib/Google_AndroidpublisherService.php'); //user token, in json format $ANDROIDUsertoken = '{"orderId":"12999763169054705758.1323390433376399","packageName":"org.luan.hellocpp","productId":"1","purchaseTime":1394183520430,"purchaseState":0,"purchaseToken":"rurmodmieoumgowoquecqhnv.AO-J1Ow43-aM8CXNWlUcUYmA06bIaYzZPcCJCua0lLxnihOULX27Jg6NvqNUlWMpoENxtdHCIVSm6AM2mVkiC0ABSch2JEKmu1zqsVM46L762H5ppF4AIcE"}'; $user_token= json_decode($ANDROIDUsertoken,true); // https://developers.google.com/console/help/
error back:
PHP Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/androidpublisher/v1.1/applications/org.luan.hellocpp/inapp/1/purchases/rurmodmieoumgowoquecqhnv.AO-J1Ow43-aM8CXNWlUcUYmA06bIaYzZPcCJCua0lLxnihOULX27Jg6NvqNUlWMpoENxtdHCIVSm6AM2mVkiC0ABSch2JEKmu1zqsVM46L762H5ppF4AIcE: (403) Forbidden' in /var/www/debug/google/src/io/Google_REST.php:66 Stack trace: #0 /var/www/debug/google/src/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest)) #1 /var/www/debug/google/src/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest)) #2 /var/www/debug/google/src/contrib/Google_AndroidpublisherService.php(39): Google_ServiceResource->__call('get', Array) #3 /var/www/debug/google/purchase.php(32): Google_InapppurchasesServiceResource->get('org.luan.helloc...', '1', 'rurmodmieoumgow...') #4 {main} thrown in /var/www/debug/google/src/io/Google_REST.php on line 66
I got Forbidden error 403 when I use the service account to request api purchase status. The Google Play Developer API for Android has been set to the Google Developers Console. who can help me. thanks
google-api in-app-billing in-app-purchase
luanhailiang
source share