• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

61
Views
How to call the Google Play Void Purchases API from PHP?

I am trying to implement a call to the Google Play Voided Purchases API from our PHP server.

I understand that I should call

GET https://www.googleapis.com/androidpublisher/v2/applications/
your_package_name/purchases/voidedpurchases?access_token=your_auth_token

To have access_token I created a service account and got the private key JSON file. I saw that it's complicated to use it directly in order to get the access_token and the recommended method is to use Google Client API libraries.

However the PHP client library is in Beta stage and the sample I found is using Google_Service_Books. In the library code I saw the class AndroidPublisher/VoidedPurchase.php but I don't understand how to use it.

Can anyone provide an example for calling the void purchases API from PHP, using the client library or without it? or how to get the access_token from the service account JSON key file?


I have already read the following instructions:

  • Google instructions for the void purchases api https://developers.google.com/android-publisher/voided-purchases
  • Creating a service account https://developers.google.com/identity/protocols/OAuth2ServiceAccount
  • Google API PHP client (Beta): https://github.com/google/google-api-php-client
about 2 months ago ·

Santiago Trujillo

Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.