Skip to content

Commit

Permalink
Merge pull request #1227 from Adyen/automation/release
Browse files Browse the repository at this point in the history
Release v14.1.0
  • Loading branch information
AdyenAutomationBot authored Sep 4, 2023
2 parents b4774d1 + 27eb843 commit 7181458
Show file tree
Hide file tree
Showing 193 changed files with 4,288 additions and 9,636 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/lib-gh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
- name: Update develop branch
run: |
git checkout develop
git merge origin/main
git push origin develop
git rebase origin/main
git push origin develop
4 changes: 3 additions & 1 deletion .github/workflows/lib-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
git fetch origin develop:develop
git reset --hard develop
- name: Get the release script
if: github.repository != 'Adyen/adyen-node-api-library'
run: |
wget https://raw.githubusercontent.com/Adyen/adyen-node-api-library/develop/.github/scripts/release.js -P ./.github/scripts
- name: Grab current version
Expand All @@ -45,6 +46,7 @@ jobs:
CURRENT_VERSION: ${{steps.current-version.outputs.currentVersion}}
NEXT_VERSION: ${{steps.release.outputs.nextVersion}}
- name: Delete the release script
if: github.repository != 'Adyen/adyen-node-api-library'
run: rm -f ./.github/scripts/release.js
- name: Create Pull Request
id: cpr
Expand All @@ -66,4 +68,4 @@ jobs:
with:
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: merge
merge-method: merge
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ openapi-generator-url:=https://repo1.maven.org/maven2/org/openapitools/openapi-g
openapi-generator-jar:=build/openapi-generator-cli.jar
openapi-generator-cli:=java -jar $(openapi-generator-jar)

services:=balanceControl balancePlatform binLookup checkout configurationWebhooks dataProtection legalEntityManagement management payment payout recurring reportWebhooks storedValue terminalManagement transfer transferWebhooks
services:=acsWebhooks balanceControl balancePlatform binLookup checkout configurationWebhooks dataProtection legalEntityManagement management managementWebhooks payment payout recurring reportWebhooks storedValue terminalManagement transfers transferWebhooks

# Generate models (for each service)
models: $(services)
Expand All @@ -26,10 +26,14 @@ platformsFund: spec=FundService-v6
platformsNotificationConfiguration: spec=NotificationConfigurationService-v6
platformsHostedOnboardingPage: spec=HopService-v6
transfers: spec=TransferService-v3

# BalanceWebhooks
acsWebhooks: spec=BalancePlatformAcsNotification-v1
configurationWebhooks: spec=BalancePlatformConfigurationNotification-v1
reportWebhooks: spec=BalancePlatformReportNotification-v1
transferWebhooks: spec=BalancePlatformTransferNotification-v3
# ManagementWebhooks
managementWebhooks: spec=ManagementNotificationService-v1

