Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
pesa-lib
Advanced tools
Readme
An Node.js package for Mpesa.
Before using this package, create an account on the Safaricom Developer Portal to receive a Consumer Key and Consumer Secret.
Business short code and pass key can be found at the Test credentials page.
yarn add pesa-lib
// For Javascript use
// const PesaLib = require("pesa-lib").default;
import PesaLib from "pesa-lib";
const pesalib = new PesaLib(
consumerKey,
consumerSecret,
businessShortCode,
passKey,
baseUrl // Optional. Used to switch from sandbox to production.
);
Use this API to generate an OAuth access token to access other APIs.
Other methods with use do this automatically so it's not needed.
pesaLib.oAuth()
Use this API to initiate online payment on behalf of a customer.
Phone number should begin with 254.
pesalib.lnmProcess(amount, phoneNumber,callbackUrl, accountRef, transactionDesc)
Use this API to check the status of a Lipa Na M-Pesa Online Payment.
pesalib.lnmQuery(checkoutRequestId)
Use this API to register validation and confirmation URLs on M-Pesa
pesalib.c2bRegister(confirmationUrl, validationUrl)
Use this API to simulate a C2B transaction
pesalib.c2bSimulate(amount, phoneNumber, billingRef, commandId)
Encrypt credentials using a certificate file.
pesalib.security(credential, pathToCert)
Enquire the balance on an M-Pesa
pesalib.balance(securityCredential, initiator, partyA, idType, remarks, queueTimeoutUrl, resultUrl)
Use this api to check the transaction status.
pesa.transactionStatus(identifierType, remarks, initiator, securityCredential, queueTimeoutUrl, resultTimeoutUrl, transactionId, occassion)
This is an unofficial package, not made by Safaricom.
FAQs
Node.js package for Mpesa.
The npm package pesa-lib receives a total of 1 weekly downloads. As such, pesa-lib popularity was classified as not popular.
We found that pesa-lib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.