How do i verify the paid and unpaid categories

I am creating an e-learning app in which i have categories. I want to receive payment for each category. I have firebase database attached to the app. Once the user opens the app, how to tell him which categories he has buyed and which are locked. I want to have a lock on categories UI wise.

Any help is appreciated. Thanks

For each category add a tag 1 or 0
If tag is 1 then the customer had paid and 0 for not paid.
Like wise you can differentiate.

use variable connect with firebase

DB side i understood how to do it. But on the Ui suppose i have 2 categories one paid and one unpaid. so i want to show a lock on unpaid ones. As the user pays for it the lock will disappear after verification from firebase. So how do i do that ?

First You show what you did, here in community you can get solution to your problem.
Just try Doing Things what you want where ever you have problem then you may ask here.