Skip to content

Commit 4200591

Browse files
committed
Generate ManagementWebhooks
1 parent 6f63e99 commit 4200591

29 files changed

+1099
-488
lines changed

src/notification/managementWebhookHandler.ts

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,32 @@
66
*/
77
import {managementWebhooks} from "../typings";
88

9+
/**
10+
* DEPRECATED
11+
*
12+
* Centralised handler for de-serialising all (Management) webhook payloads.
13+
*
14+
* @deprecated Use instead ManagementWebhooksHandler
15+
*/
916
class ManagementWebhookHandler {
1017
private readonly payload: string;
1118

19+
/**
20+
* Constructor
21+
* @deprecated Use specific webhook handlers instead.
22+
*
23+
* @param jsonPayload
24+
*/
1225
public constructor(jsonPayload: string) {
1326
this.payload = JSON.parse(jsonPayload);
1427
}
1528

16-
// Return generic webhook type
29+
/**
30+
* Return generic webhook type
31+
* @deprecated Use specific webhook handlers instead.
32+
*
33+
* @param jsonPayload
34+
*/
1735
public getGenericWebhook(): managementWebhooks.MerchantUpdatedNotificationRequest
1836
| managementWebhooks.MerchantCreatedNotificationRequest
1937
| managementWebhooks.PaymentMethodCreatedNotificationRequest
@@ -43,22 +61,37 @@ class ManagementWebhookHandler {
4361
throw new Error("Could not parse the json payload: " + this.payload);
4462
}
4563

64+
/**
65+
* @deprecated Use ManagementWebhooksHandler instead.
66+
*/
4667
public getMerchantCreatedNotificationRequest(): managementWebhooks.MerchantCreatedNotificationRequest {
4768
return managementWebhooks.ObjectSerializer.deserialize(this.payload, "MerchantCreatedNotificationRequest");
4869
}
4970

71+
/**
72+
* @deprecated Use ManagementWebhooksHandler instead.
73+
*/
5074
public getMerchantUpdatedNotificationRequest(): managementWebhooks.MerchantUpdatedNotificationRequest {
5175
return managementWebhooks.ObjectSerializer.deserialize(this.payload, "MerchantUpdatedNotificationRequest");
5276
}
5377

78+
/**
79+
* @deprecated Use ManagementWebhooksHandler instead.
80+
*/
5481
public getPaymentMethodCreatedNotificationRequest(): managementWebhooks.PaymentMethodCreatedNotificationRequest {
5582
return managementWebhooks.ObjectSerializer.deserialize(this.payload, "PaymentMethodCreatedNotificationRequest");
5683
}
5784

85+
/**
86+
* @deprecated Use ManagementWebhooksHandler instead.
87+
*/
5888
public getPaymentMethodRequestRemovedNotificationRequest(): managementWebhooks.PaymentMethodRequestRemovedNotificationRequest {
5989
return managementWebhooks.ObjectSerializer.deserialize(this.payload, "PaymentMethodRequestRemovedNotificationRequest");
6090
}
6191

92+
/**
93+
* @deprecated Use ManagementWebhooksHandler instead.
94+
*/
6295
public getPaymentMethodScheduledForRemovalNotificationRequest(): managementWebhooks.PaymentMethodScheduledForRemovalNotificationRequest {
6396
return managementWebhooks.ObjectSerializer.deserialize(this.payload, "PaymentMethodScheduledForRemovalNotificationRequest");
6497
}

src/typings/managementWebhooks/accountCapabilityData.ts

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,88 +7,102 @@
77
* Do not edit this class manually.
88
*/
99

10-
import { CapabilityProblem } from './capabilityProblem';
10+
import { CapabilityProblem } from "./capabilityProblem";
11+
1112

1213
export class AccountCapabilityData {
1314
/**
1415
* Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful.
1516
*/
16-
'allowed'?: boolean;
17+
"allowed"?: boolean;
1718
/**
1819
* The allowed level of the capability. Some capabilities have different levels which correspond to thresholds. Higher levels may require additional checks and increased monitoring.Possible values: **notApplicable**, **low**, **medium**, **high**.
1920
*/
20-
'allowedLevel'?: string;
21+
"allowedLevel"?: string;
2122
/**
2223
* The name of the capability. For example, **sendToTransferInstrument**.
2324
*/
24-
'capability'?: string;
25+
"capability"?: string;
2526
/**
2627
* List of entities that has problems with verification. The information includes the details of the errors and the actions that you can take to resolve them.
2728
*/
28-
'problems'?: Array<CapabilityProblem>;
29+
"problems"?: Array<CapabilityProblem>;
2930
/**
3031
* Indicates whether you requested the capability.
3132
*/
32-
'requested': boolean;
33+
"requested": boolean;
3334
/**
3435
* The level that you requested for the capability. Some capabilities have different levels which correspond to thresholds. Higher levels may require additional checks and increased monitoring.Possible values: **notApplicable**, **low**, **medium**, **high**.
3536
*/
36-
'requestedLevel': string;
37+
"requestedLevel": string;
3738
/**
3839
* The verification deadline for the capability that will be disallowed if verification errors are not resolved.
3940
*/
40-
'verificationDeadline'?: Date;
41+
"verificationDeadline"?: Date;
4142
/**
4243
* The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification was successful. * **rejected**: Adyen checked the information and found reasons to not allow the capability.
4344
*/
44-
'verificationStatus'?: string;
45+
"verificationStatus"?: string;
46+
47+
static readonly discriminator: string | undefined = undefined;
4548

46-
static discriminator: string | undefined = undefined;
49+
static readonly mapping: {[index: string]: string} | undefined = undefined;
4750

48-
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
51+
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
4952
{
5053
"name": "allowed",
5154
"baseName": "allowed",
52-
"type": "boolean"
55+
"type": "boolean",
56+
"format": ""
5357
},
5458
{
5559
"name": "allowedLevel",
5660
"baseName": "allowedLevel",
57-
"type": "string"
61+
"type": "string",
62+
"format": ""
5863
},
5964
{
6065
"name": "capability",
6166
"baseName": "capability",
62-
"type": "string"
67+
"type": "string",
68+
"format": ""
6369
},
6470
{
6571
"name": "problems",
6672
"baseName": "problems",
67-
"type": "Array<CapabilityProblem>"
73+
"type": "Array<CapabilityProblem>",
74+
"format": ""
6875
},
6976
{
7077
"name": "requested",
7178
"baseName": "requested",
72-
"type": "boolean"
79+
"type": "boolean",
80+
"format": ""
7381
},
7482
{
7583
"name": "requestedLevel",
7684
"baseName": "requestedLevel",
77-
"type": "string"
85+
"type": "string",
86+
"format": ""
7887
},
7988
{
8089
"name": "verificationDeadline",
8190
"baseName": "verificationDeadline",
82-
"type": "Date"
91+
"type": "Date",
92+
"format": "date-time"
8393
},
8494
{
8595
"name": "verificationStatus",
8696
"baseName": "verificationStatus",
87-
"type": "string"
97+
"type": "string",
98+
"format": ""
8899
} ];
89100

90101
static getAttributeTypeMap() {
91102
return AccountCapabilityData.attributeTypeMap;
92103
}
104+
105+
public constructor() {
106+
}
93107
}
94108

