Check these setp
In In-App Purchases (once you've enable store above) in configuration put you IOS Share Secret Key and Tick Sandbox mode for TESTING.
Add your Product to the Available Products (same ID as the ones set-up on Apple/Google i.e. com.appname.premium), these are for testing.
If you not yet release your app on the applestore , you need a ios device without jailbreak to test IAP in sanbox.
Purchase Product only purchase the product. If you already purchased. It will failed.
you need add a restore purchase button.
Restore Purchase action will check your purchased and tigger the Purchase success.
My iap app has just been released.I found it will not purchase success on the store. But it success in the sandbox environment. I think I need to upload a new no iap version for the time being.
itunes.apple.com/us/app/sweets-monster-halloween/id660610227