Amazon has agreed to pay $2.5 billion to resolve a lawsuit alleging the online retail giant tricked customers into signing up for Prime memberships.