src/typings/managementWebhooks/accountCreateNotificationData.ts

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,72 @@
77
* Do not edit this class manually.
88
*/
99

10-
import { AccountCapabilityData } from './accountCapabilityData';
10+
import { AccountCapabilityData } from "./accountCapabilityData";
11+
1112

1213
export class AccountCreateNotificationData {
1314
/**
1415
* Key-value pairs that specify the actions that the merchant account can do and its settings. The key is a capability. For example, the **sendToTransferInstrument** is the capability required before you can pay out funds to the bank account. The value is an object containing the settings for the capability.
1516
*/
16-
'capabilities': { [key: string]: AccountCapabilityData; };
17+
"capabilities": { [key: string]: AccountCapabilityData; };
1718
/**
1819
* The unique identifier of the company account.
1920
*/
20-
'companyId': string;
21+
"companyId": string;
2122
/**
2223
* The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id).
2324
*/
24-
'legalEntityId'?: string;
25+
"legalEntityId"?: string;
2526
/**
2627
* The unique identifier of the merchant account.
2728
*/
28-
'merchantId': string;
29+
"merchantId": string;
2930
/**
3031
* The status of the merchant account. Possible values: * **PreActive**: The merchant account has been created. Users cannot access the merchant account in the Customer Area. The account cannot process payments. * **Active**: Users can access the merchant account in the Customer Area. If the company account is also **Active**, then payment processing and payouts are enabled. * **InactiveWithModifications**: Users can access the merchant account in the Customer Area. The account cannot process new payments but can still modify payments, for example issue refunds. The account can still receive payouts. * **Inactive**: Users can access the merchant account in the Customer Area. Payment processing and payouts are disabled. * **Closed**: The account is closed and this cannot be reversed. Users cannot log in. Payment processing and payouts are disabled.
3132
*/
32-
'status': string;
33+
"status": string;
34+
35+
static readonly discriminator: string | undefined = undefined;
3336

34-
static discriminator: string | undefined = undefined;
37+
static readonly mapping: {[index: string]: string} | undefined = undefined;
3538

36-
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
39+
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
3740
{
3841
"name": "capabilities",
3942
"baseName": "capabilities",
40-
"type": "{ [key: string]: AccountCapabilityData; }"
43+
"type": "{ [key: string]: AccountCapabilityData; }",
44+
"format": ""
4145
},
4246
{
4347
"name": "companyId",
4448
"baseName": "companyId",
45-
"type": "string"
49+
"type": "string",
50+
"format": ""
4651
},
4752
{
4853
"name": "legalEntityId",
4954
"baseName": "legalEntityId",
50-
"type": "string"
55+
"type": "string",
56+
"format": ""
5157
},
5258
{
5359
"name": "merchantId",
5460
"baseName": "merchantId",
55-
"type": "string"
61+
"type": "string",
62+
"format": ""
5663
},
5764
{
5865
"name": "status",
5966
"baseName": "status",
60-
"type": "string"
67+
"type": "string",
68+
"format": ""
6169
} ];
6270

