The reason why they provide the payment infrastructure is because they can control everything end to end. Imagine if they allow payments outside the app and expect developers to pay 30% for those transactions. Yeah, that's not going to work. I don't think Apple/Google does payment infrastructure out of good heart. They just want to know how much an app makes and how much commission to take.