Skip to content

Commit

Permalink
Merge pull request #877 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 10.3.0
  • Loading branch information
wboereboom authored Apr 28, 2022
2 parents 7df995e + 788d96c commit 73adc4c
Show file tree
Hide file tree
Showing 6 changed files with 791 additions and 619 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adyen/api-library",
"version": "10.2.0",
"version": "10.3.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 @@ -35,28 +35,28 @@
"author": "Ricardo Ambrogi",
"license": "MIT",
"devDependencies": {
"@types/jest": "27.4.0",
"@types/jest": "27.4.1",
"@types/nock": "11.1.0",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"acorn": "^8.0.1",
"coveralls": "3.1.1",
"dotenv": "^15.0.0",
"dotenv": "^16.0.0",
"eslint": "7.32.0",
"jest": "^27.0.6",
"jest-ts-auto-mock": "^2.0.0",
"kind-of": "^6.0.3",
"minimist": ">=1.2.3",
"nock": "13.2.2",
"release-it": "14.12.4",
"nock": "13.2.4",
"release-it": "14.14.2",
"ts-auto-mock": "^3.3.5",
"ts-jest": "^27.0.4",
"ts-loader": "8.0.10",
"ttypescript": "^1.5.10",
"typescript": "4.5.5"
"typescript": "4.6.3"
},
"dependencies": {
"https-proxy-agent": "5.0.0"
"https-proxy-agent": "5.0.1"
},
"optionalDependencies": {
"@types/node": "14.0.9"
Expand Down
17 changes: 15 additions & 2 deletions src/__tests__/platforms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ describe("Platforms Test", function () {
["suspendAccountHolder", createMock<A.SuspendAccountHolderRequest>(), createMock<A.SuspendAccountHolderResponse>()],
["unSuspendAccountHolder", createMock<A.UnSuspendAccountHolderRequest>(), createMock<A.UnSuspendAccountHolderResponse>()],
["closeAccountHolder", createMock<A.CloseAccountHolderRequest>(), createMock<A.CloseAccountResponse>()],
["getTaxForm", createMock<A.GetTaxFormRequest>(), createMock<A.GetTaxFormResponse>()],
];
test.each(cases)(
"should %p",
Expand Down Expand Up @@ -399,7 +400,19 @@ describe.skip("Platforms Test E2E", function(): void {
}
});


it("should get tax form", async function() {
nock.restore();
try {
const result = await platforms.Account.getTaxForm({
accountHolderCode: accountHolder.accountHolderCode,
formType: "1099-K",
year: 2020
});
expect(result.content).toBeDefined();
} catch (e: any) {
assertError(e);
}
});
});
});
describe("Fund", function () {
Expand Down Expand Up @@ -527,4 +540,4 @@ describe.skip("Platforms Test E2E", function(): void {
});

});
});
});
10 changes: 8 additions & 2 deletions src/services/platforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ import {
DeleteShareholderRequest,
PerformVerificationRequest,
UpdateAccountHolderStateRequest,
GetAccountHolderStatusResponse
GetAccountHolderStatusResponse,
GetTaxFormRequest,
GetTaxFormResponse,
} from "../typings/platformsAccount/models";

