@Skylark
In my experience it's impossible, particularly on the mac.
Storekit (2) seems to be totally inconsistent and unreliable. We've been fighting with it ever since we started using it. In development, in testing, and in production. The documentation is a joke, Apple engineers don't respond to forum posts, and if you request DTS they just refer you to the forums or ask you to post a bug report. I've done all of this, and am no better off.
Maybe no-one actually knows how it's supposed to work. It reminds me of the early days trying to include iCloud technology in code. According to Apple at the time it "just works", and it really really just didn't.
Looking at Apple's training videos for StoreKit everything is wonderful and shiny, but my experience is the total opposite. Their examples never include any processing of failure cases, and the documentation doesn't attempt to explain what those failure cases might be, what could cause them, or how to respond. Of course, in production they happen regularly. You can't properly test these cases in development, so you are left guessing.
As an engineer I want to see rigorous documentation of failure cases, so I can write robust code to cope with them.
Here's a good example: Transaction.currentEntitlements can return unverified.
Why? Under what conditions? What does it actually mean? And how do we respond in code?
I can find no answers to this on the forums or in Apple documentation. Just frustrated devs flailing around.
Do I sound bitter? :)
Sorry.
Yours, exasperated and disillusioned.