$(services): build/spec $(openapi-generator-jar)
rm -rf src/typings/$@ build/model
Expand Down
236 changes: 209 additions & 27 deletions README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adyen/api-library",
"version": "14.0.0",
"version": "14.1.0",
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
Expand Down Expand Up @@ -41,13 +41,13 @@
"acorn": "^8.0.1",
"coveralls": "3.1.1",
"dotenv": "^16.0.0",
"eslint": "8.44.0",
"eslint": "8.48.0",
"eslint-plugin-unused-imports": "^2.0.0",
"jest": "^27.0.6",
"jest-ts-auto-mock": "^2.0.0",
"kind-of": "^6.0.3",
"minimist": ">=1.2.3",
"nock": "13.3.1",
"nock": "13.3.3",
"ts-auto-mock": "^3.3.5",
"ts-jest": "^27.0.4",
"ts-loader": "9.4.4",
Expand All @@ -58,6 +58,6 @@
"https-proxy-agent": "5.0.1"
},
"optionalDependencies": {
"@types/node": "14.18.53"
"@types/node": "14.18.58"
}
}
2 changes: 1 addition & 1 deletion src/__tests__/balancePlatform.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ describe("Balance Platform", (): void => {
"status": balancePlatform.SweepConfigurationV2.StatusEnum.Inactive,
"currency": "EUR",
"schedule": {
"type": balancePlatform.CronSweepSchedule.TypeEnum.Cron
"type": balancePlatform.SweepSchedule.TypeEnum.Cron
}
};

Expand Down
73 changes: 37 additions & 36 deletions src/__tests__/classicIntegration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import nock from "nock";
import {createClient} from "../__mocks__/base";
import Client from "../client";
import ClassicIntegration from "../services/paymentApi";
import { payments } from "../typings";
import { payment } from "../typings";
import HttpClientException from "../httpClient/httpClientException";
import {PaymentResult} from "../typings/payment/paymentResult";

let client: Client;
let classicIntegration: ClassicIntegration;
Expand Down Expand Up @@ -35,7 +36,7 @@ describe("Classic Integration", (): void => {
"authCode": "011381"
}
);
const paymentRequest: payments.PaymentRequest = {
const paymentRequest: payment.PaymentRequest = {
"card": {
"number": "4111111111111111",
"expiryMonth": "03",
Expand All @@ -51,7 +52,7 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};

const paymentResult: payments.PaymentResult = await classicIntegration.authorise(paymentRequest);
const paymentResult: PaymentResult = await classicIntegration.authorise(paymentRequest);
expect(paymentResult.pspReference).toEqual("JVBXGSDM53RZNN82");
});

Expand All @@ -65,7 +66,7 @@ describe("Classic Integration", (): void => {
"errorType": "security"
}
);
const paymentRequest: payments.PaymentRequest = {
const paymentRequest: payment.PaymentRequest = {
"card": {
"number": "4111111111111111",
"expiryMonth": "03",
Expand Down Expand Up @@ -104,14 +105,14 @@ describe("Classic Integration", (): void => {
"authCode": "011381"
}
);
const paymentRequest: payments.PaymentRequest3d = {
const paymentRequest: payment.PaymentRequest3d = {
"md": "31h..........vOXek7w",
"paResponse": "eNqtmF........wGVA4Ch",
"shopperIP": "61.294.12.12",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};

const paymentResult: payments.PaymentResult = await classicIntegration.authorise3d(paymentRequest);
const paymentResult: payment.PaymentResult = await classicIntegration.authorise3d(paymentRequest);
expect(paymentResult.pspReference).toEqual("JVBXGSDM53RZNN82");
});

Expand All @@ -127,7 +128,7 @@ describe("Classic Integration", (): void => {
"authCode": "011381"
}
);
const paymentRequest: payments.PaymentRequest3ds2 = {
const paymentRequest: payment.PaymentRequest3ds2 = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"amount": {
"value": 1500,
Expand All @@ -141,7 +142,7 @@ describe("Classic Integration", (): void => {
"threeDS2Token": "— - BINARY DATA - -"
};

const paymentResult: payments.PaymentResult = await classicIntegration.authorise3ds2(paymentRequest);
const paymentResult: payment.PaymentResult = await classicIntegration.authorise3ds2(paymentRequest);
expect(paymentResult.pspReference).toEqual("JVBXGSDM53RZNN82");
});

Expand All @@ -150,25 +151,25 @@ describe("Classic Integration", (): void => {
"threeDS2Result": { "authenticationValue": "THREEDS2RESULT"}
});

const getAuthenticationResultrequest: payments.AuthenticationResultRequest = {
const getAuthenticationResultrequest: payment.AuthenticationResultRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"pspReference": "9935272408535455"
};

const getAuthenticationResultResponse: payments.AuthenticationResultResponse = await classicIntegration.getAuthenticationResult(getAuthenticationResultrequest);
const getAuthenticationResultResponse: payment.AuthenticationResultResponse = await classicIntegration.getAuthenticationResult(getAuthenticationResultrequest);
expect(getAuthenticationResultResponse?.threeDS2Result?.authenticationValue).toEqual("THREEDS2RESULT");
});

test("Should retrieve 3DS2 result", async (): Promise<void> => {
scope.post("/retrieve3ds2Result").reply(200, {
"threeDS2Result": { "authenticationValue": "THREEDS2RESULT"}
});
const retrieve3ds2ResultRequest: payments.ThreeDS2ResultRequest = {
const retrieve3ds2ResultRequest: payment.ThreeDS2ResultRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"pspReference": "9935272408535455"
};

const retrieve3ds2ResultResponse: payments.ThreeDS2ResultResponse = await classicIntegration.retrieve3ds2Result(retrieve3ds2ResultRequest);
const retrieve3ds2ResultResponse: payment.ThreeDS2ResultResponse = await classicIntegration.retrieve3ds2Result(retrieve3ds2ResultRequest);
expect(retrieve3ds2ResultResponse?.threeDS2Result?.authenticationValue).toEqual("THREEDS2RESULT");
});

Expand All @@ -179,7 +180,7 @@ describe("Classic Integration", (): void => {
"response": "[capture-received]"
});

const modificationRequest: payments.CaptureRequest = {
const modificationRequest: payment.CaptureRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
Expand All @@ -189,8 +190,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};

const modificationResult: payments.ModificationResult = await classicIntegration.capture(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.CaptureReceived);
const modificationResult: payment.ModificationResult = await classicIntegration.capture(modificationRequest);
expect(modificationResult.response).toEqual(payment.ModificationResult.ResponseEnum.CaptureReceived);
});

test("Should successfully send Cancel request", async (): Promise<void> => {
Expand All @@ -200,14 +201,14 @@ describe("Classic Integration", (): void => {
"response": "[cancel-received]"
});

const modificationRequest: payments.CancelRequest = {
const modificationRequest: payment.CancelRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"reference": "YourModificationReference",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};

const modificationResult: payments.ModificationResult = await classicIntegration.cancel(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.CancelReceived);
const modificationResult: payment.ModificationResult = await classicIntegration.cancel(modificationRequest);
expect(modificationResult.response).toEqual(payment.ModificationResult.ResponseEnum.CancelReceived);
});

