Payment queues are calling automatically in auto-renewable in-app purchases

Scenario 1:

User 1 purchases a product on my app with their Apple ID and logs out of both my app and their Apple ID. User 2 attempts to purchase the same product on my app with their unique member ID, but logged in to their iPhone with User 1's Apple ID. Upon attempted purchase, User 2 receives pop up saying that they have already purchased a subscription with the Apple ID with the two options "Manage" and "ok." In the background, paymentQueues are automatically calling multiple transactions and all are calling to "Purchased" block. As a result, User 2 is allotted with the subscription while the pop up appears.


Scenario 2:

User 1 purchases a product on my app with their Apple ID and logs out of both my app and their Apple ID. User 2 attempts to purchase the same product on the my app with their unique member ID, but logged in to their iPhone with User 1's Apple ID. At this point, we check the subscription existence by checking the recent transaction. If subscription expiry dates still exist or if it is in recurring mode, then right away we are serving a pop up communicating that the receipt has already been used. If the subscription is "Expired," we check our application Member ID with the original Transaction ID by calling our API. If these match, we are letting the user purchase the product. If not, we are not adding any paymentQueues and displaying a pop up which says "Receipt already used." However, the paymentQueues are calling automatically and calling the "purchased" block in paymentQueue. As a result, our API URLs are displaying transaction successful status and User 2 is allotted with the subscription.


How should we manage User 2?

Replies

In scenario 1 the "user" is "user 1" because the Apple ID is user 1's. The fact that user 2 is holding the device is not known to the App Store.


Same issue with scenario 2.


You will want to write a subscription purchase identifier to your "Pycar.com" account - for example you could use the original_transaction_id to identify an ongoing subscription or you can use web_order_line_item_id to identify a particular subscription renewal. When a different user tries to get 'credit' for a purchase with the same original_transaction_id or web_order_line_item_id then tell them 'already assigned to another user'.