const BILLING_USER_FORM_URL = '/portal/balance/contract';

export default (params = {}) => {
    let url = new URL(BILLING_USER_FORM_URL, new URL(window.location.href).origin);
    const { retpath, source } = params;

    if (retpath !== undefined) {
        url.searchParams.set('retpath', retpath);
    }

    if (source !== undefined) {
        url.searchParams.set('source', source);
    }

    window.location.href = url.href;
};
