PAID PLANS x STORES - Allocate a plan to a customer who purchases a product?

What would you consider to be the best way of automatically adding a customer to a paid plan when the purchase a product from the store?

E.G. Someone buys a book and they get access to a “members only”/“paid plan owners only” page of videos.