aporat / store-receipt-validator

PHP receipt validator for Apple iTunes, Google Play and Amazon App Store
Apache License 2.0
633 stars 153 forks source link

Google_Client Not Found #43

Closed storymx closed 7 years ago

storymx commented 7 years ago

Hello.

well i;ve trying to code this example:

use ReceiptValidator\GooglePlay\Validator as PlayValidator;

$client = new \Google_Client(); $client->setApplicationName('...'); $client->setAuthConfig('...'); $client->setScopes('...');

$validator = new PlayValidator(new \Google_Service_AndroidPublisher($client));

try { $response = $validator->setPackageName('PACKAGE_NAME') ->setProductId('PRODUCT_ID') ->setPurchaseToken('PURCHASE_TOKEN') ->validatePurchase(); } catch (Exception $e){ var_dump($e->getMessage()); // example message: Error calling GET ....: (404) Product not found for this application. } // success

but, i receive a blank response, not even a json object, i;ve tried typing this code, $this->response(array('hi'=>'yO'),200); $client = new \Google_Client(); and it sends me a response, but after this, is not sending anything... it only return a blank and with postman says i have a 200 code response.

i'm guessing if this has to be something with composer and CodeIgniter 2.1.4 (which is the version im using).

can anyone help me with that.

storymx commented 7 years ago

this works for codeigniter 2??.

i really can't even make it work, i checked file googleapi.json, and it exists but when i instance the Google_Client(); is not returning anything...

9kinc commented 7 years ago

same, not working for me