How to check subscription status monthly?

26 views
Skip to first unread message

Tan Nguyen

unread,
Aug 17, 2015, 1:30:21 AM8/17/15
to Google API Client for Ruby
Hi There,

I have an app the run on Android, iOS platform. Users can buy membership via in-app purchase. The membership will can be auto renew or cancel. I need to verify if user cancel the subscription or not. To do it for both Android and iOS I have to check it on server side. Monthly, I will have a worker job to check the subscription status. I sas a document here: https://developers.google.com/android-publisher/api-ref/purchases/subscriptions/get

The problem is that I don't know how to authorize the api. I read this https://developers.google.com/api-client-library/ruby/guide/aaa_oauth but I don't which one I can use?

For Service account:

require 'googleauth'
require 'google/apis/compute_v1'

compute
= Google::Apis::ComputeV1::ComputeService.new

# Get the environment configured authorization
scopes
=  ['https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/compute']
compute
.authorization = Google::Auth.get_application_default(scopes)

Where can I put the api_key that I can authorize the account?

My english is not good please ignore that if I used strength words. 

Thanks in advance,
Reply all
Reply to author
Forward
0 new messages