Note! If no more than 48 hours have passed since the date of accidental purchase, you can request a refund.
You can cancel a purchase from the Apple App Store here reportaproblem.apple.com.
You can cancel a purchase from Google Play Market here https://support.google.com/googleplay/answer/7205930