Scan the beneficiary's QR code to acquires his or her electronic cash address.
1.1Call the function below to issue electronic cash.
SCRIPT
function issueBalance(d) {
_uz.api.contentWindow.postMessage({
action: "ecash-api-issue-balance",
currency: document.querySelector(".ecash-currency").value,
amount: document.querySelector(".ecash-amount").value,
series: document.querySelector(".ecash-series").value,
name: document.querySelector(".ecash-source").value,
pid: _uz.beneficiary.pid,
pro: _uz.beneficiary.pro,
number: _uz.beneficiary.number
}, _uz.api.src);
};
Add elements below to display the beneficiary's information.
HTML
<p class="beneficiary-name"></p>
<p class="beneficiary-number"></p>
Add elements below to enter the currency and the amount to issue.
HTML
<input class="ecash-series" type="text" value="1234.567-890123" placeholder="1234.567-890123"/>
<input class="ecash-source" type="text" value="Tutorial" placeholder="Tutorial"/>
<input class="ecash-currency" type="text" style="width: 60px;" placeholder="Abc"/>
<input class="ecash-amount" type="text" value="0"/>
Install the QR code creator library to display the electronic cash issue QR code on the device screen.
In the repository folder look for the file qr.creator.js and add the lines below in the html page.
<script type="module">
import QrCreator from "./assets/js/qr.creator.js";
// Your codes here...
// ...
// Your codes here...
</script>
Add html element to show the QR code in your html page
HTML
<div id="show-qr-cont" style="display: none;">
<div class="qr-cont"></div>
</div>