Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
safecharge
Advanced tools
This module generates URL-s for the Safecharge PPP, and validates responses.
$ npm install safecharge
Exapmple:
safecharge.getPPPURL([{
name: 'Foo',
amount: 19.95
}], {
merchant_id: 'XXX',
merchant_site_id: 'YYY',
}, 'ZZZ');
//https://secure.safecharge.com/ppp/purchase.do?merchant_id=XXX&merchant_site_id=YYY¤cy=USD&version=3.0.0&handling=0&shipping=0&discount=0&total_tax=0&time_stamp=2013-10-03.15%3A23%3A03&total_amount=19.95&item_name_1=Foo&item_amount_1=19.95&checksum=6c514a07da49485e009aedbc99194262
The following default values are used:
secret: process.env.SAFECHARGE_SECRET
merchant_id: process.env.SAFECHARGE_MERCHANT_ID
merchant_site_id: process.env.SAFECHARGE_MERCHANT_SITE_ID
curreny: 'USD'
version: '3.0.0'
handling: 0 (globally, and for each individual item)
shipping: 0 (globally, and for each individual item)
discount: 0 (globally, and for each individual item)
item.quantity: 1
total_tax: 0
time_stamp: the current time
total_amount: calculated according to the safecharge docs:
total = shipping + handling - discount
for each item
total += (item.amount - item.discount + item.shipping + item.handling)*item.quantity
total *= (1 + total_tax/100)
Validates Safecharges response against checksum
.
data
is an object, containing totalAmount
, currency
, responseTimeStamp
, PPP_TransactionID
, Status
, productId
fields.
secret
defaults to process.env.SAFECHARGE_SECRET
.
FAQs
SafeCharge REST API wrapper for Nodejs
The npm package safecharge receives a total of 413 weekly downloads. As such, safecharge popularity was classified as not popular.
We found that safecharge 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.