6371
static getAttributeTypeMap() {
6472
return AccountCreateNotificationData.attributeTypeMap;
6573
}
74+
75+
public constructor() {
76+
}
6677
}
6778

src/typings/managementWebhooks/accountNotificationResponse.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,25 @@ export class AccountNotificationResponse {
1212
/**
1313
* Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications).
1414
*/
15-
'notificationResponse'?: string;
15+
"notificationResponse"?: string;
1616

17-
static discriminator: string | undefined = undefined;
17+
static readonly discriminator: string | undefined = undefined;
1818

19-
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
19+
static readonly mapping: {[index: string]: string} | undefined = undefined;
20+
21+
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
2022
{
2123
"name": "notificationResponse",
2224
"baseName": "notificationResponse",
23-
"type": "string"
25+
"type": "string",
26+
"format": ""
2427
} ];
2528

2629
static getAttributeTypeMap() {
2730
return AccountNotificationResponse.attributeTypeMap;
2831
}
32+
33+
public constructor() {
34+
}
2935
}
3036

src/typings/managementWebhooks/accountUpdateNotificationData.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,62 @@
77
* Do not edit this class manually.
88
*/
99

10-
import { AccountCapabilityData } from './accountCapabilityData';
10+
import { AccountCapabilityData } from "./accountCapabilityData";
11+
1112

1213
export class AccountUpdateNotificationData {
1314
/**
1415
* Key-value pairs that specify what you can do with the merchant account and its settings. The key is a capability. For example, the **sendToTransferInstrument** is the capability required before you can pay out the funds of a merchant account to a [bank account](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). The value is an object containing the settings for the capability.
1516
*/
16-
'capabilities': { [key: string]: AccountCapabilityData; };
17+
"capabilities": { [key: string]: AccountCapabilityData; };
1718
/**
1819
* The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/legalentity/latest/post/legalEntities#responses-200-id).
1920
*/
20-
'legalEntityId'?: string;
21+
"legalEntityId"?: string;
2122
/**
2223
* The unique identifier of the merchant account.
2324
*/
24-
'merchantId': string;
25+
"merchantId": string;
2526
/**
2627
* The status of the merchant account. Possible values: * **PreActive**: The merchant account has been created. Users cannot access the merchant account in the Customer Area. The account cannot process payments. * **Active**: Users can access the merchant account in the Customer Area. If the company account is also **Active**, then payment processing and payouts are enabled. * **InactiveWithModifications**: Users can access the merchant account in the Customer Area. The account cannot process new payments but can still modify payments, for example issue refunds. The account can still receive payouts. * **Inactive**: Users can access the merchant account in the Customer Area. Payment processing and payouts are disabled. * **Closed**: The account is closed and this cannot be reversed. Users cannot log in. Payment processing and payouts are disabled.
2728
*/
28-
'status': string;
29+
"status": string;
30+
31+
static readonly discriminator: string | undefined = undefined;
2932

30-
static discriminator: string | undefined = undefined;
33+
static readonly mapping: {[index: string]: string} | undefined = undefined;
3134

32-
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
35+
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
3336
{
3437
"name": "capabilities",
3538
"baseName": "capabilities",
36-
"type": "{ [key: string]: AccountCapabilityData; }"
39+
"type": "{ [key: string]: AccountCapabilityData; }",
40+
"format": ""
3741
},
3842
{
3943
"name": "legalEntityId",
4044
"baseName": "legalEntityId",
41-
"type": "string"
45+
"type": "string",
46+
"format": ""
4247
},
4348
{
4449
"name": "merchantId",
4550
"baseName": "merchantId",
46-
"type": "string"
51+
"type": "string",
52+
"format": ""
4753
},
4854
{
4955
"name": "status",
5056
"baseName": "status",
51-
"type": "string"
57+
"type": "string",
58+
"format": ""
5259
} ];
5360

5461
static getAttributeTypeMap() {
5562
return AccountUpdateNotificationData.attributeTypeMap;
5663
}
64+
65+
public constructor() {
66+
}
5767
}
5868

0 commit comments

Comments
 (0)