Scan the beneficiary's QR code to acquires his or her electronic cash address.
Call the function below to transfer electronic cash.
SCRIPT
function transferAmount(d) {
_uz.api.contentWindow.postMessage({
action: "ecash-api-transfer-amount",
currency: document.querySelector(".beneficiary-currency").value,
range: document.querySelector(".beneficiary-amount").value
}, _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 transfer.
HTML
<h1 class="ex-balance">...</h1>
<input class="beneficiary-currency" type="text" style="width: 60px;" placeholder="USD"/>
<input class="beneficiary-amount" type="text" value="0"/>
Install the QR code creator library to display the electronic cash transfer 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>