|
7 | 7 |
|
8 | 8 | import {configurationWebhooks, acsWebhooks, reportWebhooks, transferWebhooks, transactionWebhooks, negativeBalanceWarningWebhooks, balanceWebhooks} from "../typings";
|
9 | 9 |
|
| 10 | +/** |
| 11 | + * DEPRECATED |
| 12 | + * |
| 13 | + * Centralised handler for de-serialising all (Banking) webhook payloads. |
| 14 | + * |
| 15 | + * @deprecated Each webhook provides its own handler, for example use AcsWebhooksHandler to process AcsWebhooks events |
| 16 | + * Use the specific WebhookHandler implementation: AcsWebhooksHandler, ReportWebhooksHandler, ConfigurationWebhooksHandler, |
| 17 | + * TransferWebhooksHandler, TransactionWebhooksHandler, etc.. |
| 18 | + */ |
10 | 19 | class BankingWebhookHandler {
|
11 | 20 | private readonly payload: string;
|
12 | 21 |
|
| 22 | + /** |
| 23 | + * Constructor |
| 24 | + * @deprecated Use specific webhook handlers instead. |
| 25 | + * |
| 26 | + * @param jsonPayload |
| 27 | + */ |
13 | 28 | public constructor(jsonPayload: string) {
|
14 | 29 | this.payload = JSON.parse(jsonPayload);
|
15 | 30 | }
|
16 | 31 |
|
17 |
| - // Return generic webhook type |
| 32 | + /** |
| 33 | + * Return generic webhook type |
| 34 | + * @deprecated Use specific webhook handlers instead. |
| 35 | + * |
| 36 | + * @param jsonPayload |
| 37 | + */ |
18 | 38 | public getGenericWebhook(): acsWebhooks.AuthenticationNotificationRequest
|
19 | 39 | | acsWebhooks.RelayedAuthenticationRequest
|
20 | 40 | | balanceWebhooks.BalanceAccountBalanceNotificationRequest
|
@@ -82,50 +102,86 @@ class BankingWebhookHandler {
|
82 | 102 | throw new Error("Could not parse the json payload: " + this.payload);
|
83 | 103 | }
|
84 | 104 |
|
| 105 | + /** |
| 106 | + * @deprecated Use AcsWebhooksHandler instead. |
| 107 | + */ |
85 | 108 | public getAuthenticationNotificationRequest(): acsWebhooks.AuthenticationNotificationRequest {
|
86 | 109 | return acsWebhooks.ObjectSerializer.deserialize(this.payload, "AuthenticationNotificationRequest");
|
87 | 110 | }
|
88 | 111 |
|
| 112 | + /** |
| 113 | + * @deprecated Use AcsWebhooksHandler instead. |
| 114 | + */ |
89 | 115 | public getRelayedAuthenticationRequest(): acsWebhooks.RelayedAuthenticationRequest {
|
90 | 116 | return acsWebhooks.ObjectSerializer.deserialize(this.payload, "RelayedAuthenticationRequest");
|
91 | 117 | }
|
92 | 118 |
|
| 119 | + /** |
| 120 | + * @deprecated Use BalanceWebhooksHandler instead. |
| 121 | + */ |
93 | 122 | public getBalanceAccountBalanceNotificationRequest(): balanceWebhooks.BalanceAccountBalanceNotificationRequest {
|
94 | 123 | return balanceWebhooks.ObjectSerializer.deserialize(this.payload, "BalanceAccountBalanceNotificationRequest");
|
95 | 124 | }
|
96 | 125 |
|
| 126 | + /** |
| 127 | + * @deprecated Use ConfigurationWebhooksHandler instead. |
| 128 | + */ |
97 | 129 | public getAccountHolderNotificationRequest(): configurationWebhooks.AccountHolderNotificationRequest {
|
98 | 130 | return configurationWebhooks.ObjectSerializer.deserialize(this.payload, "AccountHolderNotificationRequest");
|
99 | 131 | }
|
100 | 132 |
|
| 133 | + /** |
| 134 | + * @deprecated Use ConfigurationWebhooksHandler instead. |
| 135 | + */ |
101 | 136 | public getCardOrderNotificationRequest(): configurationWebhooks.CardOrderNotificationRequest {
|
102 | 137 | return configurationWebhooks.ObjectSerializer.deserialize(this.payload, "CardOrderNotificationRequest");
|
103 | 138 | }
|
104 | 139 |
|
| 140 | + /** |
| 141 | + * @deprecated Use ConfigurationWebhooksHandler instead. |
| 142 | + */ |
105 | 143 | public getPaymentNotificationRequest(): configurationWebhooks.PaymentNotificationRequest {
|
106 | 144 | return configurationWebhooks.ObjectSerializer.deserialize(this.payload, "PaymentNotificationRequest");
|
107 | 145 | }
|
108 | 146 |
|
| 147 | + /** |
| 148 | + * @deprecated Use ConfigurationWebhooksHandler instead. |
| 149 | + */ |
109 | 150 | public getSweepConfigurationNotificationRequest(): configurationWebhooks.SweepConfigurationNotificationRequest {
|
110 | 151 | return configurationWebhooks.ObjectSerializer.deserialize(this.payload, "SweepConfigurationNotificationRequest");
|
111 | 152 | }
|
112 | 153 |
|
| 154 | + /** |
| 155 | + * @deprecated Use NegativeBalanceWarningWebhooksHandler instead. |
| 156 | + */ |
113 | 157 | public getNegativeBalanceCompensationWarningNotificationRequest(): negativeBalanceWarningWebhooks.NegativeBalanceCompensationWarningNotificationRequest {
|
114 | 158 | return negativeBalanceWarningWebhooks.ObjectSerializer.deserialize(this.payload, "NegativeBalanceCompensationWarningNotificationRequest");
|
115 | 159 | }
|
116 | 160 |
|
| 161 | + /** |
| 162 | + * @deprecated Use ReportWebhooksHandler instead. |
| 163 | + */ |
117 | 164 | public getReportNotificationRequest(): reportWebhooks.ReportNotificationRequest {
|
118 | 165 | return reportWebhooks.ObjectSerializer.deserialize(this.payload, "ReportNotificationRequest");
|
119 | 166 | }
|
120 | 167 |
|
| 168 | + /** |
| 169 | + * @deprecated Use TransferWebhooksHandler instead. |
| 170 | + */ |
121 | 171 | public getTransferNotificationRequest(): transferWebhooks.TransferNotificationRequest {
|
122 | 172 | return transferWebhooks.ObjectSerializer.deserialize(this.payload, "TransferNotificationRequest");
|
123 | 173 | }
|
124 | 174 |
|
| 175 | + /** |
| 176 | + * @deprecated Use TransactionWebhooksHandler instead. |
| 177 | + */ |
125 | 178 | public getTransactionNotificationRequest(): transactionWebhooks.TransactionNotificationRequestV4 {
|
126 | 179 | return transactionWebhooks.ObjectSerializer.deserialize(this.payload, "TransactionNotificationRequestV4");
|
127 | 180 | }
|
128 | 181 |
|
| 182 | + /** |
| 183 | + * @deprecated Use BalanceWebhooksHandler instead. |
| 184 | + */ |
129 | 185 | public BalanceAccountBalanceNotificationRequest(): balanceWebhooks.BalanceAccountBalanceNotificationRequest {
|
130 | 186 | return balanceWebhooks.ObjectSerializer.deserialize(this.payload, "BalanceAccountBalanceNotificationRequest");
|
131 | 187 | }
|
|
0 commit comments