Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
cross-switch-gh
Advanced tools
Nodejs API wrapper for Cross-Switch Ghana.
npm install cross-switch-gh
var live = false;
if (process.env.NODE_ENV === 'production') {
live = true;
}
// Require the library
var cross_switch = require('cross-switch-gh')(process.env.APP_ID, process.env.APP_KEY, live, baseurl);
The resource methods accepts are promisified, but can receive optional callback as the last argument.
// cross_switch.{resource}
cross_switch.payment.createPayment({})
.then((body)=> {
console.log(body);
})
.catch((error)=> {
console.log(error);
});
For all resource methods, the JSON body can be passed as the argument.
Method to Initiation Sending or Receiving from mobile Money.
cross_switch.payment.createPayment({
type: 'Receive || Send',
name: 'Firstname Lastname',
mobile: '+233540000000',
mobile_network: 'MTN || AIRTEL || TIGO || VODAFONE',
email: 'harmony@cross-switch.com',
currency: 'GHS',
amount: 0.1,
order_id: `${Math.ceil(Math.random() * 10e8)}`,
order_desc: 'Testing',
account: '',
customerid: '',
callback: ''
}).then((body)=> {
console.log(body);
}).catch((error)=> {
console.log(error);
});
Method to Initiation Only Receiving from mobile Money.
cross_switch.payment.Collection({
name: 'Firstname Lastname',
mobile: '+233540000000',
mobile_network: 'MTN || AIRTEL || TIGO || VODAFONE',
email: 'harmony@icloud.com',
currency: 'GHS',
amount: 0.1,
order_id: `${Math.ceil(Math.random() * 10e8)}`,
order_desc: 'Testing',
account: '',
customerid: '',
callback: '',
}).then((body)=> {
console.log(body);
}).catch((error)=> {
console.log(error);
});;
Method to Initiation Only Sending to mobile Money.
cross_switch.payment.Cashout({
name: 'Firstname Lastname',
mobile: '+233540000000',
mobile_network: 'MTN || AIRTEL || TIGO || VODAFONE',
email: 'harmony@icloud.com',
currency: 'GHS',
amount: 1,
order_id: `${Math.ceil(Math.random() * 10e8)}`,
order_desc: 'Testing',
customerid: '',
callback: '',
}).then((body)=> {
console.log(body);
}).catch((error)=> {
console.log(error);
});
Method to Get Cashout Balance.
cross_switch.payment.getBalance({})
.then((body)=> {
console.log(body);
}).catch((error)=> {
console.log(error);
});
Method to Verify Transaction status.
cross_switch.payment.verifyPayment({
order_id: `${data.transaction_no}`,
}).then((body)=> {
console.log(body);
}).catch((error)=> {
console.log(error);
});
FAQs
Cross-Switch Ghana API wrapper
The npm package cross-switch-gh receives a total of 9 weekly downloads. As such, cross-switch-gh popularity was classified as not popular.
We found that cross-switch-gh 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.