Let x be the cost price of the pillow.
The shop sold the pillow at 240*0.8 = 192 dollars.
The profit was 28%. It means that
192 - x = 0.28x,
or
192 = 0.28x + x = 1.28x.
Hence, x = = 150.
ANSWER. The cost price (the buying price) of the pillow was 150 dollars.