Answer:
The literary device used in the sentence "Heaven knows how to put a proper price upon its goods." is personification.
Personification is a figure of speech in which an inanimate object or abstract concept is given human qualities or characteristics. In this sentence, "Heaven" is given the human quality of being able to "put a proper price" on its goods.