node-adyen-encrypt
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -6,6 +6,8 @@ const adyenEncrypt = (versionParam) => { | ||
const availableVersions = [18, 22, 23, 24, 25]; | ||
const getVersion = (version) => { | ||
return version && version >= 22 && version <= 25 ? version : 24; | ||
return availableVersions.includes(version) ? version : 24; | ||
}; | ||
module.exports = adyenEncrypt; |
{ | ||
"name": "node-adyen-encrypt", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Adyen encryption for Node.js.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,2 +11,3 @@ const adyenKey = | ||
"5F024B3294A933F4DC514DE0B5686F6C2A6A2E"; | ||
const cardData = { | ||
@@ -20,2 +21,3 @@ number: "5369 6587 0410 7605", | ||
}; | ||
const validationResponse = { | ||
@@ -35,2 +37,15 @@ valid: true, | ||
describe("app()", () => { | ||
it("should works with v18", () => { | ||
const adyenEncrypt = require("../index")(18); | ||
// apparently those weren't supported on v18? | ||
delete cardData.generationtime; | ||
delete validationResponse.generationtime; | ||
const cseInstance = adyenEncrypt.createEncryption(adyenKey, {}); | ||
const validation = cseInstance.validate(cardData); | ||
expect(validation).toEqual(validationResponse); | ||
}); | ||
it("should works with v22", () => { | ||
@@ -37,0 +52,0 @@ const adyenEncrypt = require("../index")(22); |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
440378
11
1631
5