Hi we are using subscriptions in out game, and analytics from devtodev. We want to track when subscription for user was auto updated and send business event. The problem is that sometime devtodev recognize this events as duplicate and don’t send them. I find out that is hapening because orderId for subscription is always stays the same, but on email we are always receiving the order id after subscription id in format:
GPA.XXXX-XXXX-XXXX-XXXXX…1
So that google adds extra number in the end, when subscription is updated, but in build we don’t see this number. Is there any ability to parse this number in build, or unityIAP SDK are simplyu ignoring this number?
@mkislenko Keep in mind that we are using purchaseToken and not TransactionID or OrderID. Can you elaborate “and don’t send them”. Who is sending what, from where? What do you mean by “auto updated”? We don’t receive an ProcessPurchase upon auto-renewal, if that is what you are referring to. More about purchaseToken here Unity IAP package 4.12.2 is now available page-2#post-6506532
We are using Unity IAP version 2.0.6. Here field product.transactionId is still returning orderId. And this is what we send to devToDev. When we last tried to update to version 2.2.6 DevToDev marked all payments as invalid, because purchaseToken is not what it expected to see. It only accepts transactionId in format GPA.XX. So we decided to stay on older version for a while. By “auto update” i mean when there was an auto renewal of subscription. We are compare the date saved in PlayerPrefs, with date in SubscriptionInfo after player entered, and if it changed trying to send payment event to DevToDev, but sometimes sdk don’t send it because it has duplicate transactionId (that was sent when user purchased subscription). I know that i can disable check for duplicates from DevToDev side. But I’d preffered to send orderId with additional number after two dots (if its possible to get id).
I already spoked with DevToDev support. And they also said that most correct way is to send that last number, rather than disable check for duplicate transactionId.
Also question, if we update UnityIAp to latest version can you guarantee that purchaseToken will be different after subscrition auto-renewal?
Google won’t let you publish with 2.0.6, it’s using an older Google Billing Library. To your question, you will need to test directly.
I know. It will continue to work till November 2021. But I need to know how can I get an orderId insted of purchaseToken in newer IAP version? And will it return the last number after “…” or not?
You can get the orderID from the receipt from the product.receipt property, see an attached example.
7066411–839707–receipt.txt (1.16 KB)
Okay. Thank you. And what about last number that google ads after subscription auto-renewal? Do you know is there any ability to receive it?
Not sure, all we receive is the orderID from the receipt. We don’t add/remove anything, we get that receipt directly from Google. You will need to test.
I understood. Thank you for answer