Accidental purchases are often made by minors or by accidentally tapping wrong buttons on your phone. To prevent such scenarios, please change your device's security restrictions.
To edit the level of security for each step of the purchasing process, open your device's Settings app, scroll down, go to General, and select Restrictions.
From there, you can enable/disable restrictions by entering your password.
Once restrictions are enabled, search for "In-App Purchases". You have the possibility to completely disable in-app purchases (set this to OFF) or manage the frequency of password inquiries by using the "Require Password" button. If you want to keep the ability to make in-app purchases, yet want to add additional level of security, you can set the device to require your password every time you make a purchase (select "Immediately") or after a set amount of time (e.g. every fifteen minutes).