New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adyen/api-library

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adyen/api-library - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1-rc.0

dist/lib-esm/src/typings/index.d.ts

2

dist/lib-esm/package.d.ts

@@ -47,3 +47,2 @@ declare const _exports: {

"@types/nock": string;
"@types/node": string;
"@typescript-eslint/eslint-plugin": string;

@@ -64,2 +63,3 @@ "@typescript-eslint/parser": string;

"dependencies": {
"@types/node": string;
"https-proxy-agent": string;

@@ -66,0 +66,0 @@ };

{
"name": "@adyen/api-library",
"version": "2.2.0",
"version": "2.2.1-rc.0",
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
"main": "dist/lib/src/index.js",
"types": "dist/lib/src/index.d.ts",
"types": "dist/lib/src/typings/index.d.ts",
"module": "dist/lib-esm/src/index.js",

@@ -41,15 +41,14 @@ "engines": {

"devDependencies": {
"@babel/core": "7.7.7",
"@babel/plugin-proposal-class-properties": "7.7.4",
"@babel/plugin-proposal-object-rest-spread": "7.7.7",
"@babel/plugin-transform-runtime": "7.7.6",
"@babel/plugin-transform-typescript": "7.7.4",
"@babel/preset-env": "7.7.7",
"@babel/preset-typescript": "7.7.7",
"@babel/runtime": "7.7.7",
"@babel/core": "7.8.3",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
"@babel/plugin-transform-runtime": "7.8.3",
"@babel/plugin-transform-typescript": "7.8.3",
"@babel/preset-env": "7.8.3",
"@babel/preset-typescript": "7.8.3",
"@babel/runtime": "7.8.3",
"@types/jest": "24.0.25",
"@types/nock": "10.0.3",
"@types/node": "13.1.4",
"@typescript-eslint/eslint-plugin": "2.15.0",
"@typescript-eslint/parser": "2.15.0",
"@typescript-eslint/eslint-plugin": "2.16.0",
"@typescript-eslint/parser": "2.16.0",
"babel-loader": "8.0.6",

@@ -59,3 +58,3 @@ "coveralls": "3.0.9",

"jest": "24.9.0",
"nock": "11.7.1",
"nock": "11.7.2",
"release-it": "12.4.3",

@@ -69,4 +68,5 @@ "ts-jest": "24.3.0",

"dependencies": {
"@types/node": "13.1.7",
"https-proxy-agent": "4.0.0"
}
}

@@ -244,10 +244,8 @@ /*

it("should have payment session success", function () { return __awaiter(void 0, void 0, void 0, function () {
var client, checkout, paymentSessionRequest, paymentSessionResponse;
var paymentSessionRequest, paymentSessionResponse;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
client = createMockClientFromResponse();
scope.post("/paymentSession")
.reply(200, paymentSessionSuccess);
checkout = new Checkout(client);
paymentSessionRequest = createPaymentSessionRequest();

@@ -263,10 +261,8 @@ return [4 /*yield*/, checkout.paymentSession(paymentSessionRequest)];

it("should have payments result", function () { return __awaiter(void 0, void 0, void 0, function () {
var client, checkout, paymentResultRequest, paymentResultResponse;
var paymentResultRequest, paymentResultResponse;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
client = createMockClientFromResponse();
scope.post("/payments/result")
.reply(200, paymentsResultSuccess);
checkout = new Checkout(client);
paymentResultRequest = {

@@ -284,8 +280,7 @@ payload: "This is a test payload",

it("should have missing identifier on live", function () { return __awaiter(void 0, void 0, void 0, function () {
var client;
return __generator(this, function (_a) {
client = createMockClientFromResponse();
client.setEnvironment("LIVE");
try {
new Checkout(client);
fail();
}

@@ -299,10 +294,8 @@ catch (e) {

it("should succeed on multibanco payment", function () { return __awaiter(void 0, void 0, void 0, function () {
var client, checkout, paymentsRequest, paymentsResponse;
var paymentsRequest, paymentsResponse;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
client = createMockClientFromResponse();
scope.post("/payments")
.reply(200, paymentsResultMultibancoSuccess);
checkout = new Checkout(client);
paymentsRequest = createPaymentsCheckoutRequest();

@@ -309,0 +302,0 @@ return [4 /*yield*/, checkout.payments(paymentsRequest)];

@@ -31,4 +31,7 @@ var __assign = (this && this.__assign) || function () {

describe("HMAC Validator", function () {
var hmacValidator;
beforeEach(function () {
hmacValidator = new HmacValidator();
});
it("should get correct data", function () {
var hmacValidator = new HmacValidator();
var dataToSign = hmacValidator.getDataToSign({ merchantAccount: "ACC", currencyCode: "EUR" });

@@ -38,3 +41,2 @@ expect(dataToSign).toEqual("currencyCode:merchantAccount:EUR:ACC");

it("should get correct data with escaped characters", function () {
var hmacValidator = new HmacValidator();
var dataToSign = hmacValidator.getDataToSign({ currencyCode: "EUR", merchantAccount: "ACC:\\", sessionValidity: "2019-09-21T11:45:24.637Z" });

@@ -45,9 +47,6 @@ expect(dataToSign).toEqual("currencyCode:merchantAccount:sessionValidity:EUR:ACC\\:\\\\:2019-09-21T11\\:45\\:24.637Z");

var data = "countryCode:currencyCode:merchantAccount:merchantReference:paymentAmount:sessionValidity:skinCode:NL:EUR:MagentoMerchantTest2:TEST-PAYMENT-2017-02-01-14\\:02\\:05:199:2017-02-02T14\\:02\\:05+01\\:00:PKz2KML1";
var key = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00";
var hmacValidator = new HmacValidator();
var encrypted = hmacValidator.calculateHmac(data, key);
var encrypted = hmacValidator.calculateHmac(data, "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00");
expect(encrypted).toEqual("34oR8T1whkQWTv9P+SzKyp8zhusf9n0dpqrm9nsqSJs=");
});
it("should get correct data to sign", function () {
var hmacValidator = new HmacValidator();
var data = hmacValidator.getDataToSign(notificationRequestItem);

@@ -57,3 +56,2 @@ expect(data).toEqual("pspReference:originalReference:merchantAccount:reference:1000:EUR:EVENT:true");

it("should have valid hmac", function () {
var hmacValidator = new HmacValidator();
var encrypted = hmacValidator.calculateHmac(notificationRequestItem, key);

@@ -66,3 +64,2 @@ expect(expectedSign).toEqual(encrypted);

var invalidNotification = __assign(__assign({}, notificationRequestItem), { additionalData: (_a = {}, _a[ApiConstants.HMAC_SIGNATURE] = "notValidSign", _a) });
var hmacValidator = new HmacValidator();
var result = hmacValidator.validateHMAC(invalidNotification, key);

@@ -69,0 +66,0 @@ expect(result).toBeFalsy();

import Resource from "../services/resource";
import { IRequest } from "../typings/requestOptions";
declare function getJsonResponse<T>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<string>;
declare function getJsonResponse<T, R>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<R>;
export default getJsonResponse;

@@ -6,2 +6,3 @@ /// <reference types="node" />

import { Config } from "../index";
import { IRequest } from "../typings/requestOptions";
interface ClientInterface {

@@ -8,0 +9,0 @@ request(endpoint: string, json: string, config: Config, isApiKeyRequired: boolean, requestOptions?: IRequest.Options): Promise<string | HttpClientException | ApiException>;

@@ -7,2 +7,3 @@ /// <reference types="node" />

import ClientInterface from "./clientInterface";
import { IRequest } from "../typings/requestOptions";
declare class HttpURLConnectionClient implements ClientInterface {

@@ -9,0 +10,0 @@ private static CHARSET;

import ApiKeyAuthenticatedService from "../apiKeyAuthenticatedService";
import Client from "../client";
import { IRequest } from "../typings/requestOptions";
declare class Checkout extends ApiKeyAuthenticatedService {

@@ -4,0 +5,0 @@ private readonly _payments;

import Client from "../client";
import Service from "../service";
import { ApplicationInfo } from "../typings/applicationInfo";
import { IRequest } from "../typings/requestOptions";
interface AppInfo {

@@ -5,0 +6,0 @@ applicationInfo?: ApplicationInfo;

import Service from "../service";
import HttpClientException from "../httpClient/httpClientException";
import ApiException from "./exception/apiException";
import { IRequest } from "../typings/requestOptions";
declare abstract class Resource {

@@ -5,0 +6,0 @@ protected endpoint: string;

@@ -11,10 +11,10 @@ export declare class ApplicationInfo {

}
export interface CommonField {
declare interface CommonField {
name?: string;
version?: string;
}
export interface ExternalPlatform extends CommonField {
declare interface ExternalPlatform extends CommonField {
integrator?: string;
}
export interface MerchantDevice {
declare interface MerchantDevice {
os?: string;

@@ -24,3 +24,3 @@ osVersion?: string;

}
export interface ShopperInteractionDevice {
declare interface ShopperInteractionDevice {
os?: string;

@@ -30,1 +30,2 @@ osVersion?: string;

}
export {};

@@ -47,3 +47,2 @@ declare const _exports: {

"@types/nock": string;
"@types/node": string;
"@typescript-eslint/eslint-plugin": string;

@@ -64,2 +63,3 @@ "@typescript-eslint/parser": string;

"dependencies": {
"@types/node": string;
"https-proxy-agent": string;

@@ -66,0 +66,0 @@ };

{
"name": "@adyen/api-library",
"version": "2.2.0",
"version": "2.2.1-rc.0",
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
"main": "dist/lib/src/index.js",
"types": "dist/lib/src/index.d.ts",
"types": "dist/lib/src/typings/index.d.ts",
"module": "dist/lib-esm/src/index.js",

@@ -41,15 +41,14 @@ "engines": {

"devDependencies": {
"@babel/core": "7.7.7",
"@babel/plugin-proposal-class-properties": "7.7.4",
"@babel/plugin-proposal-object-rest-spread": "7.7.7",
"@babel/plugin-transform-runtime": "7.7.6",
"@babel/plugin-transform-typescript": "7.7.4",
"@babel/preset-env": "7.7.7",
"@babel/preset-typescript": "7.7.7",
"@babel/runtime": "7.7.7",
"@babel/core": "7.8.3",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
"@babel/plugin-transform-runtime": "7.8.3",
"@babel/plugin-transform-typescript": "7.8.3",
"@babel/preset-env": "7.8.3",
"@babel/preset-typescript": "7.8.3",
"@babel/runtime": "7.8.3",
"@types/jest": "24.0.25",
"@types/nock": "10.0.3",
"@types/node": "13.1.4",
"@typescript-eslint/eslint-plugin": "2.15.0",
"@typescript-eslint/parser": "2.15.0",
"@typescript-eslint/eslint-plugin": "2.16.0",
"@typescript-eslint/parser": "2.16.0",
"babel-loader": "8.0.6",

@@ -59,3 +58,3 @@ "coveralls": "3.0.9",

"jest": "24.9.0",
"nock": "11.7.1",
"nock": "11.7.2",
"release-it": "12.4.3",

@@ -69,4 +68,5 @@ "ts-jest": "24.3.0",

"dependencies": {
"@types/node": "13.1.7",
"https-proxy-agent": "4.0.0"
}
}

@@ -250,10 +250,8 @@ "use strict";

it("should have payment session success", function () { return __awaiter(void 0, void 0, void 0, function () {
var client, checkout, paymentSessionRequest, paymentSessionResponse;
var paymentSessionRequest, paymentSessionResponse;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
client = base_1.createMockClientFromResponse();
scope.post("/paymentSession")
.reply(200, paymentSessionSucess_1.paymentSessionSuccess);
checkout = new checkout_1.default(client);
paymentSessionRequest = createPaymentSessionRequest();

@@ -269,10 +267,8 @@ return [4 /*yield*/, checkout.paymentSession(paymentSessionRequest)];

it("should have payments result", function () { return __awaiter(void 0, void 0, void 0, function () {
var client, checkout, paymentResultRequest, paymentResultResponse;
var paymentResultRequest, paymentResultResponse;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
client = base_1.createMockClientFromResponse();
scope.post("/payments/result")
.reply(200, paymentsResultSucess_1.paymentsResultSuccess);
checkout = new checkout_1.default(client);
paymentResultRequest = {

@@ -290,8 +286,7 @@ payload: "This is a test payload",

it("should have missing identifier on live", function () { return __awaiter(void 0, void 0, void 0, function () {
var client;
return __generator(this, function (_a) {
client = base_1.createMockClientFromResponse();
client.setEnvironment("LIVE");
try {
new checkout_1.default(client);
fail();
}

@@ -305,10 +300,8 @@ catch (e) {

it("should succeed on multibanco payment", function () { return __awaiter(void 0, void 0, void 0, function () {
var client, checkout, paymentsRequest, paymentsResponse;
var paymentsRequest, paymentsResponse;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
client = base_1.createMockClientFromResponse();
scope.post("/payments")
.reply(200, paymentsResultMultibancoSuccess_1.paymentsResultMultibancoSuccess);
checkout = new checkout_1.default(client);
paymentsRequest = createPaymentsCheckoutRequest();

@@ -315,0 +308,0 @@ return [4 /*yield*/, checkout.payments(paymentsRequest)];

@@ -36,4 +36,7 @@ "use strict";

describe("HMAC Validator", function () {
var hmacValidator;
beforeEach(function () {
hmacValidator = new hmacValidator_1.default();
});
it("should get correct data", function () {
var hmacValidator = new hmacValidator_1.default();
var dataToSign = hmacValidator.getDataToSign({ merchantAccount: "ACC", currencyCode: "EUR" });

@@ -43,3 +46,2 @@ expect(dataToSign).toEqual("currencyCode:merchantAccount:EUR:ACC");

it("should get correct data with escaped characters", function () {
var hmacValidator = new hmacValidator_1.default();
var dataToSign = hmacValidator.getDataToSign({ currencyCode: "EUR", merchantAccount: "ACC:\\", sessionValidity: "2019-09-21T11:45:24.637Z" });

@@ -50,9 +52,6 @@ expect(dataToSign).toEqual("currencyCode:merchantAccount:sessionValidity:EUR:ACC\\:\\\\:2019-09-21T11\\:45\\:24.637Z");

var data = "countryCode:currencyCode:merchantAccount:merchantReference:paymentAmount:sessionValidity:skinCode:NL:EUR:MagentoMerchantTest2:TEST-PAYMENT-2017-02-01-14\\:02\\:05:199:2017-02-02T14\\:02\\:05+01\\:00:PKz2KML1";
var key = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00";
var hmacValidator = new hmacValidator_1.default();
var encrypted = hmacValidator.calculateHmac(data, key);
var encrypted = hmacValidator.calculateHmac(data, "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00");
expect(encrypted).toEqual("34oR8T1whkQWTv9P+SzKyp8zhusf9n0dpqrm9nsqSJs=");
});
it("should get correct data to sign", function () {
var hmacValidator = new hmacValidator_1.default();
var data = hmacValidator.getDataToSign(notificationRequestItem);

@@ -62,3 +61,2 @@ expect(data).toEqual("pspReference:originalReference:merchantAccount:reference:1000:EUR:EVENT:true");

it("should have valid hmac", function () {
var hmacValidator = new hmacValidator_1.default();
var encrypted = hmacValidator.calculateHmac(notificationRequestItem, key);

@@ -71,3 +69,2 @@ expect(expectedSign).toEqual(encrypted);

var invalidNotification = __assign(__assign({}, notificationRequestItem), { additionalData: (_a = {}, _a[apiConstants_1.ApiConstants.HMAC_SIGNATURE] = "notValidSign", _a) });
var hmacValidator = new hmacValidator_1.default();
var result = hmacValidator.validateHMAC(invalidNotification, key);

@@ -74,0 +71,0 @@ expect(result).toBeFalsy();

import Resource from "../services/resource";
import { IRequest } from "../typings/requestOptions";
declare function getJsonResponse<T>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<string>;
declare function getJsonResponse<T, R>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<R>;
export default getJsonResponse;

@@ -6,2 +6,3 @@ /// <reference types="node" />

import { Config } from "../index";
import { IRequest } from "../typings/requestOptions";
interface ClientInterface {

@@ -8,0 +9,0 @@ request(endpoint: string, json: string, config: Config, isApiKeyRequired: boolean, requestOptions?: IRequest.Options): Promise<string | HttpClientException | ApiException>;

@@ -7,2 +7,3 @@ /// <reference types="node" />

import ClientInterface from "./clientInterface";
import { IRequest } from "../typings/requestOptions";
declare class HttpURLConnectionClient implements ClientInterface {

@@ -9,0 +10,0 @@ private static CHARSET;

import ApiKeyAuthenticatedService from "../apiKeyAuthenticatedService";
import Client from "../client";
import { IRequest } from "../typings/requestOptions";
declare class Checkout extends ApiKeyAuthenticatedService {

@@ -4,0 +5,0 @@ private readonly _payments;

import Client from "../client";
import Service from "../service";
import { ApplicationInfo } from "../typings/applicationInfo";
import { IRequest } from "../typings/requestOptions";
interface AppInfo {

@@ -5,0 +6,0 @@ applicationInfo?: ApplicationInfo;

import Service from "../service";
import HttpClientException from "../httpClient/httpClientException";
import ApiException from "./exception/apiException";
import { IRequest } from "../typings/requestOptions";
declare abstract class Resource {

@@ -5,0 +6,0 @@ protected endpoint: string;

@@ -11,10 +11,10 @@ export declare class ApplicationInfo {

}
export interface CommonField {
declare interface CommonField {
name?: string;
version?: string;
}
export interface ExternalPlatform extends CommonField {
declare interface ExternalPlatform extends CommonField {
integrator?: string;
}
export interface MerchantDevice {
declare interface MerchantDevice {
os?: string;

@@ -24,3 +24,3 @@ osVersion?: string;

}
export interface ShopperInteractionDevice {
declare interface ShopperInteractionDevice {
os?: string;

@@ -30,1 +30,2 @@ osVersion?: string;

}
export {};
{
"name": "@adyen/api-library",
"version": "2.2.0",
"version": "2.2.1-rc.0",
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
"main": "dist/lib/src/index.js",
"types": "dist/lib/src/index.d.ts",
"types": "dist/lib/src/typings/index.d.ts",
"module": "dist/lib-esm/src/index.js",

@@ -41,15 +41,14 @@ "engines": {

"devDependencies": {
"@babel/core": "7.7.7",
"@babel/plugin-proposal-class-properties": "7.7.4",
"@babel/plugin-proposal-object-rest-spread": "7.7.7",
"@babel/plugin-transform-runtime": "7.7.6",
"@babel/plugin-transform-typescript": "7.7.4",
"@babel/preset-env": "7.7.7",
"@babel/preset-typescript": "7.7.7",
"@babel/runtime": "7.7.7",
"@babel/core": "7.8.3",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
"@babel/plugin-transform-runtime": "7.8.3",
"@babel/plugin-transform-typescript": "7.8.3",
"@babel/preset-env": "7.8.3",
"@babel/preset-typescript": "7.8.3",
"@babel/runtime": "7.8.3",
"@types/jest": "24.0.25",
"@types/nock": "10.0.3",
"@types/node": "13.1.4",
"@typescript-eslint/eslint-plugin": "2.15.0",
"@typescript-eslint/parser": "2.15.0",
"@typescript-eslint/eslint-plugin": "2.16.0",
"@typescript-eslint/parser": "2.16.0",
"babel-loader": "8.0.6",

@@ -59,3 +58,3 @@ "coveralls": "3.0.9",

"jest": "24.9.0",
"nock": "11.7.1",
"nock": "11.7.2",
"release-it": "12.4.3",

@@ -69,4 +68,5 @@ "ts-jest": "24.3.0",

"dependencies": {
"@types/node": "13.1.7",
"https-proxy-agent": "4.0.0"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc