added matter buy function

buy resource yes button is connected with database
pay the costs still needs to be implemented