javascript update price to pay