
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
node-redsys-api
Advanced tools
Node.js Redsys api implementation with new the key-hashed message authentication code (HMAC) SHA256 for the virtual payment gateway integration. This is a node.js port of the PHP API provided by [Redsys](http://www.redsys.es/)
Node.js Redsys api implementation with new the key-hashed message authentication code (HMAC) SHA256 for the virtual payment gateway integration. This is a node.js port of the PHP API provided by Redsys
npm install node-redsys-api --save
const Redsys = require('node-redsys-api').Redsys;
...
//Snippet to obtain the signature & merchantParameters
function createPayment(description, total, titular, orderId, paymentId)
{
const redsys = new Redsys();
const mParams = {
"DS_MERCHANT_AMOUNT":common.round(total*100).toString(),
"DS_MERCHANT_ORDER":paymentId,
"DS_MERCHANT_MERCHANTCODE":tpvInfo.fucCode,
"DS_MERCHANT_CURRENCY":tpvInfo.currency,
"DS_MERCHANT_TRANSACTIONTYPE":tpvInfo.transaction_type,
"DS_MERCHANT_TERMINAL":tpvInfo.terminal,
"DS_MERCHANT_MERCHANTURL":domain+tpvInfo.redirect_urls.callbackBasePath+'/'+orderId,
"DS_MERCHANT_URLOK":domain+tpvInfo.redirect_urls.urlOK+'&id='+orderId,
"DS_MERCHANT_URLKO":domain+tpvInfo.redirect_urls.urlKO+'&id='+orderId
};
return {signature: redsys.createMerchantSignature(tpvInfo.secret, mParams) , merchantParameters: redsys.createMerchantParameters(mParams), raw: mParams};
}
//Snippet to process the TPV callback
const merchantParams = tpvResponse.Ds_MerchantParameters || tpvResponse.DS_MERCHANTPARAMETERS;
const signature = tpvResponse.Ds_Signature || tpvResponse.DS_SIGNATURE;
const merchantParamsDecoded = redsys.decodeMerchantParameters(merchantParams);
const merchantSignatureNotif = redsys.createMerchantSignatureNotif(tpvInfo.secret, merchantParams);
const dsResponse = parseInt(merchantParamsDecoded.Ds_Response || merchantParamsDecoded.DS_RESPONSE);
if (redsys.merchantSignatureIsValid(signature , merchantSignatureNotif) && dsResponse > -1 && dsResponse < 100 ) {
console.log('TPV payment is OK');
...
} else {
console.log('TPV payment KO');
...
}
npm run test
You can download Java, PHP, .NET implementations
Santi Pérez
MIT
FAQs
Node.js Redsys api implementation with new the key-hashed message authentication code (HMAC) SHA256 for the virtual payment gateway integration. This is a node.js port of the PHP API provided by [Redsys](http://www.redsys.es/)
The npm package node-redsys-api receives a total of 1,137 weekly downloads. As such, node-redsys-api popularity was classified as popular.
We found that node-redsys-api 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
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.