Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get orderId for an autorenewable transaction using Google Play Developer API?

Tags:

android

in-app

I've developed an android application, in which inapp subscription is done by play store billing version v3. And I implemented Google Play Developer api so as to retrieve the subscription status whether it is autorenewable or not.

The GET method of Google Play Developer APi returns this autorenewable status along with other details such as Expiry Time, Start Time etc. But I couldn't a find a possible solution to retrieve the order id of the subscription which is used for backend processing. Where I would get this transaction id by Google Play Developer api from?

Thanks in advance.

like image 809
user228654 Avatar asked May 09 '16 08:05

user228654


1 Answers

You don't need orderID, you need "base orderID" and you can generate current orderID from startTime and expireTime

From Developer Android (https://developer.android.com/google/play/billing/billing_subscriptions.html#administering):

Subscription order numbers

To help you track transactions relating to a given subscription, Google payments provides a base Merchant Order Number for all recurrences of the subscription and denotes each recurring transaction by appending an integer as follows:

GPA.1234-5678-9012-34567 (base order number)

GPA.1234-5678-9012-34567..0 (first recurrence orderID)

GPA.1234-5678-9012-34567..1 (second recurrence orderID)

GPA.1234-5678-9012-34567..2 (third recurrence orderID)

like image 59
Ivan Avatar answered Sep 30 '22 16:09

Ivan