Strictly speaking, most major hotels, shopping centres (especially the department stores) and so on do accept most credit cards in bigger cities like Beijing, Shanghai etc, but it is recommonded to have some cash with you and you could do foreign currency exchanges at most bank branches in major cities on Chinese mainland. In addition, I don't think there would be any problem with using your credit cards in Hong Kong. Have a fabulous time in China & Hong Kong.