The submitTrans() method accepts the transaction details from the /payment endpoint and adds a new remittance transaction to the blockchain ledger. Let's see how the method works:
- The input parameters to the method are the transaction ID (txID), the trans object with the transaction details, and the hasharray object with the hash of the invoice document, the BOE/BOL document, and any other document shared for compliance purposes with the transaction request, as follows:
async function submitTrans ( txID, trans, hasharray) {
- We first check whether a valid user exists for Bank A for submitting transactions. We use the user1 user we created for Bank A earlier. We set the