Specific Content Access only after successfull checkout I'm creating a website where user can buy content &amp; can view that content online.Suppose user buys a book online.Now after user successfully completed the payment process,that book should be added to user account page from where user can access the content page.Just like E-book read online,where user can only read books user purchased.
I'm using Drupal Commerce module.
You can actually accomplish this with no code using the Entity Reference, Content Access, and Access Control List modules. I just implemented this for a client! I added an entity reference field to my product type that I used to point to the node the customer should be granted access to upon successful purchase of that product. I then added a rule when an order is first paid in full that grants access through the access control list to the referenced node.

The trick is to configure your node type used for the premium content so that those nodes are only visible to administrators and then depend on the access control list to grant access to users on an individual basis. One advantage of this, too, is that you could create an "all you can eat" subscription using a user role that may also have access to view any content of that type if you wanted to.

To show a list of content the user has access to on their profile, you can simply create a list of nodes of the specified type, and Views's automatic inclusion of access control on node queries should ensure users only see the nodes in the list they have access to.