Wizcorp / node-iap

In-app purchase validation for Apple, Google, Amazon, Roku
262 stars 92 forks source link

[Google] - use oderId instead of the token as transationId #44

Closed adrian-gierakowski closed 5 years ago

adrian-gierakowski commented 6 years ago

orderId not the token should be the property used as transactionId

the Google token is more like the Apples base64 encoded receipt: both enable the developer to fetch updated information about users purchase/subscription. Googles orderId is the property which corresponds to Apples transaction_id.

its the orderId that uniquely identifies each transaction made by the user. What you are currently using as transactionId is the token which is used to fetch information from the api about given purchase/subscription. In case of renewing subscriptions, there will by more then one transaction associated with give token, each transaction having a unique orderId which corresponds to subsequent subscription periods. If you ever want to match data fetched from googles purchases api with play store sales & payout reports you will need to use the orderId not the token.

justinpage commented 6 years ago

Sounds like a good idea.

Perhaps we can consolidate this change in #40

superandrew213 commented 6 years ago

@KLVTZ sounds good. I wanted to add this before but it will be a breaking change.

justinpage commented 6 years ago

@superandrew213 Gotcha, yeah maybe a better flow would be to review and merge #40 and then maybe consider this request in a different PR. If this will be a breaking change then maybe the PR would justify a semver upgrade from the owner. Whatcha think @ronkorving?

justinpage commented 6 years ago

@adrian-gierakowski Are you still up for making a PR now that #40 is merged? As mentioned earlier, it should be marked as a breaking change.

adrian-gierakowski commented 6 years ago

@justinpage I'm on it

adrian-gierakowski commented 6 years ago

@justinpage I'll deal with #30 first