A gift card company will pay nearly $4.4 million for helping a retailer wrongly keep unused gift card funds belonging to New York residents, the state attorney general said Friday.