Credit-card transactions have surged in the past year as more Indians flock to e-commerce websites to buy everything from clothing and groceries to consumer electronics, drawn by the variety of products and hefty discounts on offer and the ease of shopping online.