Here’s the link to the IAP guide,which is admittedly very old, but still applicable:
https://coronalabs.com/blog/2013/09/03/tutorial-understanding-in-app-purchases/
To answer your questions regarding testing IAP on iOS, I’ll quote from the doc:
Apple
- You need specific test accounts which you can create in iTunes Connect. They are standard Apple IDs, so you will need to have a unique email address for each account. If you have your own web hosting service, you can set up aliases like “iap01@yourdomain.com” and “iap02@yourdmain.com” that send emails to your primary email address as a “catch all.” Note that Apple will make you validate the email by clicking on a link within it, so you must be able to receive it.
- You must log out from iTunes on your device before you run the test app. This test app can be provisioned with either a Development or AdHoc profile to access the IAP sandbox. When prompted, log in with your test account.
- You get “one shot” to buy your item because Apple remembers that your account has purchased that item. If you need to test again, you need a different account. There is no way to reset these purchases.
- If you see “you need to submit your app and reject the binary,” you can disregard that advice. Currently, you just need to submit your items for review — but it does take a little time for your items to propagate through Apple’s servers.