type AccountType = AccountTypesEnum.Accounts;
Expand Down Expand Up @@ -86,6 +88,7 @@ class Platforms extends Service {
private readonly _suspendAccountHolder: PlatformsAccount<AccountHoldersType>;
private readonly _unSuspendAccountHolder: PlatformsAccount<AccountHoldersType>;
private readonly _closeAccountHolder: PlatformsAccount<AccountHoldersType>;
private readonly _getTaxForm: PlatformsAccount<AccountHoldersType>;

/* PlatformsFund */
private readonly _accountHolderBalance: PlatformsFund;
Expand Down Expand Up @@ -128,6 +131,7 @@ class Platforms extends Service {
this._suspendAccountHolder = new PlatformsAccount<AccountHoldersType>(this, "/suspendAccountHolder");
this._unSuspendAccountHolder = new PlatformsAccount<AccountHoldersType>(this, "/unSuspendAccountHolder");
this._closeAccountHolder = new PlatformsAccount<AccountHoldersType>(this, "/closeAccountHolder");
this._getTaxForm = new PlatformsAccount<AccountHoldersType>(this, "/getTaxForm");

// Fund
this._accountHolderBalance = new PlatformsFund(this, "/accountHolderBalance");
Expand Down Expand Up @@ -171,6 +175,7 @@ class Platforms extends Service {
deleteShareholders: (request: DeleteShareholderRequest) => Promise<GenericResponse>;
checkAccountHolder: (request: PerformVerificationRequest) => Promise<GenericResponse>;
updateAccountHolderState: (request: UpdateAccountHolderStateRequest) => Promise<GetAccountHolderStatusResponse>;
getTaxForm: (request: GetTaxFormRequest) => Promise<GetTaxFormResponse>;
} {
const closeAccount = this.createRequest<AccountsAccount, CloseAccountRequest, CloseAccountResponse>(this._closeAccount);
const updateAccount = this.createRequest<AccountsAccount, UpdateAccountRequest, UpdateAccountResponse>(this._updateAccount);
Expand All @@ -190,10 +195,11 @@ class Platforms extends Service {
const unSuspendAccountHolder = this.createRequest<AccountsAccountHolders, UnSuspendAccountHolderRequest, UnSuspendAccountHolderResponse>(this._unSuspendAccountHolder);
const closeAccountHolder = this.createRequest<AccountsAccountHolders, CloseAccountHolderRequest, CloseAccountHolderResponse>(this._closeAccountHolder);
const checkAccountHolder = this.createRequest<AccountsVerification, PerformVerificationRequest, GenericResponse>(this._checkAccountHolder);
const getTaxForm = this.createRequest<AccountsAccountHolders, GetTaxFormRequest, GetTaxFormResponse>(this._getTaxForm);

const accounts = { closeAccount, updateAccount, createAccount };
const verification = { uploadDocument, getUploadedDocuments, deleteBankAccounts, deletePayoutMethods, deleteShareholders, checkAccountHolder };
const accountHolders = { createAccountHolder, getAccountHolder, updateAccountHolder, updateAccountHolderState, suspendAccountHolder, unSuspendAccountHolder, closeAccountHolder};
const accountHolders = { createAccountHolder, getAccountHolder, updateAccountHolder, updateAccountHolderState, suspendAccountHolder, unSuspendAccountHolder, closeAccountHolder, getTaxForm};

return {...accounts, ...verification, ...accountHolders };
}
Expand Down
3 changes: 2 additions & 1 deletion src/services/resource/platforms/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ type AccountHoldersEndpoints =
"/updateAccountHolderState"|
"/suspendAccountHolder"|
"/unSuspendAccountHolder"|
"/closeAccountHolder";
"/closeAccountHolder"|
"/getTaxForm";

type VerificationEndpoints =
"/uploadDocument"|
Expand Down
8 changes: 4 additions & 4 deletions src/typings/terminal/cardData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2021 Adyen B.V.
* Copyright (c) 2022 Adyen N.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
Expand Down Expand Up @@ -42,7 +42,7 @@ export class CardData {
'CardCountryCode'?: string;
'CustomerOrder'?: Array<CustomerOrder>;
'EntryMode'?: Array<CardData.EntryModeEnum>;
'MaskedPAN'?: string;
'MaskedPan'?: string;
'PaymentAccountRef'?: string;
'PaymentBrand'?: string;
'PaymentToken'?: PaymentToken;
Expand Down Expand Up @@ -78,8 +78,8 @@ export class CardData {
"type": "Array<CardData.EntryModeEnum>"
},
{
"name": "MaskedPAN",
"baseName": "MaskedPAN",
"name": "MaskedPan",
"baseName": "MaskedPan",
"type": "string"
},
{
Expand Down
Loading

0 comments on commit 73adc4c

Please sign in to comment.