Open ricsantos opened 2 years ago
I have same problem too. In case of family sharing, transaction_id is larger than new one of purchase. So I cant get latest receipt. How can I get latest receipt in anyway ?
Years ago, I maintained this project, but I've since moved on. I'm getting the impression this project is no longer maintained and you may be better off using an alternative.
@ronkorving do you have any recommendations? I'm currently in the process of refactoring a project where this is used for iap verification, but have yet to look for an alternative.
I'm sorry to say I do not. I hardly use Node.js these days. But I do know there is more than one IAP related package on NPM.
@ronkorving Thank you to reply! I will try other NPMs.
Noticed that a iOS user who was having receipt validation issues had two items in the latest receipt info array:
Our tactic of grabbing the last item in the array failed, because
iap
sorts the items before returning them:https://github.com/Wizcorp/node-iap/blob/4ac0e22a54008a8396599190ea75a80b038ae407/lib/apple/index.js#L76
However the sorting is via
transaction_id
and in this case the first transaction has a much larger id than the second. Not sure if related to family sharing, or a red herring.Perhaps don't sort the array when parsing?