A test nodejs demo payment library for disbursing payouts to family or friends
Node 8, 10 or higher
Install the package with:
npm install --save pay-lib # or yarn add pay-lib
const payLib = require("pay-lib");
//Create an array of object receipents, even if it is just a receipent const receipents = [ { name: "Tobi", amount: 9000000000 }, { name: "Prosper", amount: 4000000000 }, { name: "Ire", amount: 4000000000 } ]; //Now pass the receipents array to the send method of the paylib disburse property let paymentIntents = payLib.disburse.send(receipents); //You can choose to display the response anyhow, here i will log it to the console console.log(paymentIntents);
This would return a array objects containing details of each /receipent transactions
[ { "name": "Tobi", "amount": 9000000000, "isSent": true, "sentAt": 1641746707977, "id": "PAYLIB-ID2198635", "message": "Transaction successful" }, { "name": "Prosper", "amount": 4000000000, "isSent": true, "sentAt": 1641746707977, "id": "PAYLIB-ID7381044", "message": "Transaction successful" }, { "name": "Ire", "amount": 4000000000, "isSent": true, "sentAt": 1641746707978, "id": "PAYLIB-ID9864517", "message": "Transaction successful" } ]
Live test project link coming