update credit balance js