Solution 1:

I will change a bit in what you have in plan for the structure of the database, to hopefully simplify a little.

We will have 2 types of saved data:

First Type

Is a node data that you will add it and prepare it manually and we will call it "Products". In this products node you will add the product ids that you got from google play console, and then give it some details something like that :

    Products
    |
    |--------Wood_id
    |         | 
    |         |--name : "wood"
    |          --price: "10"
    |          -- ........ 
    |
    |---------Iron_id
              | 
              |--name : "iron"
               --price: "20"
               -- ........

okay now lets define the above diagram:

Wood_id or Iron_id : stands for the exact id that you created your products with in google play console. ((you type it manually in the database along with its details))

name: stands for the name of the item to show in the recycler view ((also you type all these details manually)).

price: points or whatever you decide that.

So these are stuff you type manually in your database tree in firebase console.

when populating in recycler view it will look like that

        |---------------|
        |     wood      |
        ------------------
        |     iron      |
        |               |
        -----------------

You can achieve this using Firebase UI ((which will make it a bit easy on you to retrieve nodes and view them in RecyclerView)).

okay until now we are able to show the user products and view them in a products list ((and each item carries with it and Id that is equal to the id on google play console))

Second type

Is the type of data that we will add from the app which are (Users) node and (Purchased items) node.

users node is like this

     Users
     |
     |--------user1
     |         | 
     |         |--name : "..."
     |          --e-mail: "..."
     |          -- ........ 
     |
     |---------user2
               | 
               |--name : "..."
                --e-mail: "..."
                -- ........

okay this is a node that is up to you to add and usually comes after a user is created ((Registration thing)), but you seem to have accomplished that using google sign-in.

So this node is not very important, but you can add it if you want.

And now look what we will do. We will let a user click on an item and then we will check if this item exists in his list if not we will show him a payment intent. After he/she purchased the item we will add it in the (Purchased items) node like that:

             Purchased items
             |
             |--------user1
             |         | 
             |         |--Wood_id : "any_value"
             |          --Iron_id:  "any_value"
             |         
             |
             |---------user2
                       | 
                       |--Iron_id : "any_value"

The above tree indicates that user1 purchased (wood and iron) while user 2 purchased only (iron).

when user2 for example clicks on wood, we will grab the product id associated with wood which is (Wood_id) and we will run a value event listener using firebase and we will check if user2 has the (Wood_id) or not, in our case user2 doesn't have wood. So here you can use if you want the billing library that you mentioned and pass the (Wood_id) to buy from google play console, and in the listeners of this library that you mentioned you check for payment success (and here you add for user2 the Wood_id in "Purchased items" node so that next time user2 clicks firebase will run a listener and won't show a payment again).

This is how you would go about it using the library that you want to use.

UPDATE

How to retrieve in recycler view the database (Products).

first add the latest firebase database and firebase ui

   compile 'com.google.firebase: firebase-database: 11.4.2'
   compile 'com.firebaseui: firebase-ui-database: 3.1.0'

after that you need a to create a java class call it (ProductsClass) inside it add these:

    public class ProductsClass{

     //these should be the same name as keys in your database
     public String name;
     public String product_id;
     public String state;

      //empty constructor
     public  ProductsClass(){
     }

     public  ProductsClass(String name, String product_id, String state){
       this.name=name; 
       this.product_id=product_id;
       this.state=state;


     }

      public String getName(){
         return name;

         }

        public void setName(){
         this.name=name;

         }

         public String getProduct_id(){
         return product_id;

         }

        public void setProduct_id(){
         this.product_id=product_id;

         }



         public String getState(){
         return state;

         }

         public void setState(){
         this.sate=state;

         }



    } 

now inside your (Products activity)

         private Recyclerview products_recycler;
         private FirebaseAuth mauth;
         private DatabaseReference products_ref;
         private String currentuser;

         //in on create

            products_recycler=find it by id......
            mauth=FirebaseAuth.getInstance();
            currentuser=mauth.getCurrentUser().getUid();

            products_ref=FirebaseDatabase.getInstance().getReference().child("products");


        //manger
         products_recycler.setHasFixedSize(true);
         products_recycler.setLayoutManager(new LinearLayoutManager(this));


           //in onstart

          FirebaseRecyclerOptions< ProductsClass > options =
            new FirebaseRecyclerOptions.Builder< ProductsClass >()
                    .setQuery(products_ref, ProductsClass.class)
                    .build();

           FirebaseRecyclerAdapter adapter = new   FirebaseRecyclerAdapter< ProductsClass, ProductsHolder>(options) {
@Override
public ProductsHolder onCreateViewHolder(ViewGroup parent, int viewType) {

    //inflate the single recycler view layout(item)

    View view = LayoutInflater.from(parent.getContext())
            .inflate(R.layout.productslayout, parent, false);

    return new ProductsHolder(view);
}

    @Override
    protected void onBindViewHolder(ProductsHolder holder, int position, ProductsClass model) {

      //here you set stuff in items , get data, ....

      //model is your class model (you get data from it) 





     }
   };


    // now  set adapter
       adapter.startListening();
       products_recycler.setAdapter(adapter);




      //make a static class called ProductsHolder in the same activity

      public static class ProductsHolder extends RecyclerView.ViewHolder{


        View view;

         public ProductsHolder(View itemView){

             view= itemView;
          }

          //what ever methods you need to add

       }

note: R.layout.productslayout is custom layout for each item in recycler view .

this way you retrieve in any activity any node you want.

reference link : this link

Solution 2:

In-app Billing API tracks the purchases but managing the user inventory is the developer job. You can get what have been purchased by using getPurchases so you don't need to save them into the database but is not the case for free products cause you can't add them to in-app billing products list,so you need to save them into Firebase. .Finally about the adapter if what you are querying is simple then use the FirebaseRecycleradapter else use Recycleradapter.