mirror of
https://github.com/jlengrand/adyen-node-api-library.git
synced 2026-03-10 08:01:20 +00:00
Merge branch 'develop' into PW-7518
This commit is contained in:
14
.github/dependabot.yml
vendored
14
.github/dependabot.yml
vendored
@@ -1,14 +0,0 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
time: "04:00"
|
||||
open-pull-requests-limit: 10
|
||||
reviewers:
|
||||
- "zaiddreakh"
|
||||
- "maassenbas"
|
||||
- "AlexandrosMor"
|
||||
- "peterojo"
|
||||
- "wboereboom"
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
|
||||
2
.github/workflows/coveralls.yml
vendored
2
.github/workflows/coveralls.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Use Node.js 16.x
|
||||
uses: actions/setup-node@v3
|
||||
|
||||
2
.github/workflows/nodejs.yml
vendored
2
.github/workflows/nodejs.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
|
||||
2
.github/workflows/npmpublish.yml
vendored
2
.github/workflows/npmpublish.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
publish-npm:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
2
.github/workflows/sonarcloud.yml
vendored
2
.github/workflows/sonarcloud.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# Disabling shallow clone to improve relevancy of SonarCloud reporting
|
||||
fetch-depth: 0
|
||||
|
||||
9
Makefile
9
Makefile
@@ -1,12 +1,13 @@
|
||||
generator:=typescript-node
|
||||
openapi-generator-cli:=docker run --user $(shell id -u):$(shell id -g) --rm -v /home/vagrant/adyen-node-api-library:/local -w /local openapitools/openapi-generator-cli:v5.4.0
|
||||
services:=webhooks
|
||||
openapi-generator-cli:=docker run --user $(shell id -u):$(shell id -g) --rm -v ${PWD}:/local -w /local openapitools/openapi-generator-cli:v5.4.0
|
||||
services:=balancePlatform binlookup checkout dataProtection legalEntityManagement management payments payouts platformsAccount platformsFund platformsHostedOnboardingPage platformsNotificationConfiguration recurring storedValue terminalManagement transfer
|
||||
|
||||
# Generate models (for each service)
|
||||
models: $(services)
|
||||
|
||||
binlookup: spec=BinLookupService-v52
|
||||
checkout: spec=CheckoutService-v69
|
||||
dataProtection: spec=DataProtectionService-v1
|
||||
storedValue: spec=StoredValueService-v46
|
||||
terminalManagement: spec=TfmAPIService-v1
|
||||
payments: spec=PaymentService-v68
|
||||
@@ -20,7 +21,6 @@ platformsFund: spec=FundService-v6
|
||||
platformsNotificationConfiguration: spec=NotificationConfigurationService-v6
|
||||
platformsHostedOnboardingPage: spec=HopService-v6
|
||||
transfer: spec=TransferService-v3
|
||||
webhooks: spec=Webhooks-v1
|
||||
|
||||
$(services): build/spec
|
||||
rm -rf src/typings/$@ build/model
|
||||
@@ -29,8 +29,7 @@ $(services): build/spec
|
||||
-g $(generator) \
|
||||
-t templates/typescript \
|
||||
-o build \
|
||||
--global-property models,supportingFiles \
|
||||
--skip-validate-spec
|
||||
--global-property models,supportingFiles
|
||||
mv build/model src/typings/$@
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ The Library supports all APIs under the following services:
|
||||
* [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v68/overview): Endpoints for managing saved payment details. Current supported version: **v68**
|
||||
* [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api): Manage both online and point-of-sale gift cards and other stored-value cards. Current supported version: **v46**
|
||||
* [Transfers API](https://docs.adyen.com/api-explorer/transfers/3/overview) The Transfers API provides endpoints that you can use to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. **v3**
|
||||
* [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) **v1**
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -38,11 +38,11 @@
|
||||
"@types/jest": "27.5.2",
|
||||
"@types/nock": "11.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.43.0",
|
||||
"@typescript-eslint/parser": "5.43.0",
|
||||
"@typescript-eslint/parser": "5.45.0",
|
||||
"acorn": "^8.0.1",
|
||||
"coveralls": "3.1.1",
|
||||
"dotenv": "^16.0.0",
|
||||
"eslint": "8.27.0",
|
||||
"eslint": "8.28.0",
|
||||
"jest": "^27.0.6",
|
||||
"jest-ts-auto-mock": "^2.0.0",
|
||||
"kind-of": "^6.0.3",
|
||||
@@ -53,7 +53,7 @@
|
||||
"ts-jest": "^27.0.4",
|
||||
"ts-loader": "8.0.10",
|
||||
"ttypescript": "^1.5.10",
|
||||
"typescript": "4.8.4"
|
||||
"typescript": "4.9.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"https-proxy-agent": "5.0.1"
|
||||
|
||||
@@ -50,7 +50,8 @@ export const createClient = (apiKey = process.env.ADYEN_API_KEY): Client => {
|
||||
config.managementEndpoint = Client.MANAGEMENT_API_ENDPOINT_TEST;
|
||||
config.balancePlatformEndpoint = Client.BALANCE_PLATFORM_API_ENDPOINT_TEST;
|
||||
config.legalEntityManagementEndpoint = Client.LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_TEST;
|
||||
config.transfersEndpoint = Client.TRANSFERS_API_VERSION_TEST;
|
||||
config.transfersEndpoint = Client.TRANSFERS_API_ENDPOINT_TEST;
|
||||
config.dataProtectionEndpoint = Client.DATA_PROTECTION_API_ENDPOINT_TEST;
|
||||
|
||||
return new Client({ config });
|
||||
};
|
||||
|
||||
60
src/__tests__/dataProtection.spec.ts
Normal file
60
src/__tests__/dataProtection.spec.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import nock from "nock";
|
||||
import { createClient } from "../__mocks__/base";
|
||||
import { DataProtection } from "../services";
|
||||
import Client from "../client";
|
||||
import HttpClientException from "../httpClient/httpClientException";
|
||||
import {SubjectErasureByPspReferenceRequest, SubjectErasureResponse } from "../typings/dataProtection/models";
|
||||
|
||||
let client: Client,
|
||||
dataProtection: DataProtection,
|
||||
scope: nock.Scope;
|
||||
|
||||
beforeEach((): void => {
|
||||
if(!nock.isActive()) {
|
||||
nock.activate();
|
||||
}
|
||||
client = createClient();
|
||||
dataProtection = new DataProtection(client);
|
||||
scope = nock(`${client.config.dataProtectionEndpoint}/${Client.DATA_PROTECTION_API_VERSION}`);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
nock.cleanAll();
|
||||
});
|
||||
|
||||
describe("DataProtection", (): void => {
|
||||
test("should make succesful subjectErasure call", async (): Promise<void> => {
|
||||
const requestSubjectErasureSuccess: SubjectErasureResponse = {
|
||||
"result": SubjectErasureResponse.ResultEnum.Success,
|
||||
};
|
||||
|
||||
const requestSubjectErasureRequest: SubjectErasureByPspReferenceRequest = {
|
||||
"merchantAccount": "MY_MERCHANT_ACCOUNT",
|
||||
"forceErasure": true,
|
||||
"pspReference": "0123456789"
|
||||
};
|
||||
|
||||
scope.post("/requestSubjectErasure")
|
||||
.reply(200, requestSubjectErasureSuccess);
|
||||
|
||||
const response: SubjectErasureResponse = await dataProtection.requestSubjectErasure(requestSubjectErasureRequest);
|
||||
expect(response.result).toEqual(SubjectErasureResponse.ResultEnum.Success);
|
||||
});
|
||||
|
||||
test.each([false, true])("should return correct Exception, isMock: %p", async (isMock): Promise<void> => {
|
||||
!isMock && nock.restore();
|
||||
try {
|
||||
scope.post("/requestSubjectErasure")
|
||||
.reply(401);
|
||||
|
||||
const requestSubjectErasureRequest: SubjectErasureByPspReferenceRequest = {
|
||||
"merchantAccount": "MY_MERCHANT_ACCOUNT",
|
||||
"forceErasure": true,
|
||||
"pspReference": "0123456789"
|
||||
};
|
||||
await dataProtection.requestSubjectErasure(requestSubjectErasureRequest);
|
||||
} catch (e) {
|
||||
expect(e instanceof HttpClientException).toBeTruthy();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -68,9 +68,12 @@ class Client {
|
||||
public static LEGAL_ENTITY_MANAGEMENT_API_VERSION = "v2";
|
||||
public static LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_TEST = "https://kyc-test.adyen.com/lem";
|
||||
public static LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_LIVE = "https://kyc-live.adyen.com/lem";
|
||||
public static TRANSFERS_API_VERSION="v3";
|
||||
public static TRANSFERS_API_VERSION_TEST = "https://balanceplatform-api-test.adyen.com/btl";
|
||||
public static TRANSFERS_API_VERSION_LIVE = "https://balanceplatform-api-live.adyen.com/btl";
|
||||
public static TRANSFERS_API_VERSION = "v3";
|
||||
public static TRANSFERS_API_ENDPOINT_TEST = "https://balanceplatform-api-test.adyen.com/btl";
|
||||
public static TRANSFERS_API_ENDPOINT_LIVE = "https://balanceplatform-api-live.adyen.com/btl";
|
||||
public static DATA_PROTECTION_API_VERSION = "v1";
|
||||
public static DATA_PROTECTION_API_ENDPOINT_TEST = "https://ca-test.adyen.com/ca/services/DataProtectionService";
|
||||
public static DATA_PROTECTION_API_ENDPOINT_LIVE = "https://ca-live.adyen.com/ca/services/DataProtectionService";
|
||||
|
||||
|
||||
private _httpClient!: ClientInterface;
|
||||
@@ -116,7 +119,8 @@ class Client {
|
||||
this.config.managementEndpoint = Client.MANAGEMENT_API_ENDPOINT_TEST;
|
||||
this.config.balancePlatformEndpoint = Client.BALANCE_PLATFORM_API_ENDPOINT_TEST;
|
||||
this.config.legalEntityManagementEndpoint = Client.LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_TEST;
|
||||
this.config.transfersEndpoint = Client.TRANSFERS_API_VERSION_TEST;
|
||||
this.config.transfersEndpoint = Client.TRANSFERS_API_ENDPOINT_TEST;
|
||||
this.config.dataProtectionEndpoint = Client.DATA_PROTECTION_API_ENDPOINT_TEST;
|
||||
} else if (environment === "LIVE") {
|
||||
this.config.endpoint = Client.ENDPOINT_LIVE;
|
||||
this.config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_LIVE;
|
||||
@@ -128,7 +132,8 @@ class Client {
|
||||
this.config.managementEndpoint = Client.MANAGEMENT_API_ENDPOINT_LIVE;
|
||||
this.config.balancePlatformEndpoint = Client.BALANCE_PLATFORM_API_ENDPOINT_LIVE;
|
||||
this.config.legalEntityManagementEndpoint = Client.LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_LIVE;
|
||||
this.config.transfersEndpoint = Client.TRANSFERS_API_VERSION_LIVE;
|
||||
this.config.transfersEndpoint = Client.TRANSFERS_API_ENDPOINT_LIVE;
|
||||
this.config.dataProtectionEndpoint = Client.DATA_PROTECTION_API_ENDPOINT_LIVE;
|
||||
|
||||
if (liveEndpointUrlPrefix) {
|
||||
this.config.endpoint =
|
||||
|
||||
@@ -41,6 +41,7 @@ interface ConfigConstructor {
|
||||
balancePlatformEndpoint?: string;
|
||||
legalEntityManagementEndpoint?: string;
|
||||
transfersEndpoint?: string;
|
||||
dataProtectionEndpoint?: string;
|
||||
}
|
||||
|
||||
class Config {
|
||||
@@ -72,6 +73,7 @@ class Config {
|
||||
public balancePlatformEndpoint?: string;
|
||||
public legalEntityManagementEndpoint?: string;
|
||||
public transfersEndpoint?: string;
|
||||
public dataProtectionEndpoint?: string;
|
||||
|
||||
public constructor(options: ConfigConstructor = {}) {
|
||||
if (options.username) this.username = options.username;
|
||||
@@ -98,6 +100,7 @@ class Config {
|
||||
if (options.balancePlatformEndpoint) this.balancePlatformEndpoint = options.balancePlatformEndpoint;
|
||||
if (options.legalEntityManagementEndpoint) this.legalEntityManagementEndpoint = options.legalEntityManagementEndpoint;
|
||||
if (options.transfersEndpoint) this.transfersEndpoint = options.transfersEndpoint;
|
||||
if (options.dataProtectionEndpoint) this.dataProtectionEndpoint = options.dataProtectionEndpoint;
|
||||
}
|
||||
|
||||
public set checkoutEndpoint(checkoutEndpoint: string | undefined) {
|
||||
|
||||
25
src/services/dataProtection.ts
Normal file
25
src/services/dataProtection.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import Client from "../client";
|
||||
import getJsonResponse from "../helpers/getJsonResponse";
|
||||
import Service from "../service";
|
||||
import { SubjectErasureByPspReferenceRequest, SubjectErasureResponse, ObjectSerializer } from "../typings/dataProtection/models";
|
||||
import DataProtectionResource from "./resource/dataProtectionresource";
|
||||
import { IRequest } from "../typings/requestOptions";
|
||||
|
||||
class DataProtection extends Service {
|
||||
private readonly _dataProtectionResource: DataProtectionResource;
|
||||
|
||||
public constructor(client: Client) {
|
||||
super(client);
|
||||
this._dataProtectionResource = new DataProtectionResource(this, "/requestSubjectErasure");
|
||||
}
|
||||
public async requestSubjectErasure(subjectErasureByPspReferenceRequest: SubjectErasureByPspReferenceRequest, requestOptions?: IRequest.Options): Promise<SubjectErasureResponse> {
|
||||
const response = await getJsonResponse<SubjectErasureByPspReferenceRequest, SubjectErasureResponse>(
|
||||
this._dataProtectionResource,
|
||||
subjectErasureByPspReferenceRequest,
|
||||
requestOptions,
|
||||
);
|
||||
return ObjectSerializer.deserialize(response, "SubjectErasureResponse");
|
||||
}
|
||||
}
|
||||
|
||||
export default DataProtection;
|
||||
@@ -11,3 +11,5 @@ export { default as TerminalManagement} from "./terminalManagement";
|
||||
export { default as Management } from "./management";
|
||||
export { default as LegalEntityManagement } from "./legalEntityManagement";
|
||||
export { default as Transfers } from "./transfers";
|
||||
export { default as BalancePlatform } from "./balancePlatform";
|
||||
export { default as DataProtection } from "./dataProtection";
|
||||
|
||||
14
src/services/resource/dataProtectionresource.ts
Normal file
14
src/services/resource/dataProtectionresource.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import Client from "../../client";
|
||||
import Service from "../../service";
|
||||
import Resource from "../resource";
|
||||
|
||||
class DataProtectionResource extends Resource {
|
||||
public constructor(service: Service, endpoint: string) {
|
||||
super(
|
||||
service,
|
||||
`${service.client.config.dataProtectionEndpoint}/${Client.DATA_PROTECTION_API_VERSION}${endpoint}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default DataProtectionResource;
|
||||
154
src/typings/dataProtection/models.ts
Normal file
154
src/typings/dataProtection/models.ts
Normal file
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* The version of the OpenAPI document: v1
|
||||
* Contact: developer-experience@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit this class manually.
|
||||
*/
|
||||
|
||||
|
||||
export * from './serviceError';
|
||||
export * from './subjectErasureByPspReferenceRequest';
|
||||
export * from './subjectErasureResponse';
|
||||
|
||||
|
||||
import { ServiceError } from './serviceError';
|
||||
import { SubjectErasureByPspReferenceRequest } from './subjectErasureByPspReferenceRequest';
|
||||
import { SubjectErasureResponse } from './subjectErasureResponse';
|
||||
|
||||
/* tslint:disable:no-unused-variable */
|
||||
let primitives = [
|
||||
"string",
|
||||
"boolean",
|
||||
"double",
|
||||
"integer",
|
||||
"long",
|
||||
"float",
|
||||
"number",
|
||||
"any"
|
||||
];
|
||||
|
||||
let enumsMap: {[index: string]: any} = {
|
||||
"SubjectErasureResponse.ResultEnum": SubjectErasureResponse.ResultEnum,
|
||||
}
|
||||
|
||||
let typeMap: {[index: string]: any} = {
|
||||
"ServiceError": ServiceError,
|
||||
"SubjectErasureByPspReferenceRequest": SubjectErasureByPspReferenceRequest,
|
||||
"SubjectErasureResponse": SubjectErasureResponse,
|
||||
}
|
||||
|
||||
export class ObjectSerializer {
|
||||
public static findCorrectType(data: any, expectedType: string) {
|
||||
if (data == undefined) {
|
||||
return expectedType;
|
||||
} else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
|
||||
return expectedType;
|
||||
} else if (expectedType === "Date") {
|
||||
return expectedType;
|
||||
} else {
|
||||
if (enumsMap[expectedType]) {
|
||||
return expectedType;
|
||||
}
|
||||
|
||||
if (!typeMap[expectedType]) {
|
||||
return expectedType; // w/e we don't know the type
|
||||
}
|
||||
|
||||
// Check the discriminator
|
||||
let discriminatorProperty = typeMap[expectedType].discriminator;
|
||||
if (discriminatorProperty == null) {
|
||||
return expectedType; // the type does not have a discriminator. use it.
|
||||
} else {
|
||||
if (data[discriminatorProperty]) {
|
||||
var discriminatorType = data[discriminatorProperty];
|
||||
if(typeMap[discriminatorType]){
|
||||
return discriminatorType; // use the type given in the discriminator
|
||||
} else {
|
||||
return expectedType; // discriminator did not map to a type
|
||||
}
|
||||
} else {
|
||||
return expectedType; // discriminator was not present (or an empty string)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static serialize(data: any, type: string) {
|
||||
if (data == undefined) {
|
||||
return data;
|
||||
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
|
||||
return data;
|
||||
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
|
||||
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
|
||||
subType = subType.substring(0, subType.length - 1); // Type> => Type
|
||||
let transformedData: any[] = [];
|
||||
for (let index = 0; index < data.length; index++) {
|
||||
let datum = data[index];
|
||||
transformedData.push(ObjectSerializer.serialize(datum, subType));
|
||||
}
|
||||
return transformedData;
|
||||
} else if (type === "Date") {
|
||||
return data.toISOString();
|
||||
} else if (type === "SaleToAcquirerData") {
|
||||
const dataString = JSON.stringify(data);
|
||||
return Buffer.from(dataString).toString("base64");
|
||||
} else {
|
||||
if (enumsMap[type]) {
|
||||
return data;
|
||||
}
|
||||
if (!typeMap[type]) { // in case we dont know the type
|
||||
return data;
|
||||
}
|
||||
|
||||
// Get the actual type of this object
|
||||
type = this.findCorrectType(data, type);
|
||||
|
||||
// get the map for the correct type.
|
||||
let attributeTypes = typeMap[type].getAttributeTypeMap();
|
||||
let instance: {[index: string]: any} = {};
|
||||
for (let index = 0; index < attributeTypes.length; index++) {
|
||||
let attributeType = attributeTypes[index];
|
||||
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static deserialize(data: any, type: string) {
|
||||
// polymorphism may change the actual type.
|
||||
type = ObjectSerializer.findCorrectType(data, type);
|
||||
if (data == undefined) {
|
||||
return data;
|
||||
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
|
||||
return data;
|
||||
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
|
||||
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
|
||||
subType = subType.substring(0, subType.length - 1); // Type> => Type
|
||||
let transformedData: any[] = [];
|
||||
for (let index = 0; index < data.length; index++) {
|
||||
let datum = data[index];
|
||||
transformedData.push(ObjectSerializer.deserialize(datum, subType));
|
||||
}
|
||||
return transformedData;
|
||||
} else if (type === "Date") {
|
||||
return new Date(data);
|
||||
} else {
|
||||
if (enumsMap[type]) {// is Enum
|
||||
return data;
|
||||
}
|
||||
|
||||
if (!typeMap[type]) { // dont know the type
|
||||
return data;
|
||||
}
|
||||
let instance = new typeMap[type]();
|
||||
let attributeTypes = typeMap[type].getAttributeTypeMap();
|
||||
for (let index = 0; index < attributeTypes.length; index++) {
|
||||
let attributeType = attributeTypes[index];
|
||||
instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
66
src/typings/dataProtection/serviceError.ts
Normal file
66
src/typings/dataProtection/serviceError.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* The version of the OpenAPI document: v1
|
||||
* Contact: developer-experience@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit this class manually.
|
||||
*/
|
||||
|
||||
|
||||
export class ServiceError {
|
||||
/**
|
||||
* The error code mapped to the error message.
|
||||
*/
|
||||
'errorCode'?: string;
|
||||
/**
|
||||
* The category of the error.
|
||||
*/
|
||||
'errorType'?: string;
|
||||
/**
|
||||
* A short explanation of the issue.
|
||||
*/
|
||||
'message'?: string;
|
||||
/**
|
||||
* The PSP reference of the payment.
|
||||
*/
|
||||
'pspReference'?: string;
|
||||
/**
|
||||
* The HTTP response status.
|
||||
*/
|
||||
'status'?: number;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "errorCode",
|
||||
"baseName": "errorCode",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "errorType",
|
||||
"baseName": "errorType",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"baseName": "message",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "pspReference",
|
||||
"baseName": "pspReference",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"baseName": "status",
|
||||
"type": "number"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return ServiceError.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* The version of the OpenAPI document: v1
|
||||
* Contact: developer-experience@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit this class manually.
|
||||
*/
|
||||
|
||||
|
||||
export class SubjectErasureByPspReferenceRequest {
|
||||
/**
|
||||
* Set this to **true** if you want to delete shopper-related data, even if the shopper has an existing recurring transaction. This only deletes the shopper-related data for the specific payment, but does not cancel the existing recurring transaction.
|
||||
*/
|
||||
'forceErasure'?: boolean;
|
||||
/**
|
||||
* Your merchant account
|
||||
*/
|
||||
'merchantAccount'?: string;
|
||||
/**
|
||||
* The PSP reference of the payment. We will delete all shopper-related data for this payment.
|
||||
*/
|
||||
'pspReference'?: string;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "forceErasure",
|
||||
"baseName": "forceErasure",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "merchantAccount",
|
||||
"baseName": "merchantAccount",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "pspReference",
|
||||
"baseName": "pspReference",
|
||||
"type": "string"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return SubjectErasureByPspReferenceRequest.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
||||
38
src/typings/dataProtection/subjectErasureResponse.ts
Normal file
38
src/typings/dataProtection/subjectErasureResponse.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* The version of the OpenAPI document: v1
|
||||
* Contact: developer-experience@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit this class manually.
|
||||
*/
|
||||
|
||||
|
||||
export class SubjectErasureResponse {
|
||||
/**
|
||||
* The result of this operation.
|
||||
*/
|
||||
'result'?: SubjectErasureResponse.ResultEnum;
|
||||
|
||||
static discriminator: string | undefined = undefined;
|
||||
|
||||
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
|
||||
{
|
||||
"name": "result",
|
||||
"baseName": "result",
|
||||
"type": "SubjectErasureResponse.ResultEnum"
|
||||
} ];
|
||||
|
||||
static getAttributeTypeMap() {
|
||||
return SubjectErasureResponse.attributeTypeMap;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace SubjectErasureResponse {
|
||||
export enum ResultEnum {
|
||||
ActiveRecurringTokenExists = <any> 'ACTIVE_RECURRING_TOKEN_EXISTS',
|
||||
AlreadyProcessed = <any> 'ALREADY_PROCESSED',
|
||||
PaymentNotFound = <any> 'PAYMENT_NOT_FOUND',
|
||||
Success = <any> 'SUCCESS'
|
||||
}
|
||||
}
|
||||
@@ -24,3 +24,4 @@ export * as terminalManagement from './terminalManagement/models';
|
||||
export * as management from './management/models';
|
||||
export * as legalEntityManagement from './legalEntityManagement/models';
|
||||
export * as transfer from './transfer/models';
|
||||
export * as dataProtection from './dataProtection/models';
|
||||
|
||||
64
yarn.lock
64
yarn.lock
@@ -895,14 +895,14 @@
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/parser@5.43.0":
|
||||
version "5.43.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.43.0.tgz#9c86581234b88f2ba406f0b99a274a91c11630fd"
|
||||
integrity sha512-2iHUK2Lh7PwNUlhFxxLI2haSDNyXvebBO9izhjhMoDC+S3XI9qt2DGFUsiJ89m2k7gGYch2aEpYqV5F/+nwZug==
|
||||
"@typescript-eslint/parser@5.45.0":
|
||||
version "5.45.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.45.0.tgz#b18a5f6b3cf1c2b3e399e9d2df4be40d6b0ddd0e"
|
||||
integrity sha512-brvs/WSM4fKUmF5Ot/gEve6qYiCMjm6w4HkHPfS6ZNmxTS0m0iNN4yOChImaCkqc1hRwFGqUyanMXuGal6oyyQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager" "5.43.0"
|
||||
"@typescript-eslint/types" "5.43.0"
|
||||
"@typescript-eslint/typescript-estree" "5.43.0"
|
||||
"@typescript-eslint/scope-manager" "5.45.0"
|
||||
"@typescript-eslint/types" "5.45.0"
|
||||
"@typescript-eslint/typescript-estree" "5.45.0"
|
||||
debug "^4.3.4"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.43.0":
|
||||
@@ -913,6 +913,14 @@
|
||||
"@typescript-eslint/types" "5.43.0"
|
||||
"@typescript-eslint/visitor-keys" "5.43.0"
|
||||
|
||||
"@typescript-eslint/scope-manager@5.45.0":
|
||||
version "5.45.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.45.0.tgz#7a4ac1bfa9544bff3f620ab85947945938319a96"
|
||||
integrity sha512-noDMjr87Arp/PuVrtvN3dXiJstQR1+XlQ4R1EvzG+NMgXi8CuMCXpb8JqNtFHKceVSQ985BZhfRdowJzbv4yKw==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.45.0"
|
||||
"@typescript-eslint/visitor-keys" "5.45.0"
|
||||
|
||||
"@typescript-eslint/type-utils@5.43.0":
|
||||
version "5.43.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.43.0.tgz#91110fb827df5161209ecca06f70d19a96030be6"
|
||||
@@ -928,6 +936,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.43.0.tgz#e4ddd7846fcbc074325293515fa98e844d8d2578"
|
||||
integrity sha512-jpsbcD0x6AUvV7tyOlyvon0aUsQpF8W+7TpJntfCUWU1qaIKu2K34pMwQKSzQH8ORgUrGYY6pVIh1Pi8TNeteg==
|
||||
|
||||
"@typescript-eslint/types@5.45.0":
|
||||
version "5.45.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.45.0.tgz#794760b9037ee4154c09549ef5a96599621109c5"
|
||||
integrity sha512-QQij+u/vgskA66azc9dCmx+rev79PzX8uDHpsqSjEFtfF2gBUTRCpvYMh2gw2ghkJabNkPlSUCimsyBEQZd1DA==
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.43.0":
|
||||
version "5.43.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.43.0.tgz#b6883e58ba236a602c334be116bfc00b58b3b9f2"
|
||||
@@ -941,6 +954,19 @@
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/typescript-estree@5.45.0":
|
||||
version "5.45.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.0.tgz#f70a0d646d7f38c0dfd6936a5e171a77f1e5291d"
|
||||
integrity sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.45.0"
|
||||
"@typescript-eslint/visitor-keys" "5.45.0"
|
||||
debug "^4.3.4"
|
||||
globby "^11.1.0"
|
||||
is-glob "^4.0.3"
|
||||
semver "^7.3.7"
|
||||
tsutils "^3.21.0"
|
||||
|
||||
"@typescript-eslint/utils@5.43.0":
|
||||
version "5.43.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.43.0.tgz#00fdeea07811dbdf68774a6f6eacfee17fcc669f"
|
||||
@@ -963,6 +989,14 @@
|
||||
"@typescript-eslint/types" "5.43.0"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
"@typescript-eslint/visitor-keys@5.45.0":
|
||||
version "5.45.0"
|
||||
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.0.tgz#e0d160e9e7fdb7f8da697a5b78e7a14a22a70528"
|
||||
integrity sha512-jc6Eccbn2RtQPr1s7th6jJWQHBHI6GBVQkCHoJFQ5UreaKm59Vxw+ynQUPPY2u2Amquc+7tmEoC2G52ApsGNNg==
|
||||
dependencies:
|
||||
"@typescript-eslint/types" "5.45.0"
|
||||
eslint-visitor-keys "^3.3.0"
|
||||
|
||||
abab@^2.0.3, abab@^2.0.5:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291"
|
||||
@@ -1991,10 +2025,10 @@ eslint-visitor-keys@^3.3.0:
|
||||
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826"
|
||||
integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==
|
||||
|
||||
eslint@8.27.0:
|
||||
version "8.27.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.27.0.tgz#d547e2f7239994ad1faa4bb5d84e5d809db7cf64"
|
||||
integrity sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ==
|
||||
eslint@8.28.0:
|
||||
version "8.28.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.28.0.tgz#81a680732634677cc890134bcdd9fdfea8e63d6e"
|
||||
integrity sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==
|
||||
dependencies:
|
||||
"@eslint/eslintrc" "^1.3.3"
|
||||
"@humanwhocodes/config-array" "^0.11.6"
|
||||
@@ -5130,10 +5164,10 @@ typedarray-to-buffer@^3.1.5:
|
||||
dependencies:
|
||||
is-typedarray "^1.0.0"
|
||||
|
||||
typescript@4.8.4:
|
||||
version "4.8.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
|
||||
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
|
||||
typescript@4.9.3:
|
||||
version "4.9.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db"
|
||||
integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==
|
||||
|
||||
unbox-primitive@^1.0.2:
|
||||
version "1.0.2"
|
||||
|
||||
Reference in New Issue
Block a user