Like @ralph.m ; has suggested, I’d not contain your options so narrowly. There are so many good tools out there, some open-source, some commercial.
WordPress is good, but I’m not sure I’d use it for a store. As has been said, hackers are infatuated with WordPress and the chances for you to eventually get hacked aren’t all that slim… So, if you do go with WordPress for eCommerce, I’d go above and beyond to make sure that you’re not opening yourself up to hackers. There are quite a few articles on the net that illustrate the measures you can take to make the system as secure as possible.
I don’t know if you value good code, but if you do, then you need to know that it takes an impressive amount of work and effort to accomplish that with WordPress, and in some cases, it’s impossible to take advantage of WordPress’ inbuilt features without losing a large portion of control over your code. If you don’t care about the quality, lack of flexibility and complexity (bloat) of your code, then this point is redundant, obviously. WordPress is a good tool and has a lot going for it, depending on what you want to do with it and how.
As for Joomla, there seem to be quite a few people who like this CMS, but I must say that it’s one of the worst CMSes I’ve had the displeasure of using. I find it bloated and unintuitive. I’d not touch it again, not with a ten-foot pole.
You have been somewhat vague on what kind of eCommerce functionality you’re aiming for. Other than looking at the various CMS tools out there, e.g. ExpressionEngine, MODx, Perch, Statamic, etc. you should see what inbuilt or third-party eCommerce add-ons/plugins are available for each of these systems and which best match your requirements. Some eCommerce software vendors offer integration tools for some CMSes, so that’s something you could research as well.
You may also want to look at hosted eCommerce solutions. I think a hosted solution (e.g. Shopify) is something to truly consider, particularly if you’re new to eCommerce as it really isn’t something to take lightly, especially not if you’re dealing with credit card payments and vulnerable data.
If you need very simple eCommerce capabilities as opposed to a fully featured online store, then perhaps a simple shopping cart system might be all that’s needed.