Skip to content
Draft

LEM v4 #1544

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 34 additions & 28 deletions src/__mocks__/legalEntityManagement/responses.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
export const businessLine = {
"capability": "receivePayments",
"id": "123456789",
"industryCode": "123456789",
"legalEntityId": "123456789",
"salesChannels": ["string"],
"sourceOfFunds": {
"acquiringBusinessLineId": "string",
"adyenProcessedFunds": false,
"description": "string",
"type": "business"
},
"webData": [{ "webAddress": "string" }],
"webDataExemption": { "reason": "noOnlinePresence" }
"service": "banking",
"industryCode": "4531",
"legalEntityId": "LE00000000000000000000001",
"sourceOfFunds": {
"adyenProcessedFunds": false,
"description": "Funds from my flower shop business",
"type": "business"
},
"webData": [
{
"webAddress": "https://www.adyen.com",
"webAddressId": "SE322JV223222J5H8V87B3DHN"
}
],
"id": "SE322KH223222F5GV2SQ924F6"
};

export const document = {
Expand Down Expand Up @@ -235,21 +237,25 @@ export const legalEntityUnknownEnum = {
};

export const businessLines = {
"businessLines": [{
"capability": "receivePayments",
"id": "123456789",
"industryCode": "123456789",
"legalEntityId": "123456789",
"salesChannels": ["string"],
"sourceOfFunds": {
"acquiringBusinessLineId": "string",
"adyenProcessedFunds": false,
"description": "string",
"type": "business"
},
"webData": [{ "webAddress": "string" }],
"webDataExemption": { "reason": "noOnlinePresence" }
}]
"businessLines": [
businessLine,
{
"service": "paymentProcessing",
"industryCode": "339E",
"legalEntityId": "LE00000000000000000000001",
"salesChannels": [
"eCommerce",
"ecomMoto"
],
"webData": [
{
"webAddress": "https://yoururl.com",
"webAddressId": "SE908HJ723222F5GVGPNR55YH"
}
],
"id": "SE322JV223222F5GVGPNRB9GJ"
}
]
};

export const transferInstrument = {
Expand Down
42 changes: 14 additions & 28 deletions src/__tests__/legalEntityManagement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ beforeEach((): void => {
nock.activate();
}
client = createClient();
scope = nock("https://kyc-test.adyen.com/lem/v3");
scope = nock("https://kyc-test.adyen.com/lem/v4");
legalEntityManagement = new LegalEntityManagementAPI(client);
});

Expand Down Expand Up @@ -115,21 +115,11 @@ describe("Legal Entity Management", (): void => {

const response: models.BusinessLines = await legalEntityManagement.LegalEntitiesApi.getAllBusinessLinesUnderLegalEntity(id);

expect(response.businessLines).toEqual( [{
"capability": "receivePayments",
"id": "123456789",
"industryCode": "123456789",
"legalEntityId": "123456789",
"salesChannels": ["string"],
"sourceOfFunds": {
"acquiringBusinessLineId": "string",
"adyenProcessedFunds": false,
"description": "string",
"type": "business"
},
"webData": [{ "webAddress": "string" }],
"webDataExemption": { "reason": "noOnlinePresence" }
}]);
expect(response.businessLines.length).toBe(2);
expect(response.businessLines[0]).toBeTruthy;
expect(response.businessLines[0].id).toBe("SE322KH223222F5GV2SQ924F6");
expect(response.businessLines[0].industryCode).toBe("4531");
expect(response.businessLines[0].sourceOfFunds?.adyenProcessedFunds).toBe(false);
});

});
Expand Down Expand Up @@ -207,18 +197,16 @@ describe("Legal Entity Management", (): void => {
.reply(200, businessLine);

const request: models.BusinessLineInfo = {
capability: models.BusinessLineInfo.CapabilityEnum.ReceivePayments,
industryCode: id,
legalEntityId: id,
service: models.BusinessLine.ServiceEnum.Banking
};

const response: models.BusinessLine = await legalEntityManagement.BusinessLinesApi.createBusinessLine(request);

expect(response.id).toBe(id);
expect(response.capability).toBe(models.BusinessLineInfo.CapabilityEnum.ReceivePayments);
expect(response.industryCode).toBe(id);
expect(response.legalEntityId).toBe(id);
expect(response.id).toBe("SE322KH223222F5GV2SQ924F6");
expect(response.industryCode).toBe("4531");
expect(response.legalEntityId).toBe("LE00000000000000000000001");
});

