PHP code example of alxmsl / googleclient

1. Go to this page and download the library: Download alxmsl/googleclient library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alxmsl / googleclient example snippets


$ php bin/revoke.php --help
Using: /usr/local/bin/php bin/revoke.php [-h|--help] -t|--token
-h, --help  - show help
-t, --token  - revoked token

    $Client = new Client();
    $Client->setPackage(<package name>)
        ->setAccessToken(<access token>);
    /** @var InAppProductsResource $Resource */
    $Resource = $Client->get(<product id>);
    var_dump($Resource->getPrices());

$ php bin/inappproducts.get.php --help
Using: /usr/local/bin/php bin/inappproducts.get.php [-h|--help] -a|--access [-p|--package] -r|--product
-h, --help  - show help
-a, --access  - access token
-p, --package  - package name
-r, --product  - product id