There can be various reasons as to why a purchase fails, so please check the information below to resolve the issue:
1. Check if there are any restrictions:
a. Disable Restrictions by going to Settings > General > Restrictions. If you enabled Restrictions, tap to allow access for the iTunes Store and In-App Purchases.
b. For more information, please check out the following link: https://support.apple.com/en-us/HT204396
2. Verify that you’re using the same Apple ID on iTunes & App Store
3. Try logging into iCloud online and update your payment details online instead.
4. Sign out of iTunes by going to Settings > iTunes & App Stores > Apple ID > Sign Out. Restart your device and then sign back in.
5. Tap Settings > Apple ID Profile > iTunes & App Store > Your Apple ID > View Apple ID and enter your Apple ID password if asked.
a. Tap Payment Information
b. Re-enter the “Required” Security Code field along with verifying the remaining fields.
c. Tap “Done”