it("should support GET /businessLines/{id}", async (): Promise<void> => {
Expand All @@ -227,27 +215,25 @@ describe("Legal Entity Management", (): void => {

const response: models.BusinessLine = await legalEntityManagement.BusinessLinesApi.getBusinessLine(id);

expect(response.id).toBe(id);
expect(response.capability).toBe("receivePayments");
expect(response.id).toBe("SE322KH223222F5GV2SQ924F6");
expect(response.service).toBe("banking");
});

it("should support PATCH /businessLines/{id}", async (): Promise<void> => {
scope.patch(`/businessLines/${id}`)
.reply(200, businessLine);

const request: models.BusinessLineInfo = {
capability: models.BusinessLineInfo.CapabilityEnum.ReceivePayments,
industryCode: id,
service: models.BusinessLine.ServiceEnum.Banking,
legalEntityId: id
};

const response: models.BusinessLine = await legalEntityManagement.BusinessLinesApi.updateBusinessLine(id, request);

expect(response.id).toBe(id);
expect(response.capability).toBe(models.BusinessLineInfo.CapabilityEnum.ReceivePayments);
expect(response.industryCode).toBe(id);
expect(response.legalEntityId).toBe(id);
expect(response.id).toBe("SE322KH223222F5GV2SQ924F6");
expect(response.industryCode).toBe("4531");
expect(response.legalEntityId).toBe("LE00000000000000000000001");
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/services/legalEntityManagement/businessLinesApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -24,7 +24,7 @@ import { BusinessLineInfoUpdate } from "../../typings/legalEntityManagement/mode
*/
export class BusinessLinesApi extends Service {

private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v3";
private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v4";
private baseUrl: string;

public constructor(client: Client){
Expand Down
4 changes: 2 additions & 2 deletions src/services/legalEntityManagement/documentsApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -22,7 +22,7 @@ import { Document } from "../../typings/legalEntityManagement/models";
*/
export class DocumentsApi extends Service {

private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v3";
private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v4";
private baseUrl: string;

public constructor(client: Client){
Expand Down
4 changes: 2 additions & 2 deletions src/services/legalEntityManagement/hostedOnboardingApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -25,7 +25,7 @@ import { OnboardingThemes } from "../../typings/legalEntityManagement/models";
*/
export class HostedOnboardingApi extends Service {

private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v3";
private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v4";
private baseUrl: string;

public constructor(client: Client){
Expand Down
2 changes: 1 addition & 1 deletion src/services/legalEntityManagement/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
4 changes: 2 additions & 2 deletions src/services/legalEntityManagement/legalEntitiesApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -27,7 +27,7 @@ import { VerificationErrors } from "../../typings/legalEntityManagement/models";
*/
export class LegalEntitiesApi extends Service {

private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v3";
private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v4";
private baseUrl: string;

public constructor(client: Client){
Expand Down
4 changes: 2 additions & 2 deletions src/services/legalEntityManagement/pCIQuestionnairesApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -29,7 +29,7 @@ import { PciSigningResponse } from "../../typings/legalEntityManagement/models";
*/
export class PCIQuestionnairesApi extends Service {

private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v3";
private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v4";
private baseUrl: string;

public constructor(client: Client){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -23,7 +23,7 @@ import { SetTaxElectronicDeliveryConsentRequest } from "../../typings/legalEntit
*/
export class TaxEDeliveryConsentApi extends Service {

private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v3";
private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v4";
private baseUrl: string;

public constructor(client: Client){
Expand Down
4 changes: 2 additions & 2 deletions src/services/legalEntityManagement/termsOfServiceApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -28,7 +28,7 @@ import { GetTermsOfServiceDocumentResponse } from "../../typings/legalEntityMana
*/
export class TermsOfServiceApi extends Service {

private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v3";
private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v4";
private baseUrl: string;

public constructor(client: Client){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -23,7 +23,7 @@ import { TransferInstrumentInfo } from "../../typings/legalEntityManagement/mode
*/
export class TransferInstrumentsApi extends Service {

private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v3";
private readonly API_BASEPATH: string = "https://kyc-test.adyen.com/lem/v4";
private baseUrl: string;

public constructor(client: Client){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/typings/legalEntityManagement/address.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/typings/legalEntityManagement/amount.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/typings/legalEntityManagement/attachment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/typings/legalEntityManagement/bankAccountInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion src/typings/legalEntityManagement/birthData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The version of the OpenAPI document: v3
* The version of the OpenAPI document: v4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Loading