Just a note that if you're using Stripe you get that upgrade downgrade history for free, so might not need the complexity.
Also ProfitWell plugs in to Stripe and does a pretty good job with analytics for that for free too.
Of course if you're using multiple payment providers you'll want to roll your own abstraction as the above comment describes.