diff --git a/README.md b/README.md index d79b69d..7637e31 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Installation - yarn install intasend-node + yarn add intasend-node or using NPM diff --git a/package.json b/package.json index 9d3ce89..7142a3a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "intasend-node", "description": "IntaSend official NodeJS SDK", - "version": "1.0.8", + "version": "1.1.2", "main": "./dist/intasend.js", "types": "./dist/intasend.d.ts", "files": [ @@ -11,7 +11,10 @@ "build": "tsc" }, "license": "GNU Affero General Public License v3.0", - "repository": "https://github.com/IntaSend/intasend-node.git", + "repository": { + "type": "git", + "url": "git+https://github.com/IntaSend/intasend-node.git" + }, "devDependencies": { "@types/node": "^18.7.18", "typescript": "^5.4.5" diff --git a/src/example.js b/src/example.js index 787d157..96633b9 100644 --- a/src/example.js +++ b/src/example.js @@ -67,10 +67,12 @@ wallets // How to send money M-PESA (B2C, B2B, BANK, INTASEND P2P) // Learn more from our API reference on provider types and fields here - https://developers.intasend.com/reference/send-money_initiate_create let payouts = intasend.payouts(); +var req_approval = "YES" payouts .initiate({ provider: 'MPESA-B2B', currency: 'KES', + requires_approval: req_approval, // Set to 'NO' if you want the transaction to go through without calling the approve method transactions: [ { name: 'ABC', @@ -84,14 +86,16 @@ payouts .then((resp) => { console.log(`Payouts response: ${JSON.stringify(resp)}`); // Approve payouts - payouts - .approve(resp) - .then((resp) => { - console.log(`Payouts approve: ${JSON.stringify(resp)}`); - }) - .catch((err) => { - console.error(`Payouts approve error: ${err}`); - }); + // if (req_approval === 'YES'){ + // payouts + // .approve(resp) + // .then((resp) => { + // console.log(`Payouts approve: ${JSON.stringify(resp)}`); + // }) + // .catch((err) => { + // console.error(`Payouts approve error: ${err}`); + // }); + // } }) .catch((err) => { console.error(`Payouts error: ${err}`);