<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script>
// var url_string = window.location.href
// var url = new URL(url_string);
// var billplz = url.searchParams.get("billplz[id]");
// console.log(billplz);

function getQueryParams(qs) {
    qs = qs.split('+').join(' ');

    var params = {},
        tokens,
        re = /[?&]?([^=]+)=([^&]*)/g;

    while (tokens = re.exec(qs)) {
        params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
    }

    return params;
}

var query = getQueryParams(document.location.search);
console.log(query);

axios.post('/api/v1/billplz/bill/callback', query)
  .then(function (response) {
    console.log(response);
  })
  .catch(function (error) {
    console.log(error);
  });

</script>