Actually companies do pay you to shop...and some pay quite well.
Supermarkets will hire secret shoppers (mostly existing store customers) to test their cashiers. I know...I was a victim of one many years ago and was reprimanded for not checking under the cart for hidden items when a secret shopper snuck stuff past me.
I have also been a "secret shopper" for a company I worked for. It was my job turn in a once a year report on the competition down the street. I had to include the prices for everything they had that matched items we sold, that were in my department. The way most would perform this job would be to run down the street and collect a few each day, on their lunch break, till the full list was finished. Then they collected a $50 bonus when they turned in the book.
Fortunately for me I was friends with the manager down the street and was able to do the entire store on my day off, bringing a huge binder filled with our store's inventory/price list...not just the stuff for my department. It was an easy $300 in my pocket since my boss had me on the clock the whole time, plus I got the turn-in bonuses for every department.
The ones you see online that ask you for money and promise you'll make money are all scams.
The ones that will give you some money in cash or a gift certificate to spend, or an item to return for a refund, up front, and more when you complete the job...those are usually safe. You are usually told to keep what you purchased, or keep the refund you received, in addition to the amount you receive as pay.
But you are not going to get rich doing this, and you can't make a career out of it. The shopping jobs are few & far between and the competition for them is fierce.
And many stores select from customers that happen to be in the right place at the right time to do their secret shopping. So if the store manager approaches you in the back of Walmart with a shopping cart full of stuff and ask you if you'd do him a favor and go stand in line with it, and hands you a gift certificate...go for it!