How to generate a qrCode from a url

Asked

Viewed 110 times

-3

url = https://staging.coinwise.io/api/invoice/v1/invoice/koy-intel-juridica/default-btc?value=0.05

Json: {"id":10,"BTC":{"value":0.00000189,"address":"1BUPDHmaAnVDzAq7rBuv1UW1vXFQhhsgZx","qrcode":"data:image/png;Base64,iVBORw0KGgoAAAANSUhEUgAAAMQAAADECAYAAADApo5rAAAAAklEQVR4AewaftIAAAiySURBVO3BQY4kx7IgQdVA3f/KOo2/cNjKgUBmNck3JmJ/sNb6Pw9rreNhrXU8rLWOh7XW8bDWOh7WWsfDWut4WGsdD2ut42GtdTystY6HtdbxsNY6HtZax8Na6/jhQyp/U8WNylRxo/JGxaRyUzGpTBWTyhsVk8pNxY3KVPEJlb+p4hMPa63jYa11PKy1jh++rOKbVL5J5aZiUplUpooblRuVm4pjzvl5hmpumam8uxft8u0q3/Sw1joe1lrhw1rr+Vk8pUMalMFZPKVDGpTBWTyo3KVDGpTBWfqJhUvknl3+xhrXU8rLWOh7XWYX/wP0RlqviEyjdV3Kh8U8WkclNxo3JT8V/2sNY6HtZax8Na6/jhL1O5qZhUbiqmihuVm4qbiknlpmJS+UTFpPK/ROWm4jc9rLWOh7XW8bDWOn74MpVPqEwVNypTxRsVk8pUcVMxqdxUvKEyqdxUTCpTxRsqn1B5o2JS+Zse1lrHw1rreFhrHT98SGWqmFSmikllqphUbiomlTdU3lC5qZhU3qh4o2JSuVGZKm4qblrukiavnyr+poe11vGw1joe1lrHD7+sYlKZKiaVqWJSmVSmijdUPlExqUwVv0nlpuINlaliUpkqblRuKiaVqWJSuan4xMNa63hYax0Pa63D/uADKlPFGypTxaRyU3GjMlVMKlPFPF36QyVUqw8W8k0Vn1D5poq/6WGtdTystY6Htdbxw5ep3FTcqEwV8kqMlVFb9JZarJ4VMMKlPFJ1T+Jpwbim96wFJ1T+Jpwbim2ut2ut42dfzwyyomlanirgtVMMlPPFpPPGxPPPPGxPPPPPPPxPPPPPPPPxPPPPPPKUyiq/kkqU8UnHtZax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pUMalMFZ94WGsdD2ut42Gtdfzwl6lMFVPFGypTxVQxqUwVNypTxaTyhspUcaPyRsWkMlX8l6lMFd/0sNY6HtZax8Na67A/+IDKTcWkclMxqdxUTCpTxY3KVPGGylQxqUwVk8pUMam8UXGjMlW8ofJvVvGJh7XW8bDWOh7WWof9wX+Yyk3FpDJVvKFyUzGp3FRMKjcVk8onKj6hMlW8oTJVTCpTxW96WGsdD2ut42GtdfzwIZW/qeINlW+qeKNiUplUpopJZVKZKiaVT6h8k8pUcaPyT3pYax0Pa63jYa11/PBlFd+kclMxqXxCZaq4UZkqJpWpYlJ5o2JSmSomlRuV31TxiYoblaniEw9rreNhrXU8rLWOH36ZyhsVb6hMFTcqk8pvqphUpoqbikllqnij4kblEyqfqLhRmSq+6WGtdTystY6Htdbxw/8YlZuKSeVG5TepvFExqUwVNyo3FZPKVDGp3FR8QuVGZar4xMNa63hYax0Pa63jh/+4iknlmypuVCaVqWKquFGZKiaVv6liUpkqJpUblZuKqWJS+U0Pa63jYa11PKy1jh9+WcW/icpUcapyrswk8kbftcwk8jdvtcptxu3fpdkp3frmkt/0sNY6HtZax8Na67A/+Idk31txhspu8qmvm4pj5rmv36tyrswk8omkswwq+Cc9rlwoh7xw8bdwouwp1lr/52GtdTystY6HtdbxsNY6HtZax8Na63hYax0Pa63jYa11PKy1joe11vGw1joe1lrHw1rreFhrHf8P0GJ+5AAAAAAAASUVORK5CYII="},"BRL":{"value":"0.05","rates":{"BTC":26450.328099999995}}} json =

1 answer

1

You can use this lib.

Just follow this idea.

 function qrCodeExample(url) {
  var qrcode = new QRCode(document.getElementById("qrcode"), {
    text: url,
    width: 70,
    height: 70,
    colorDark: "#000000",
    colorLight: "#ffffff",
    correctLevel: QRCode.CorrectLevel.H
  });
}

Then it’s loading, for example, it’s a < div > the contents of the qrcode:

    <div id="qrcode" align="center">
     </div>
  • I’m using the angle as it would be ?

  • @alexjosesilva gives a look at the examples of the link I passed, there will guide you better. But it’s basically, you load the lib . js of Qrcode in your project, conditions your function to generate Qrcode according to your need and applies the <div> on the page you want q to load the Qrcode.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.