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).
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.