Anything that has the "online purchase" flag should get the 5%. Discover, like other banks, can see whether the card was swiped, keyed in, phone/online order, etc. as part of the info they get for a transaction.
As for what you should do to max this out, anything that you can't earn a category bonus for on a different card (so don't use staples.com) is equally good. I think AP is the best route since you can charge exactly $1500 and be done. That's what I did in 2013, and got my 5%.