Invoice generation system compatible with Liquidity Network
// Note: Here, decodedInvoice equals invoice
encodedInvoiceinto a QR code generator as plain text. (i.g: user https://www.the-qrcode-generator.com or a library) to be scanned by the user.
sendTransferfunction of the NOCUSManager.
- If no amount is specified invoice.amount will be undefined, it needs to be set before making a transfer with the nocust manager client side.
- If tokenAddress is not specified, Ether will be used.
The typical merchant needs to track the completion of payments by its customer, to do so we use
- SERVER SIDE, generate an invoice with
trueand save the nonce in the invoice object
invoice.noncein the merchant server db. It is important to be done server side otherwise the client can manipulate the value.
- Encode the invoice with
encodeInvoicefunction and send it to the client front-end to display the QR code
- Wait for an incoming payment with the nocust-manager that has the correct nonce value AND amount.