payment code moved into the main js file