test("Should successfully send Refund request", async (): Promise<void> => {
Expand All @@ -217,7 +218,7 @@ describe("Classic Integration", (): void => {
"response": "[refund-received]"
});

const modificationRequest: payments.RefundRequest = {
const modificationRequest: payment.RefundRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
Expand All @@ -227,8 +228,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};

const modificationResult: payments.ModificationResult = await classicIntegration.refund(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.RefundReceived);
const modificationResult: payment.ModificationResult = await classicIntegration.refund(modificationRequest);
expect(modificationResult.response).toEqual(payment.ModificationResult.ResponseEnum.RefundReceived);
});

test("Should successfully send CancelOrRefund request", async (): Promise<void> => {
Expand All @@ -238,14 +239,14 @@ describe("Classic Integration", (): void => {
"response": "[cancelOrRefund-received]"
});

const modificationRequest: payments.CancelOrRefundRequest = {
const modificationRequest: payment.CancelOrRefundRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"reference": "YourModificationReference",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};

const modificationResult: payments.ModificationResult = await classicIntegration.cancelOrRefund(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.CancelOrRefundReceived);
const modificationResult: payment.ModificationResult = await classicIntegration.cancelOrRefund(modificationRequest);
expect(modificationResult.response).toEqual(payment.ModificationResult.ResponseEnum.CancelOrRefundReceived);
});

test("Should successfully send TechnicalCancel request", async (): Promise<void> => {
Expand All @@ -255,7 +256,7 @@ describe("Classic Integration", (): void => {
"response": "[technical-cancel-received]"
});

const modificationRequest: payments.TechnicalCancelRequest = {
const modificationRequest: payment.TechnicalCancelRequest = {
"originalMerchantReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
Expand All @@ -265,8 +266,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};

const modificationResult: payments.ModificationResult = await classicIntegration.technicalCancel(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.TechnicalCancelReceived);
const modificationResult: payment.ModificationResult = await classicIntegration.technicalCancel(modificationRequest);
expect(modificationResult.response).toEqual(payment.ModificationResult.ResponseEnum.TechnicalCancelReceived);
});

test("Should successfully send AdjustAuthorisation request", async (): Promise<void> => {
Expand All @@ -276,7 +277,7 @@ describe("Classic Integration", (): void => {
"response": "[adjustAuthorisation-received]"
});

const modificationRequest: payments.AdjustAuthorisationRequest = {
const modificationRequest: payment.AdjustAuthorisationRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
Expand All @@ -286,8 +287,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};

const modificationResult: payments.ModificationResult = await classicIntegration.adjustAuthorisation(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.AdjustAuthorisationReceived);
const modificationResult: payment.ModificationResult = await classicIntegration.adjustAuthorisation(modificationRequest);
expect(modificationResult.response).toEqual(payment.ModificationResult.ResponseEnum.AdjustAuthorisationReceived);
});

test("Should successfully send Donate request", async (): Promise<void> => {
Expand All @@ -297,7 +298,7 @@ describe("Classic Integration", (): void => {
"response": "[donation-received]"
});

const modificationRequest: payments.DonationRequest = {
const modificationRequest: payment.DonationRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
Expand All @@ -308,8 +309,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};

const modificationResult: payments.ModificationResult = await classicIntegration.donate(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.DonationReceived);
const modificationResult: payment.ModificationResult = await classicIntegration.donate(modificationRequest);
expect(modificationResult.response).toEqual(payment.ModificationResult.ResponseEnum.DonationReceived);
});

test("Should successfully send VoidPendingRefund request", async (): Promise<void> => {
Expand All @@ -319,13 +320,13 @@ describe("Classic Integration", (): void => {
"response": "[voidPendingRefund-received]"
});

const modificationRequest: payments.VoidPendingRefundRequest = {
const modificationRequest: payment.VoidPendingRefundRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"tenderReference": "5Iw8001176969533005",
"uniqueTerminalId": "VX820-123456789"
};

const modificationResult: payments.ModificationResult = await classicIntegration.voidPendingRefund(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.VoidPendingRefundReceived);
const modificationResult: payment.ModificationResult = await classicIntegration.voidPendingRefund(modificationRequest);
expect(modificationResult.response).toEqual(payment.ModificationResult.ResponseEnum.VoidPendingRefundReceived);
});
});
6 changes: 3 additions & 3 deletions src/__tests__/management.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import nock from "nock";
import Client from "../client";
import { createClient } from "../__mocks__/base";
import { ManagemenAPI } from "../services";
import { ManagementAPI } from "../services";
import { management } from "../typings";
import * as requests from "../__mocks__/management/requests";
import * as responses from "../__mocks__/management/responses";
Expand All @@ -11,7 +11,7 @@ import {forbiddenError} from "../__mocks__/management/forbidden403";
import {invalidUserCreated422} from "../__mocks__/management/invalidUserCreated422";

let client: Client;
let managementService: ManagemenAPI;
let managementService: ManagementAPI;
let scope: nock.Scope;

const merchantId = "merchantId";
Expand All @@ -29,7 +29,7 @@ beforeEach((): void => {
}
client = createClient();
scope = nock("https://management-test.adyen.com/v1");
managementService = new ManagemenAPI(client);
managementService = new ManagementAPI(client);
});

afterEach(() => {
Expand Down
Loading

0 comments on commit 7181458

Please sign in to comment.