Line data Source code
1 : /*
2 : This file is part of GNU Taler
3 : Copyright (C) 2012-2020 Taler Systems SA
4 :
5 : GNU Taler is free software: you can redistribute it and/or modify it
6 : under the terms of the GNU Lesser General Public License as published
7 : by the Free Software Foundation, either version 3 of the License,
8 : or (at your option) any later version.
9 :
10 : GNU Taler is distributed in the hope that it will be useful, but
11 : WITHOUT ANY WARRANTY; without even the implied warranty of
12 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 : Lesser General Public License for more details.
14 :
15 : You should have received a copy of the GNU Lesser General Public License
16 : along with this program. If not, see <http://www.gnu.org/licenses/>.
17 :
18 : SPDX-License-Identifier: LGPL3.0-or-later
19 :
20 : Note: the LGPL does not apply to all components of GNU Taler,
21 : but it does apply to this file.
22 : */
23 : #include "taler_error_codes.h"
24 : #include <stddef.h>
25 : #include <microhttpd.h>
26 : #include <gettext.h>
27 :
28 : /**
29 : * MHD does not define our value for 0 (client-side generated code).
30 : */
31 : #define MHD_HTTP_UNINITIALIZED 0
32 :
33 : /**
34 : * A pair containing an error code and its hint.
35 : */
36 : struct ErrorCodeAndHint
37 : {
38 : /**
39 : * The error code.
40 : */
41 : enum TALER_ErrorCode ec;
42 :
43 : /**
44 : * The hint.
45 : */
46 : const char *hint;
47 :
48 : /**
49 : * The HTTP status code.
50 : */
51 : unsigned int http_code;
52 : };
53 :
54 :
55 : /**
56 : * The list of all error codes with their hints.
57 : */
58 : static const struct ErrorCodeAndHint code_hint_pairs[] = {
59 :
60 : {
61 : .ec = TALER_EC_NONE,
62 : .hint = gettext_noop ("Special code to indicate success (no error)."),
63 : .http_code = MHD_HTTP_UNINITIALIZED
64 : },
65 :
66 : {
67 : .ec = TALER_EC_INVALID,
68 : .hint = gettext_noop ("A non-integer error code was returned in the JSON response."),
69 : .http_code = MHD_HTTP_UNINITIALIZED
70 : },
71 :
72 : {
73 : .ec = TALER_EC_GENERIC_CLIENT_INTERNAL_ERROR,
74 : .hint = gettext_noop ("An internal failure happened on the client side."),
75 : .http_code = MHD_HTTP_UNINITIALIZED
76 : },
77 :
78 : {
79 : .ec = TALER_EC_GENERIC_INVALID_RESPONSE,
80 : .hint = gettext_noop ("The response we got from the server was not even in JSON format."),
81 : .http_code = MHD_HTTP_UNINITIALIZED
82 : },
83 :
84 : {
85 : .ec = TALER_EC_GENERIC_TIMEOUT,
86 : .hint = gettext_noop ("An operation timed out."),
87 : .http_code = MHD_HTTP_UNINITIALIZED
88 : },
89 :
90 : {
91 : .ec = TALER_EC_GENERIC_VERSION_MALFORMED,
92 : .hint = gettext_noop ("The version string given does not follow the expected CURRENT:REVISION:AGE Format."),
93 : .http_code = MHD_HTTP_UNINITIALIZED
94 : },
95 :
96 : {
97 : .ec = TALER_EC_GENERIC_REPLY_MALFORMED,
98 : .hint = gettext_noop ("The service responded with a reply that was in JSON but did not satsify the protocol. Note that invalid cryptographic signatures should have signature-specific error codes."),
99 : .http_code = MHD_HTTP_UNINITIALIZED
100 : },
101 :
102 : {
103 : .ec = TALER_EC_GENERIC_CONFIGURATION_INVALID,
104 : .hint = gettext_noop ("There is an error in the client-side configuration, for example the base URL specified is malformed."),
105 : .http_code = MHD_HTTP_UNINITIALIZED
106 : },
107 :
108 : {
109 : .ec = TALER_EC_GENERIC_UNEXPECTED_REQUEST_ERROR,
110 : .hint = gettext_noop ("The client made a request to a service, but received an error response it does not know how to handle."),
111 : .http_code = MHD_HTTP_UNINITIALIZED
112 : },
113 :
114 : {
115 : .ec = TALER_EC_GENERIC_METHOD_INVALID,
116 : .hint = gettext_noop ("The HTTP method used is invalid for this endpoint."),
117 : .http_code = MHD_HTTP_METHOD_NOT_ALLOWED
118 : },
119 :
120 : {
121 : .ec = TALER_EC_GENERIC_ENDPOINT_UNKNOWN,
122 : .hint = gettext_noop ("There is no endpoint defined for the URL provided by the client."),
123 : .http_code = MHD_HTTP_NOT_FOUND
124 : },
125 :
126 : {
127 : .ec = TALER_EC_GENERIC_JSON_INVALID,
128 : .hint = gettext_noop ("The JSON in the client's request was malformed (generic parse error)."),
129 : .http_code = MHD_HTTP_BAD_REQUEST
130 : },
131 :
132 : {
133 : .ec = TALER_EC_GENERIC_HTTP_HEADERS_MALFORMED,
134 : .hint = gettext_noop ("Some of the HTTP headers provided by the client caused the server to not be able to handle the request."),
135 : .http_code = MHD_HTTP_BAD_REQUEST
136 : },
137 :
138 : {
139 : .ec = TALER_EC_GENERIC_PAYTO_URI_MALFORMED,
140 : .hint = gettext_noop ("The payto:// URI provided by the client is malformed."),
141 : .http_code = MHD_HTTP_BAD_REQUEST
142 : },
143 :
144 : {
145 : .ec = TALER_EC_GENERIC_PARAMETER_MISSING,
146 : .hint = gettext_noop ("A required parameter in the request was missing."),
147 : .http_code = MHD_HTTP_BAD_REQUEST
148 : },
149 :
150 : {
151 : .ec = TALER_EC_GENERIC_PARAMETER_MALFORMED,
152 : .hint = gettext_noop ("A parameter in the request was malformed."),
153 : .http_code = MHD_HTTP_BAD_REQUEST
154 : },
155 :
156 : {
157 : .ec = TALER_EC_GENERIC_CURRENCY_MISMATCH,
158 : .hint = gettext_noop ("The currencies involved in the operation do not match."),
159 : .http_code = MHD_HTTP_BAD_REQUEST
160 : },
161 :
162 : {
163 : .ec = TALER_EC_GENERIC_URI_TOO_LONG,
164 : .hint = gettext_noop ("The URI is longer than the longest URI the HTTP server is willing to parse."),
165 : .http_code = MHD_HTTP_URI_TOO_LONG
166 : },
167 :
168 : {
169 : .ec = TALER_EC_GENERIC_UPLOAD_EXCEEDS_LIMIT,
170 : .hint = gettext_noop ("The body is too large to be permissible for the endpoint."),
171 : .http_code = MHD_HTTP_PAYLOAD_TOO_LARGE
172 : },
173 :
174 : {
175 : .ec = TALER_EC_GENERIC_DB_SETUP_FAILED,
176 : .hint = gettext_noop ("The service failed initialize its connection to the database."),
177 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
178 : },
179 :
180 : {
181 : .ec = TALER_EC_GENERIC_DB_START_FAILED,
182 : .hint = gettext_noop ("The service encountered an error event to just start the database transaction."),
183 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
184 : },
185 :
186 : {
187 : .ec = TALER_EC_GENERIC_DB_STORE_FAILED,
188 : .hint = gettext_noop ("The service failed to store information in its database."),
189 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
190 : },
191 :
192 : {
193 : .ec = TALER_EC_GENERIC_DB_FETCH_FAILED,
194 : .hint = gettext_noop ("The service failed to fetch information from its database."),
195 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
196 : },
197 :
198 : {
199 : .ec = TALER_EC_GENERIC_DB_COMMIT_FAILED,
200 : .hint = gettext_noop ("The service encountered an error event to commit the database transaction (hard, unrecoverable error)."),
201 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
202 : },
203 :
204 : {
205 : .ec = TALER_EC_GENERIC_DB_SOFT_FAILURE,
206 : .hint = gettext_noop ("The service encountered an error event to commit the database transaction, even after repeatedly retrying it there was always a conflicting transaction. (This indicates a repeated serialization error; should only happen if some client maliciously tries to create conflicting concurrent transactions.)"),
207 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
208 : },
209 :
210 : {
211 : .ec = TALER_EC_GENERIC_DB_INVARIANT_FAILURE,
212 : .hint = gettext_noop ("The service's database is inconsistent and violates service-internal invariants."),
213 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
214 : },
215 :
216 : {
217 : .ec = TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE,
218 : .hint = gettext_noop ("The HTTP server experienced an internal invariant failure (bug)."),
219 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
220 : },
221 :
222 : {
223 : .ec = TALER_EC_GENERIC_FAILED_COMPUTE_JSON_HASH,
224 : .hint = gettext_noop ("The service could not compute a cryptographic hash over some JSON value."),
225 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
226 : },
227 :
228 : {
229 : .ec = TALER_EC_GENERIC_FAILED_COMPUTE_AMOUNT,
230 : .hint = gettext_noop ("The service could not compute an amount."),
231 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
232 : },
233 :
234 : {
235 : .ec = TALER_EC_GENERIC_PARSER_OUT_OF_MEMORY,
236 : .hint = gettext_noop ("The HTTP server had insufficient memory to parse the request."),
237 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
238 : },
239 :
240 : {
241 : .ec = TALER_EC_GENERIC_ALLOCATION_FAILURE,
242 : .hint = gettext_noop ("The HTTP server failed to allocate memory."),
243 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
244 : },
245 :
246 : {
247 : .ec = TALER_EC_GENERIC_JSON_ALLOCATION_FAILURE,
248 : .hint = gettext_noop ("The HTTP server failed to allocate memory for building JSON reply."),
249 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
250 : },
251 :
252 : {
253 : .ec = TALER_EC_GENERIC_CURL_ALLOCATION_FAILURE,
254 : .hint = gettext_noop ("The HTTP server failed to allocate memory for making a CURL request."),
255 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
256 : },
257 :
258 : {
259 : .ec = TALER_EC_GENERIC_FAILED_TO_LOAD_TEMPLATE,
260 : .hint = gettext_noop ("The backend could not locate a required template to generate an HTML reply."),
261 : .http_code = MHD_HTTP_NOT_ACCEPTABLE
262 : },
263 :
264 : {
265 : .ec = TALER_EC_GENERIC_FAILED_TO_EXPAND_TEMPLATE,
266 : .hint = gettext_noop ("The backend could not expand the template to generate an HTML reply."),
267 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
268 : },
269 :
270 : {
271 : .ec = TALER_EC_EXCHANGE_GENERIC_BAD_CONFIGURATION,
272 : .hint = gettext_noop ("Exchange is badly configured and thus cannot operate."),
273 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
274 : },
275 :
276 : {
277 : .ec = TALER_EC_EXCHANGE_GENERIC_OPERATION_UNKNOWN,
278 : .hint = gettext_noop ("Operation specified unknown for this endpoint."),
279 : .http_code = MHD_HTTP_NOT_FOUND
280 : },
281 :
282 : {
283 : .ec = TALER_EC_EXCHANGE_GENERIC_WRONG_NUMBER_OF_SEGMENTS,
284 : .hint = gettext_noop ("The number of segments included in the URI does not match the number of segments expected by the endpoint."),
285 : .http_code = MHD_HTTP_NOT_FOUND
286 : },
287 :
288 : {
289 : .ec = TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY,
290 : .hint = gettext_noop ("The same coin was already used with a different denomination previously."),
291 : .http_code = MHD_HTTP_CONFLICT
292 : },
293 :
294 : {
295 : .ec = TALER_EC_EXCHANGE_GENERIC_COINS_INVALID_COIN_PUB,
296 : .hint = gettext_noop ("The public key of given to a \"/coins/\" endpoint of the exchange was malformed."),
297 : .http_code = MHD_HTTP_BAD_REQUEST
298 : },
299 :
300 : {
301 : .ec = TALER_EC_EXCHANGE_GENERIC_DENOMINATION_KEY_UNKNOWN,
302 : .hint = gettext_noop ("The exchange is not aware of the denomination key the wallet requested for the operation."),
303 : .http_code = MHD_HTTP_NOT_FOUND
304 : },
305 :
306 : {
307 : .ec = TALER_EC_EXCHANGE_DENOMINATION_SIGNATURE_INVALID,
308 : .hint = gettext_noop ("The signature of the denomination key over the coin is not valid."),
309 : .http_code = MHD_HTTP_FORBIDDEN
310 : },
311 :
312 : {
313 : .ec = TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING,
314 : .hint = gettext_noop ("The exchange failed to perform the operation as it could not find the private keys. This is a problem with the exchange setup, not with the client's request."),
315 : .http_code = MHD_HTTP_SERVICE_UNAVAILABLE
316 : },
317 :
318 : {
319 : .ec = TALER_EC_EXCHANGE_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE,
320 : .hint = gettext_noop ("Validity period of the denomination lies in the future."),
321 : .http_code = MHD_HTTP_PRECONDITION_FAILED
322 : },
323 :
324 : {
325 : .ec = TALER_EC_EXCHANGE_GENERIC_DENOMINATION_EXPIRED,
326 : .hint = gettext_noop ("Denomination key of the coin is past its expiration time for the requested operation."),
327 : .http_code = MHD_HTTP_GONE
328 : },
329 :
330 : {
331 : .ec = TALER_EC_EXCHANGE_GENERIC_DENOMINATION_REVOKED,
332 : .hint = gettext_noop ("Denomination key of the coin has been revoked."),
333 : .http_code = MHD_HTTP_GONE
334 : },
335 :
336 : {
337 : .ec = TALER_EC_EXCHANGE_GENERIC_SECMOD_TIMEOUT,
338 : .hint = gettext_noop ("An operation where the exchange interacted with a security module timed out."),
339 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
340 : },
341 :
342 : {
343 : .ec = TALER_EC_EXCHANGE_GENERIC_INSUFFICIENT_FUNDS,
344 : .hint = gettext_noop ("The respective coin did not have sufficient residual value for the operation. The \"history\" in this response provides the \"residual_value\" of the coin, which may be less than its \"original_value\"."),
345 : .http_code = MHD_HTTP_CONFLICT
346 : },
347 :
348 : {
349 : .ec = TALER_EC_EXCHANGE_GENERIC_COIN_HISTORY_COMPUTATION_FAILED,
350 : .hint = gettext_noop ("The exchange had an internal error reconstructing the transaction history of the coin that was being processed."),
351 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
352 : },
353 :
354 : {
355 : .ec = TALER_EC_EXCHANGE_GENERIC_HISTORY_DB_ERROR_INSUFFICIENT_FUNDS,
356 : .hint = gettext_noop ("The exchange failed to obtain the transaction history of the given coin from the database while generating an insufficient funds errors."),
357 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
358 : },
359 :
360 : {
361 : .ec = TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH,
362 : .hint = gettext_noop ("The same coin was already used with a different age hash previously."),
363 : .http_code = MHD_HTTP_CONFLICT
364 : },
365 :
366 : {
367 : .ec = TALER_EC_EXCHANGE_GENERIC_INVALID_DENOMINATION_CIPHER_FOR_OPERATION,
368 : .hint = gettext_noop ("The requested operation is not valid for the cipher used by the selected denomination."),
369 : .http_code = MHD_HTTP_BAD_REQUEST
370 : },
371 :
372 : {
373 : .ec = TALER_EC_EXCHANGE_GENERIC_CIPHER_MISMATCH,
374 : .hint = gettext_noop ("The provided arguments for the operation use inconsistent ciphers."),
375 : .http_code = MHD_HTTP_BAD_REQUEST
376 : },
377 :
378 : {
379 : .ec = TALER_EC_EXCHANGE_GENERIC_NEW_DENOMS_ARRAY_SIZE_EXCESSIVE,
380 : .hint = gettext_noop ("The number of denominations specified in the request exceeds the limit of the exchange."),
381 : .http_code = MHD_HTTP_BAD_REQUEST
382 : },
383 :
384 : {
385 : .ec = TALER_EC_EXCHANGE_GENERIC_RESERVE_PUB_MALFORMED,
386 : .hint = gettext_noop ("The reserve public key was malformed."),
387 : .http_code = MHD_HTTP_BAD_REQUEST
388 : },
389 :
390 : {
391 : .ec = TALER_EC_EXCHANGE_GENERIC_CLOCK_SKEW,
392 : .hint = gettext_noop ("The time at the server is too far off from the time specified in the request. Most likely the client system time is wrong."),
393 : .http_code = MHD_HTTP_BAD_REQUEST
394 : },
395 :
396 : {
397 : .ec = TALER_EC_EXCHANGE_GENERIC_AMOUNT_EXCEEDS_DENOMINATION_VALUE,
398 : .hint = gettext_noop ("The specified amount for the coin is higher than the value of the denomination of the coin."),
399 : .http_code = MHD_HTTP_BAD_REQUEST
400 : },
401 :
402 : {
403 : .ec = TALER_EC_EXCHANGE_GENERIC_GLOBAL_FEES_MISSING,
404 : .hint = gettext_noop ("The exchange was not properly configured with global fees."),
405 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
406 : },
407 :
408 : {
409 : .ec = TALER_EC_EXCHANGE_GENERIC_WIRE_FEES_MISSING,
410 : .hint = gettext_noop ("The exchange was not properly configured with wire fees."),
411 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
412 : },
413 :
414 : {
415 : .ec = TALER_EC_EXCHANGE_GENERIC_PURSE_PUB_MALFORMED,
416 : .hint = gettext_noop ("The purse public key was malformed."),
417 : .http_code = MHD_HTTP_BAD_REQUEST
418 : },
419 :
420 : {
421 : .ec = TALER_EC_EXCHANGE_GENERIC_PURSE_UNKNOWN,
422 : .hint = gettext_noop ("The purse is unknown."),
423 : .http_code = MHD_HTTP_NOT_FOUND
424 : },
425 :
426 : {
427 : .ec = TALER_EC_EXCHANGE_GENERIC_PURSE_EXPIRED,
428 : .hint = gettext_noop ("The purse has expired."),
429 : .http_code = MHD_HTTP_GONE
430 : },
431 :
432 : {
433 : .ec = TALER_EC_EXCHANGE_GENERIC_RESERVE_UNKNOWN,
434 : .hint = gettext_noop ("The exchange has no information about the \"reserve_pub\" that was given."),
435 : .http_code = MHD_HTTP_NOT_FOUND
436 : },
437 :
438 : {
439 : .ec = TALER_EC_EXCHANGE_GENERIC_KYC_REQUIRED,
440 : .hint = gettext_noop ("The exchange is not allowed to proceed with the operation until the client has satisfied a KYC check."),
441 : .http_code = MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS
442 : },
443 :
444 : {
445 : .ec = TALER_EC_EXCHANGE_PURSE_DEPOSIT_COIN_CONFLICTING_ATTEST_VS_AGE_COMMITMENT,
446 : .hint = gettext_noop ("Inconsistency between provided age commitment and attest: either none or both must be provided"),
447 : .http_code = MHD_HTTP_BAD_REQUEST
448 : },
449 :
450 : {
451 : .ec = TALER_EC_EXCHANGE_PURSE_DEPOSIT_COIN_AGE_ATTESTATION_FAILURE,
452 : .hint = gettext_noop ("The provided attestation for the minimum age couldn't be verified by the exchange."),
453 : .http_code = MHD_HTTP_BAD_REQUEST
454 : },
455 :
456 : {
457 : .ec = TALER_EC_EXCHANGE_DEPOSITS_GET_NOT_FOUND,
458 : .hint = gettext_noop ("The exchange did not find information about the specified transaction in the database."),
459 : .http_code = MHD_HTTP_NOT_FOUND
460 : },
461 :
462 : {
463 : .ec = TALER_EC_EXCHANGE_DEPOSITS_GET_INVALID_H_WIRE,
464 : .hint = gettext_noop ("The wire hash of given to a \"/deposits/\" handler was malformed."),
465 : .http_code = MHD_HTTP_BAD_REQUEST
466 : },
467 :
468 : {
469 : .ec = TALER_EC_EXCHANGE_DEPOSITS_GET_INVALID_MERCHANT_PUB,
470 : .hint = gettext_noop ("The merchant key of given to a \"/deposits/\" handler was malformed."),
471 : .http_code = MHD_HTTP_BAD_REQUEST
472 : },
473 :
474 : {
475 : .ec = TALER_EC_EXCHANGE_DEPOSITS_GET_INVALID_H_CONTRACT_TERMS,
476 : .hint = gettext_noop ("The hash of the contract terms given to a \"/deposits/\" handler was malformed."),
477 : .http_code = MHD_HTTP_BAD_REQUEST
478 : },
479 :
480 : {
481 : .ec = TALER_EC_EXCHANGE_DEPOSITS_GET_INVALID_COIN_PUB,
482 : .hint = gettext_noop ("The coin public key of given to a \"/deposits/\" handler was malformed."),
483 : .http_code = MHD_HTTP_BAD_REQUEST
484 : },
485 :
486 : {
487 : .ec = TALER_EC_EXCHANGE_DEPOSITS_GET_INVALID_SIGNATURE_BY_EXCHANGE,
488 : .hint = gettext_noop ("The signature returned by the exchange in a /deposits/ request was malformed."),
489 : .http_code = MHD_HTTP_UNINITIALIZED
490 : },
491 :
492 : {
493 : .ec = TALER_EC_EXCHANGE_DEPOSITS_GET_MERCHANT_SIGNATURE_INVALID,
494 : .hint = gettext_noop ("The signature of the merchant is invalid."),
495 : .http_code = MHD_HTTP_FORBIDDEN
496 : },
497 :
498 : {
499 : .ec = TALER_EC_EXCHANGE_WITHDRAW_INSUFFICIENT_FUNDS,
500 : .hint = gettext_noop ("The given reserve does not have sufficient funds to admit the requested withdraw operation at this time. The response includes the current \"balance\" of the reserve as well as the transaction \"history\" that lead to this balance."),
501 : .http_code = MHD_HTTP_CONFLICT
502 : },
503 :
504 : {
505 : .ec = TALER_EC_EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW,
506 : .hint = gettext_noop ("The amount to withdraw together with the fee exceeds the numeric range for Taler amounts. This is not a client failure, as the coin value and fees come from the exchange's configuration."),
507 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
508 : },
509 :
510 : {
511 : .ec = TALER_EC_EXCHANGE_WITHDRAW_SIGNATURE_FAILED,
512 : .hint = gettext_noop ("The exchange failed to create the signature using the denomination key."),
513 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
514 : },
515 :
516 : {
517 : .ec = TALER_EC_EXCHANGE_WITHDRAW_RESERVE_SIGNATURE_INVALID,
518 : .hint = gettext_noop ("The signature of the reserve is not valid."),
519 : .http_code = MHD_HTTP_FORBIDDEN
520 : },
521 :
522 : {
523 : .ec = TALER_EC_EXCHANGE_WITHDRAW_HISTORY_ERROR_INSUFFICIENT_FUNDS,
524 : .hint = gettext_noop ("When computing the reserve history, we ended up with a negative overall balance, which should be impossible."),
525 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
526 : },
527 :
528 : {
529 : .ec = TALER_EC_EXCHANGE_WITHDRAW_DENOMINATION_KEY_LOST,
530 : .hint = gettext_noop ("Withdraw period of the coin to be withdrawn is in the past."),
531 : .http_code = MHD_HTTP_GONE
532 : },
533 :
534 : {
535 : .ec = TALER_EC_EXCHANGE_WITHDRAW_UNBLIND_FAILURE,
536 : .hint = gettext_noop ("The client failed to unblind the blind signature."),
537 : .http_code = MHD_HTTP_UNINITIALIZED
538 : },
539 :
540 : {
541 : .ec = TALER_EC_EXCHANGE_WITHDRAW_NONCE_REUSE,
542 : .hint = gettext_noop ("The client re-used a withdraw nonce, which is not allowed."),
543 : .http_code = MHD_HTTP_CONFLICT
544 : },
545 :
546 : {
547 : .ec = TALER_EC_EXCHANGE_WITHDRAW_BATCH_IDEMPOTENT_PLANCHET,
548 : .hint = gettext_noop ("The batch withdraw included a planchet that was already withdrawn. This is not allowed."),
549 : .http_code = MHD_HTTP_CONFLICT
550 : },
551 :
552 : {
553 : .ec = TALER_EC_EXCHANGE_DEPOSIT_COIN_SIGNATURE_INVALID,
554 : .hint = gettext_noop ("The signature made by the coin over the deposit permission is not valid."),
555 : .http_code = MHD_HTTP_FORBIDDEN
556 : },
557 :
558 : {
559 : .ec = TALER_EC_EXCHANGE_DEPOSIT_CONFLICTING_CONTRACT,
560 : .hint = gettext_noop ("The same coin was already deposited for the same merchant and contract with other details."),
561 : .http_code = MHD_HTTP_CONFLICT
562 : },
563 :
564 : {
565 : .ec = TALER_EC_EXCHANGE_DEPOSIT_NEGATIVE_VALUE_AFTER_FEE,
566 : .hint = gettext_noop ("The stated value of the coin after the deposit fee is subtracted would be negative."),
567 : .http_code = MHD_HTTP_BAD_REQUEST
568 : },
569 :
570 : {
571 : .ec = TALER_EC_EXCHANGE_DEPOSIT_REFUND_DEADLINE_AFTER_WIRE_DEADLINE,
572 : .hint = gettext_noop ("The stated refund deadline is after the wire deadline."),
573 : .http_code = MHD_HTTP_BAD_REQUEST
574 : },
575 :
576 : {
577 : .ec = TALER_EC_EXCHANGE_DEPOSIT_WIRE_DEADLINE_IS_NEVER,
578 : .hint = gettext_noop ("The stated wire deadline is \"never\", which makes no sense."),
579 : .http_code = MHD_HTTP_BAD_REQUEST
580 : },
581 :
582 : {
583 : .ec = TALER_EC_EXCHANGE_DEPOSIT_INVALID_WIRE_FORMAT_JSON,
584 : .hint = gettext_noop ("The exchange failed to canonicalize and hash the given wire format. For example, the merchant failed to provide the \"salt\" or a valid payto:// URI in the wire details. Note that while the exchange will do some basic sanity checking on the wire details, it cannot warrant that the banking system will ultimately be able to route to the specified address, even if this check passed."),
585 : .http_code = MHD_HTTP_BAD_REQUEST
586 : },
587 :
588 : {
589 : .ec = TALER_EC_EXCHANGE_DEPOSIT_INVALID_WIRE_FORMAT_CONTRACT_HASH_CONFLICT,
590 : .hint = gettext_noop ("The hash of the given wire address does not match the wire hash specified in the proposal data."),
591 : .http_code = MHD_HTTP_BAD_REQUEST
592 : },
593 :
594 : {
595 : .ec = TALER_EC_EXCHANGE_DEPOSIT_INVALID_SIGNATURE_BY_EXCHANGE,
596 : .hint = gettext_noop ("The signature provided by the exchange is not valid."),
597 : .http_code = MHD_HTTP_UNINITIALIZED
598 : },
599 :
600 : {
601 : .ec = TALER_EC_EXCHANGE_DEPOSIT_FEE_ABOVE_AMOUNT,
602 : .hint = gettext_noop ("The deposited amount is smaller than the deposit fee, which would result in a negative contribution."),
603 : .http_code = MHD_HTTP_BAD_REQUEST
604 : },
605 :
606 : {
607 : .ec = TALER_EC_EXCHANGE_RESERVES_STATUS_UNKNOWN,
608 : .hint = gettext_noop ("The reserve balance, status or history was requested for a reserve which is not known to the exchange."),
609 : .http_code = MHD_HTTP_NOT_FOUND
610 : },
611 :
612 : {
613 : .ec = TALER_EC_EXCHANGE_RESERVES_STATUS_BAD_SIGNATURE,
614 : .hint = gettext_noop ("The reserve status was requested with a bad signature."),
615 : .http_code = MHD_HTTP_FORBIDDEN
616 : },
617 :
618 : {
619 : .ec = TALER_EC_EXCHANGE_RESERVES_HISTORY_BAD_SIGNATURE,
620 : .hint = gettext_noop ("The reserve history was requested with a bad signature."),
621 : .http_code = MHD_HTTP_FORBIDDEN
622 : },
623 :
624 : {
625 : .ec = TALER_EC_EXCHANGE_MELT_FEES_EXCEED_CONTRIBUTION,
626 : .hint = gettext_noop ("The exchange encountered melt fees exceeding the melted coin's contribution."),
627 : .http_code = MHD_HTTP_BAD_REQUEST
628 : },
629 :
630 : {
631 : .ec = TALER_EC_EXCHANGE_MELT_COIN_SIGNATURE_INVALID,
632 : .hint = gettext_noop ("The signature made with the coin to be melted is invalid."),
633 : .http_code = MHD_HTTP_FORBIDDEN
634 : },
635 :
636 : {
637 : .ec = TALER_EC_EXCHANGE_MELT_COIN_EXPIRED_NO_ZOMBIE,
638 : .hint = gettext_noop ("The denomination of the given coin has past its expiration date and it is also not a valid zombie (that is, was not refreshed with the fresh coin being subjected to recoup)."),
639 : .http_code = MHD_HTTP_BAD_REQUEST
640 : },
641 :
642 : {
643 : .ec = TALER_EC_EXCHANGE_MELT_INVALID_SIGNATURE_BY_EXCHANGE,
644 : .hint = gettext_noop ("The signature returned by the exchange in a melt request was malformed."),
645 : .http_code = MHD_HTTP_UNINITIALIZED
646 : },
647 :
648 : {
649 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_COMMITMENT_VIOLATION,
650 : .hint = gettext_noop ("The provided transfer keys do not match up with the original commitment. Information about the original commitment is included in the response."),
651 : .http_code = MHD_HTTP_CONFLICT
652 : },
653 :
654 : {
655 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_SIGNING_ERROR,
656 : .hint = gettext_noop ("Failed to produce the blinded signatures over the coins to be returned."),
657 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
658 : },
659 :
660 : {
661 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_SESSION_UNKNOWN,
662 : .hint = gettext_noop ("The exchange is unaware of the refresh session specified in the request."),
663 : .http_code = MHD_HTTP_NOT_FOUND
664 : },
665 :
666 : {
667 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_CNC_TRANSFER_ARRAY_SIZE_INVALID,
668 : .hint = gettext_noop ("The size of the cut-and-choose dimension of the private transfer keys request does not match #TALER_CNC_KAPPA - 1."),
669 : .http_code = MHD_HTTP_BAD_REQUEST
670 : },
671 :
672 : {
673 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_NEW_DENOMS_ARRAY_SIZE_MISMATCH,
674 : .hint = gettext_noop ("The number of envelopes given does not match the number of denomination keys given."),
675 : .http_code = MHD_HTTP_BAD_REQUEST
676 : },
677 :
678 : {
679 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_COST_CALCULATION_OVERFLOW,
680 : .hint = gettext_noop ("The exchange encountered a numeric overflow totaling up the cost for the refresh operation."),
681 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
682 : },
683 :
684 : {
685 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_AMOUNT_INSUFFICIENT,
686 : .hint = gettext_noop ("The exchange's cost calculation shows that the melt amount is below the costs of the transaction."),
687 : .http_code = MHD_HTTP_BAD_REQUEST
688 : },
689 :
690 : {
691 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_LINK_SIGNATURE_INVALID,
692 : .hint = gettext_noop ("The signature made with the coin over the link data is invalid."),
693 : .http_code = MHD_HTTP_FORBIDDEN
694 : },
695 :
696 : {
697 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_INVALID_RCH,
698 : .hint = gettext_noop ("The refresh session hash given to a /refreshes/ handler was malformed."),
699 : .http_code = MHD_HTTP_BAD_REQUEST
700 : },
701 :
702 : {
703 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_OPERATION_INVALID,
704 : .hint = gettext_noop ("Operation specified invalid for this endpoint."),
705 : .http_code = MHD_HTTP_BAD_REQUEST
706 : },
707 :
708 : {
709 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_AGE_RESTRICTION_NOT_SUPPORTED,
710 : .hint = gettext_noop ("The client provided age commitment data, but age restriction is not supported on this server."),
711 : .http_code = MHD_HTTP_BAD_REQUEST
712 : },
713 :
714 : {
715 : .ec = TALER_EC_EXCHANGE_REFRESHES_REVEAL_AGE_RESTRICTION_COMMITMENT_INVALID,
716 : .hint = gettext_noop ("The client provided invalid age commitment data: missing, not an array, or array of invalid size."),
717 : .http_code = MHD_HTTP_BAD_REQUEST
718 : },
719 :
720 : {
721 : .ec = TALER_EC_EXCHANGE_LINK_COIN_UNKNOWN,
722 : .hint = gettext_noop ("The coin specified in the link request is unknown to the exchange."),
723 : .http_code = MHD_HTTP_NOT_FOUND
724 : },
725 :
726 : {
727 : .ec = TALER_EC_EXCHANGE_TRANSFERS_GET_WTID_MALFORMED,
728 : .hint = gettext_noop ("The public key of given to a /transfers/ handler was malformed."),
729 : .http_code = MHD_HTTP_BAD_REQUEST
730 : },
731 :
732 : {
733 : .ec = TALER_EC_EXCHANGE_TRANSFERS_GET_WTID_NOT_FOUND,
734 : .hint = gettext_noop ("The exchange did not find information about the specified wire transfer identifier in the database."),
735 : .http_code = MHD_HTTP_NOT_FOUND
736 : },
737 :
738 : {
739 : .ec = TALER_EC_EXCHANGE_TRANSFERS_GET_WIRE_FEE_NOT_FOUND,
740 : .hint = gettext_noop ("The exchange did not find information about the wire transfer fees it charged."),
741 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
742 : },
743 :
744 : {
745 : .ec = TALER_EC_EXCHANGE_TRANSFERS_GET_WIRE_FEE_INCONSISTENT,
746 : .hint = gettext_noop ("The exchange found a wire fee that was above the total transfer value (and thus could not have been charged)."),
747 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
748 : },
749 :
750 : {
751 : .ec = TALER_EC_EXCHANGE_PURSES_INVALID_WAIT_TARGET,
752 : .hint = gettext_noop ("The wait target of the URL was not in the set of expected values."),
753 : .http_code = MHD_HTTP_BAD_REQUEST
754 : },
755 :
756 : {
757 : .ec = TALER_EC_EXCHANGE_PURSES_GET_INVALID_SIGNATURE_BY_EXCHANGE,
758 : .hint = gettext_noop ("The signature on the purse status returned by the exchange was invalid."),
759 : .http_code = MHD_HTTP_UNINITIALIZED
760 : },
761 :
762 : {
763 : .ec = TALER_EC_EXCHANGE_REFUND_COIN_NOT_FOUND,
764 : .hint = gettext_noop ("The exchange knows literally nothing about the coin we were asked to refund. But without a transaction history, we cannot issue a refund. This is kind-of OK, the owner should just refresh it directly without executing the refund."),
765 : .http_code = MHD_HTTP_NOT_FOUND
766 : },
767 :
768 : {
769 : .ec = TALER_EC_EXCHANGE_REFUND_CONFLICT_DEPOSIT_INSUFFICIENT,
770 : .hint = gettext_noop ("We could not process the refund request as the coin's transaction history does not permit the requested refund because then refunds would exceed the deposit amount. The \"history\" in the response proves this."),
771 : .http_code = MHD_HTTP_CONFLICT
772 : },
773 :
774 : {
775 : .ec = TALER_EC_EXCHANGE_REFUND_DEPOSIT_NOT_FOUND,
776 : .hint = gettext_noop ("The exchange knows about the coin we were asked to refund, but not about the specific /deposit operation. Hence, we cannot issue a refund (as we do not know if this merchant public key is authorized to do a refund)."),
777 : .http_code = MHD_HTTP_NOT_FOUND
778 : },
779 :
780 : {
781 : .ec = TALER_EC_EXCHANGE_REFUND_MERCHANT_ALREADY_PAID,
782 : .hint = gettext_noop ("The exchange can no longer refund the customer/coin as the money was already transferred (paid out) to the merchant. (It should be past the refund deadline.)"),
783 : .http_code = MHD_HTTP_GONE
784 : },
785 :
786 : {
787 : .ec = TALER_EC_EXCHANGE_REFUND_FEE_TOO_LOW,
788 : .hint = gettext_noop ("The refund fee specified for the request is lower than the refund fee charged by the exchange for the given denomination key of the refunded coin."),
789 : .http_code = MHD_HTTP_BAD_REQUEST
790 : },
791 :
792 : {
793 : .ec = TALER_EC_EXCHANGE_REFUND_FEE_ABOVE_AMOUNT,
794 : .hint = gettext_noop ("The refunded amount is smaller than the refund fee, which would result in a negative refund."),
795 : .http_code = MHD_HTTP_BAD_REQUEST
796 : },
797 :
798 : {
799 : .ec = TALER_EC_EXCHANGE_REFUND_MERCHANT_SIGNATURE_INVALID,
800 : .hint = gettext_noop ("The signature of the merchant is invalid."),
801 : .http_code = MHD_HTTP_FORBIDDEN
802 : },
803 :
804 : {
805 : .ec = TALER_EC_EXCHANGE_REFUND_MERCHANT_SIGNING_FAILED,
806 : .hint = gettext_noop ("Merchant backend failed to create the refund confirmation signature."),
807 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
808 : },
809 :
810 : {
811 : .ec = TALER_EC_EXCHANGE_REFUND_INVALID_SIGNATURE_BY_EXCHANGE,
812 : .hint = gettext_noop ("The signature returned by the exchange in a refund request was malformed."),
813 : .http_code = MHD_HTTP_UNINITIALIZED
814 : },
815 :
816 : {
817 : .ec = TALER_EC_EXCHANGE_REFUND_INVALID_FAILURE_PROOF_BY_EXCHANGE,
818 : .hint = gettext_noop ("The failure proof returned by the exchange is incorrect."),
819 : .http_code = MHD_HTTP_UNINITIALIZED
820 : },
821 :
822 : {
823 : .ec = TALER_EC_EXCHANGE_REFUND_INCONSISTENT_AMOUNT,
824 : .hint = gettext_noop ("Conflicting refund granted before with different amount but same refund transaction ID."),
825 : .http_code = MHD_HTTP_FAILED_DEPENDENCY
826 : },
827 :
828 : {
829 : .ec = TALER_EC_EXCHANGE_RECOUP_SIGNATURE_INVALID,
830 : .hint = gettext_noop ("The given coin signature is invalid for the request."),
831 : .http_code = MHD_HTTP_FORBIDDEN
832 : },
833 :
834 : {
835 : .ec = TALER_EC_EXCHANGE_RECOUP_WITHDRAW_NOT_FOUND,
836 : .hint = gettext_noop ("The exchange could not find the corresponding withdraw operation. The request is denied."),
837 : .http_code = MHD_HTTP_NOT_FOUND
838 : },
839 :
840 : {
841 : .ec = TALER_EC_EXCHANGE_RECOUP_COIN_BALANCE_ZERO,
842 : .hint = gettext_noop ("The coin's remaining balance is zero. The request is denied."),
843 : .http_code = MHD_HTTP_FORBIDDEN
844 : },
845 :
846 : {
847 : .ec = TALER_EC_EXCHANGE_RECOUP_BLINDING_FAILED,
848 : .hint = gettext_noop ("The exchange failed to reproduce the coin's blinding."),
849 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
850 : },
851 :
852 : {
853 : .ec = TALER_EC_EXCHANGE_RECOUP_COIN_BALANCE_NEGATIVE,
854 : .hint = gettext_noop ("The coin's remaining balance is zero. The request is denied."),
855 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
856 : },
857 :
858 : {
859 : .ec = TALER_EC_EXCHANGE_RECOUP_NOT_ELIGIBLE,
860 : .hint = gettext_noop ("The coin's denomination has not been revoked yet."),
861 : .http_code = MHD_HTTP_NOT_FOUND
862 : },
863 :
864 : {
865 : .ec = TALER_EC_EXCHANGE_RECOUP_REFRESH_SIGNATURE_INVALID,
866 : .hint = gettext_noop ("The given coin signature is invalid for the request."),
867 : .http_code = MHD_HTTP_FORBIDDEN
868 : },
869 :
870 : {
871 : .ec = TALER_EC_EXCHANGE_RECOUP_REFRESH_MELT_NOT_FOUND,
872 : .hint = gettext_noop ("The exchange could not find the corresponding melt operation. The request is denied."),
873 : .http_code = MHD_HTTP_NOT_FOUND
874 : },
875 :
876 : {
877 : .ec = TALER_EC_EXCHANGE_RECOUP_REFRESH_BLINDING_FAILED,
878 : .hint = gettext_noop ("The exchange failed to reproduce the coin's blinding."),
879 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
880 : },
881 :
882 : {
883 : .ec = TALER_EC_EXCHANGE_RECOUP_REFRESH_NOT_ELIGIBLE,
884 : .hint = gettext_noop ("The coin's denomination has not been revoked yet."),
885 : .http_code = MHD_HTTP_NOT_FOUND
886 : },
887 :
888 : {
889 : .ec = TALER_EC_EXCHANGE_KEYS_TIMETRAVEL_FORBIDDEN,
890 : .hint = gettext_noop ("This exchange does not allow clients to request /keys for times other than the current (exchange) time."),
891 : .http_code = MHD_HTTP_FORBIDDEN
892 : },
893 :
894 : {
895 : .ec = TALER_EC_EXCHANGE_WIRE_SIGNATURE_INVALID,
896 : .hint = gettext_noop ("A signature in the server's response was malformed."),
897 : .http_code = MHD_HTTP_UNINITIALIZED
898 : },
899 :
900 : {
901 : .ec = TALER_EC_EXCHANGE_WIRE_NO_ACCOUNTS_CONFIGURED,
902 : .hint = gettext_noop ("No bank accounts are enabled for the exchange. The administrator should enable-account using the taler-exchange-offline tool."),
903 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
904 : },
905 :
906 : {
907 : .ec = TALER_EC_EXCHANGE_WIRE_INVALID_PAYTO_CONFIGURED,
908 : .hint = gettext_noop ("The payto:// URI stored in the exchange database for its bank account is malformed."),
909 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
910 : },
911 :
912 : {
913 : .ec = TALER_EC_EXCHANGE_WIRE_FEES_NOT_CONFIGURED,
914 : .hint = gettext_noop ("No wire fees are configured for an enabled wire method of the exchange. The administrator must set the wire-fee using the taler-exchange-offline tool."),
915 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
916 : },
917 :
918 : {
919 : .ec = TALER_EC_EXCHANGE_RESERVES_PURSE_CREATE_CONFLICTING_META_DATA,
920 : .hint = gettext_noop ("This purse was previously created with different meta data."),
921 : .http_code = MHD_HTTP_CONFLICT
922 : },
923 :
924 : {
925 : .ec = TALER_EC_EXCHANGE_RESERVES_PURSE_MERGE_CONFLICTING_META_DATA,
926 : .hint = gettext_noop ("This purse was previously merged with different meta data."),
927 : .http_code = MHD_HTTP_CONFLICT
928 : },
929 :
930 : {
931 : .ec = TALER_EC_EXCHANGE_RESERVES_PURSE_CREATE_INSUFFICIENT_FUNDS,
932 : .hint = gettext_noop ("The reserve has insufficient funds to create another purse."),
933 : .http_code = MHD_HTTP_CONFLICT
934 : },
935 :
936 : {
937 : .ec = TALER_EC_EXCHANGE_RESERVES_PURSE_FEE_TOO_LOW,
938 : .hint = gettext_noop ("The purse fee specified for the request is lower than the purse fee charged by the exchange at this time."),
939 : .http_code = MHD_HTTP_BAD_REQUEST
940 : },
941 :
942 : {
943 : .ec = TALER_EC_EXCHANGE_DENOMINATION_HELPER_UNAVAILABLE,
944 : .hint = gettext_noop ("The exchange failed to talk to the process responsible for its private denomination keys."),
945 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
946 : },
947 :
948 : {
949 : .ec = TALER_EC_EXCHANGE_DENOMINATION_HELPER_BUG,
950 : .hint = gettext_noop ("The response from the denomination key helper process was malformed."),
951 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
952 : },
953 :
954 : {
955 : .ec = TALER_EC_EXCHANGE_DENOMINATION_HELPER_TOO_EARLY,
956 : .hint = gettext_noop ("The helper refuses to sign with the key, because it is too early: the validity period has not yet started."),
957 : .http_code = MHD_HTTP_BAD_REQUEST
958 : },
959 :
960 : {
961 : .ec = TALER_EC_EXCHANGE_PURSE_DEPOSIT_EXCHANGE_SIGNATURE_INVALID,
962 : .hint = gettext_noop ("The signature of the exchange on the reply was invalid."),
963 : .http_code = MHD_HTTP_UNINITIALIZED
964 : },
965 :
966 : {
967 : .ec = TALER_EC_EXCHANGE_SIGNKEY_HELPER_UNAVAILABLE,
968 : .hint = gettext_noop ("The exchange failed to talk to the process responsible for its private signing keys."),
969 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
970 : },
971 :
972 : {
973 : .ec = TALER_EC_EXCHANGE_SIGNKEY_HELPER_BUG,
974 : .hint = gettext_noop ("The response from the online signing key helper process was malformed."),
975 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
976 : },
977 :
978 : {
979 : .ec = TALER_EC_EXCHANGE_SIGNKEY_HELPER_TOO_EARLY,
980 : .hint = gettext_noop ("The helper refuses to sign with the key, because it is too early: the validity period has not yet started."),
981 : .http_code = MHD_HTTP_BAD_REQUEST
982 : },
983 :
984 : {
985 : .ec = TALER_EC_EXCHANGE_RESERVES_PURSE_EXPIRATION_BEFORE_NOW,
986 : .hint = gettext_noop ("The purse expiration time is in the past at the time of its creation."),
987 : .http_code = MHD_HTTP_BAD_REQUEST
988 : },
989 :
990 : {
991 : .ec = TALER_EC_EXCHANGE_RESERVES_PURSE_EXPIRATION_IS_NEVER,
992 : .hint = gettext_noop ("The purse expiration time is set to never, which is not allowed."),
993 : .http_code = MHD_HTTP_BAD_REQUEST
994 : },
995 :
996 : {
997 : .ec = TALER_EC_EXCHANGE_RESERVES_PURSE_MERGE_SIGNATURE_INVALID,
998 : .hint = gettext_noop ("The signature affirming the merge of the purse is invalid."),
999 : .http_code = MHD_HTTP_FORBIDDEN
1000 : },
1001 :
1002 : {
1003 : .ec = TALER_EC_EXCHANGE_RESERVES_RESERVE_MERGE_SIGNATURE_INVALID,
1004 : .hint = gettext_noop ("The signature by the reserve affirming the merge is invalid."),
1005 : .http_code = MHD_HTTP_FORBIDDEN
1006 : },
1007 :
1008 : {
1009 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_AUDITOR_NOT_FOUND,
1010 : .hint = gettext_noop ("The auditor that was supposed to be disabled is unknown to this exchange."),
1011 : .http_code = MHD_HTTP_NOT_FOUND
1012 : },
1013 :
1014 : {
1015 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_AUDITOR_MORE_RECENT_PRESENT,
1016 : .hint = gettext_noop ("The exchange has a more recently signed conflicting instruction and is thus refusing the current change (replay detected)."),
1017 : .http_code = MHD_HTTP_CONFLICT
1018 : },
1019 :
1020 : {
1021 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_AUDITOR_ADD_SIGNATURE_INVALID,
1022 : .hint = gettext_noop ("The signature to add or enable the auditor does not validate."),
1023 : .http_code = MHD_HTTP_FORBIDDEN
1024 : },
1025 :
1026 : {
1027 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_AUDITOR_DEL_SIGNATURE_INVALID,
1028 : .hint = gettext_noop ("The signature to disable the auditor does not validate."),
1029 : .http_code = MHD_HTTP_FORBIDDEN
1030 : },
1031 :
1032 : {
1033 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_DENOMINATION_REVOKE_SIGNATURE_INVALID,
1034 : .hint = gettext_noop ("The signature to revoke the denomination does not validate."),
1035 : .http_code = MHD_HTTP_FORBIDDEN
1036 : },
1037 :
1038 : {
1039 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_SIGNKEY_REVOKE_SIGNATURE_INVALID,
1040 : .hint = gettext_noop ("The signature to revoke the online signing key does not validate."),
1041 : .http_code = MHD_HTTP_FORBIDDEN
1042 : },
1043 :
1044 : {
1045 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_WIRE_MORE_RECENT_PRESENT,
1046 : .hint = gettext_noop ("The exchange has a more recently signed conflicting instruction and is thus refusing the current change (replay detected)."),
1047 : .http_code = MHD_HTTP_CONFLICT
1048 : },
1049 :
1050 : {
1051 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_KEYS_SIGNKEY_UNKNOWN,
1052 : .hint = gettext_noop ("The signingkey specified is unknown to the exchange."),
1053 : .http_code = MHD_HTTP_NOT_FOUND
1054 : },
1055 :
1056 : {
1057 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_WIRE_DETAILS_SIGNATURE_INVALID,
1058 : .hint = gettext_noop ("The signature to publish wire account does not validate."),
1059 : .http_code = MHD_HTTP_FORBIDDEN
1060 : },
1061 :
1062 : {
1063 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_WIRE_ADD_SIGNATURE_INVALID,
1064 : .hint = gettext_noop ("The signature to add the wire account does not validate."),
1065 : .http_code = MHD_HTTP_FORBIDDEN
1066 : },
1067 :
1068 : {
1069 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_WIRE_DEL_SIGNATURE_INVALID,
1070 : .hint = gettext_noop ("The signature to disable the wire account does not validate."),
1071 : .http_code = MHD_HTTP_FORBIDDEN
1072 : },
1073 :
1074 : {
1075 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_WIRE_NOT_FOUND,
1076 : .hint = gettext_noop ("The wire account to be disabled is unknown to the exchange."),
1077 : .http_code = MHD_HTTP_NOT_FOUND
1078 : },
1079 :
1080 : {
1081 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_WIRE_FEE_SIGNATURE_INVALID,
1082 : .hint = gettext_noop ("The signature to affirm wire fees does not validate."),
1083 : .http_code = MHD_HTTP_FORBIDDEN
1084 : },
1085 :
1086 : {
1087 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_WIRE_FEE_MISMATCH,
1088 : .hint = gettext_noop ("The signature conflicts with a previous signature affirming different fees."),
1089 : .http_code = MHD_HTTP_CONFLICT
1090 : },
1091 :
1092 : {
1093 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_KEYS_DENOMKEY_ADD_SIGNATURE_INVALID,
1094 : .hint = gettext_noop ("The signature affirming the denomination key is invalid."),
1095 : .http_code = MHD_HTTP_FORBIDDEN
1096 : },
1097 :
1098 : {
1099 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_KEYS_SIGNKEY_ADD_SIGNATURE_INVALID,
1100 : .hint = gettext_noop ("The signature affirming the signing key is invalid."),
1101 : .http_code = MHD_HTTP_FORBIDDEN
1102 : },
1103 :
1104 : {
1105 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_GLOBAL_FEE_MISMATCH,
1106 : .hint = gettext_noop ("The signature conflicts with a previous signature affirming different fees."),
1107 : .http_code = MHD_HTTP_CONFLICT
1108 : },
1109 :
1110 : {
1111 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_GLOBAL_FEE_SIGNATURE_INVALID,
1112 : .hint = gettext_noop ("The signature affirming the fee structure is invalid."),
1113 : .http_code = MHD_HTTP_FORBIDDEN
1114 : },
1115 :
1116 : {
1117 : .ec = TALER_EC_EXCHANGE_MANAGEMENT_DRAIN_PROFITS_SIGNATURE_INVALID,
1118 : .hint = gettext_noop ("The signature affirming the profit drain is invalid."),
1119 : .http_code = MHD_HTTP_FORBIDDEN
1120 : },
1121 :
1122 : {
1123 : .ec = TALER_EC_EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA,
1124 : .hint = gettext_noop ("The purse was previously created with different meta data."),
1125 : .http_code = MHD_HTTP_CONFLICT
1126 : },
1127 :
1128 : {
1129 : .ec = TALER_EC_EXCHANGE_PURSE_CREATE_CONFLICTING_CONTRACT_STORED,
1130 : .hint = gettext_noop ("The purse was previously created with a different contract."),
1131 : .http_code = MHD_HTTP_CONFLICT
1132 : },
1133 :
1134 : {
1135 : .ec = TALER_EC_EXCHANGE_PURSE_CREATE_COIN_SIGNATURE_INVALID,
1136 : .hint = gettext_noop ("A coin signature for a deposit into the purse is invalid."),
1137 : .http_code = MHD_HTTP_FORBIDDEN
1138 : },
1139 :
1140 : {
1141 : .ec = TALER_EC_EXCHANGE_PURSE_CREATE_EXPIRATION_BEFORE_NOW,
1142 : .hint = gettext_noop ("The purse expiration time is in the past."),
1143 : .http_code = MHD_HTTP_BAD_REQUEST
1144 : },
1145 :
1146 : {
1147 : .ec = TALER_EC_EXCHANGE_PURSE_CREATE_EXPIRATION_IS_NEVER,
1148 : .hint = gettext_noop ("The purse expiration time is \"never\"."),
1149 : .http_code = MHD_HTTP_BAD_REQUEST
1150 : },
1151 :
1152 : {
1153 : .ec = TALER_EC_EXCHANGE_PURSE_CREATE_SIGNATURE_INVALID,
1154 : .hint = gettext_noop ("The purse signature over the purse meta data is invalid."),
1155 : .http_code = MHD_HTTP_FORBIDDEN
1156 : },
1157 :
1158 : {
1159 : .ec = TALER_EC_EXCHANGE_PURSE_ECONTRACT_SIGNATURE_INVALID,
1160 : .hint = gettext_noop ("The signature over the encrypted contract is invalid."),
1161 : .http_code = MHD_HTTP_FORBIDDEN
1162 : },
1163 :
1164 : {
1165 : .ec = TALER_EC_EXCHANGE_PURSE_CREATE_EXCHANGE_SIGNATURE_INVALID,
1166 : .hint = gettext_noop ("The signature from the exchange over the confirmation is invalid."),
1167 : .http_code = MHD_HTTP_UNINITIALIZED
1168 : },
1169 :
1170 : {
1171 : .ec = TALER_EC_EXCHANGE_PURSE_DEPOSIT_CONFLICTING_META_DATA,
1172 : .hint = gettext_noop ("The coin was previously deposited with different meta data."),
1173 : .http_code = MHD_HTTP_CONFLICT
1174 : },
1175 :
1176 : {
1177 : .ec = TALER_EC_EXCHANGE_PURSE_ECONTRACT_CONFLICTING_META_DATA,
1178 : .hint = gettext_noop ("The encrypted contract was previously uploaded with different meta data."),
1179 : .http_code = MHD_HTTP_CONFLICT
1180 : },
1181 :
1182 : {
1183 : .ec = TALER_EC_EXCHANGE_CREATE_PURSE_NEGATIVE_VALUE_AFTER_FEE,
1184 : .hint = gettext_noop ("The deposited amount is less than the purse fee."),
1185 : .http_code = MHD_HTTP_BAD_REQUEST
1186 : },
1187 :
1188 : {
1189 : .ec = TALER_EC_EXCHANGE_PURSE_MERGE_INVALID_MERGE_SIGNATURE,
1190 : .hint = gettext_noop ("The signature using the merge key is invalid."),
1191 : .http_code = MHD_HTTP_FORBIDDEN
1192 : },
1193 :
1194 : {
1195 : .ec = TALER_EC_EXCHANGE_PURSE_MERGE_INVALID_RESERVE_SIGNATURE,
1196 : .hint = gettext_noop ("The signature using the reserve key is invalid."),
1197 : .http_code = MHD_HTTP_FORBIDDEN
1198 : },
1199 :
1200 : {
1201 : .ec = TALER_EC_EXCHANGE_PURSE_NOT_FULL,
1202 : .hint = gettext_noop ("The targeted purse is not yet full and thus cannot be merged. Retrying the request later may succeed."),
1203 : .http_code = MHD_HTTP_CONFLICT
1204 : },
1205 :
1206 : {
1207 : .ec = TALER_EC_EXCHANGE_PURSE_MERGE_EXCHANGE_SIGNATURE_INVALID,
1208 : .hint = gettext_noop ("The signature from the exchange over the confirmation is invalid."),
1209 : .http_code = MHD_HTTP_UNINITIALIZED
1210 : },
1211 :
1212 : {
1213 : .ec = TALER_EC_EXCHANGE_MERGE_PURSE_PARTNER_UNKNOWN,
1214 : .hint = gettext_noop ("The exchange of the target account is not a partner of this exchange."),
1215 : .http_code = MHD_HTTP_NOT_FOUND
1216 : },
1217 :
1218 : {
1219 : .ec = TALER_EC_EXCHANGE_AUDITORS_AUDITOR_SIGNATURE_INVALID,
1220 : .hint = gettext_noop ("The auditor signature over the denomination meta data is invalid."),
1221 : .http_code = MHD_HTTP_FORBIDDEN
1222 : },
1223 :
1224 : {
1225 : .ec = TALER_EC_EXCHANGE_AUDITORS_AUDITOR_UNKNOWN,
1226 : .hint = gettext_noop ("The auditor that was specified is unknown to this exchange."),
1227 : .http_code = MHD_HTTP_PRECONDITION_FAILED
1228 : },
1229 :
1230 : {
1231 : .ec = TALER_EC_EXCHANGE_AUDITORS_AUDITOR_INACTIVE,
1232 : .hint = gettext_noop ("The auditor that was specified is no longer used by this exchange."),
1233 : .http_code = MHD_HTTP_GONE
1234 : },
1235 :
1236 : {
1237 : .ec = TALER_EC_EXCHANGE_KYC_WALLET_SIGNATURE_INVALID,
1238 : .hint = gettext_noop ("The signature affirming the wallet's KYC request was invalid."),
1239 : .http_code = MHD_HTTP_FORBIDDEN
1240 : },
1241 :
1242 : {
1243 : .ec = TALER_EC_EXCHANGE_KYC_PROOF_BACKEND_INVALID_RESPONSE,
1244 : .hint = gettext_noop ("The exchange received an unexpected malformed response from its KYC backend."),
1245 : .http_code = MHD_HTTP_BAD_GATEWAY
1246 : },
1247 :
1248 : {
1249 : .ec = TALER_EC_EXCHANGE_KYC_PROOF_BACKEND_ERROR,
1250 : .hint = gettext_noop ("The backend signaled an unexpected failure."),
1251 : .http_code = MHD_HTTP_BAD_GATEWAY
1252 : },
1253 :
1254 : {
1255 : .ec = TALER_EC_EXCHANGE_KYC_PROOF_BACKEND_AUTHORIZATION_FAILED,
1256 : .hint = gettext_noop ("The backend signaled an authorization failure."),
1257 : .http_code = MHD_HTTP_FORBIDDEN
1258 : },
1259 :
1260 : {
1261 : .ec = TALER_EC_EXCHANGE_KYC_PROOF_REQUEST_UNKNOWN,
1262 : .hint = gettext_noop ("The exchange is unaware of having made an the authorization request."),
1263 : .http_code = MHD_HTTP_NOT_FOUND
1264 : },
1265 :
1266 : {
1267 : .ec = TALER_EC_EXCHANGE_KYC_CHECK_AUTHORIZATION_FAILED,
1268 : .hint = gettext_noop ("The payto-URI hash did not match. Hence the request was denied."),
1269 : .http_code = MHD_HTTP_FORBIDDEN
1270 : },
1271 :
1272 : {
1273 : .ec = TALER_EC_EXCHANGE_KYC_GENERIC_LOGIC_UNKNOWN,
1274 : .hint = gettext_noop ("The request used a logic specifier that is not known to the exchange."),
1275 : .http_code = MHD_HTTP_NOT_FOUND
1276 : },
1277 :
1278 : {
1279 : .ec = TALER_EC_EXCHANGE_KYC_GENERIC_LOGIC_GONE,
1280 : .hint = gettext_noop ("The request requires a logic which is no longer configured at the exchange."),
1281 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1282 : },
1283 :
1284 : {
1285 : .ec = TALER_EC_EXCHANGE_KYC_GENERIC_LOGIC_BUG,
1286 : .hint = gettext_noop ("The logic plugin had a bug in its interaction with the KYC provider."),
1287 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1288 : },
1289 :
1290 : {
1291 : .ec = TALER_EC_EXCHANGE_KYC_GENERIC_PROVIDER_ACCESS_REFUSED,
1292 : .hint = gettext_noop ("The exchange could not process the request with its KYC provider because the provider refused access to the service. This indicates some configuration issue at the Taler exchange operator."),
1293 : .http_code = MHD_HTTP_NETWORK_AUTHENTICATION_REQUIRED
1294 : },
1295 :
1296 : {
1297 : .ec = TALER_EC_EXCHANGE_KYC_GENERIC_PROVIDER_TIMEOUT,
1298 : .hint = gettext_noop ("There was a timeout in the interaction between the exchange and the KYC provider. The most likely cause is some networking problem. Trying again later might succeed."),
1299 : .http_code = MHD_HTTP_GATEWAY_TIMEOUT
1300 : },
1301 :
1302 : {
1303 : .ec = TALER_EC_EXCHANGE_KYC_GENERIC_PROVIDER_UNEXPECTED_REPLY,
1304 : .hint = gettext_noop ("The KYC provider responded with a status that was completely unexpected by the KYC logic of the exchange."),
1305 : .http_code = MHD_HTTP_BAD_GATEWAY
1306 : },
1307 :
1308 : {
1309 : .ec = TALER_EC_EXCHANGE_KYC_GENERIC_PROVIDER_RATE_LIMIT_EXCEEDED,
1310 : .hint = gettext_noop ("The rate limit of the exchange at the KYC provider has been exceeded. Trying much later might work."),
1311 : .http_code = MHD_HTTP_SERVICE_UNAVAILABLE
1312 : },
1313 :
1314 : {
1315 : .ec = TALER_EC_EXCHANGE_KYC_WEBHOOK_UNAUTHORIZED,
1316 : .hint = gettext_noop ("The request to the webhook lacked proper authorization or authentication data."),
1317 : .http_code = MHD_HTTP_UNAUTHORIZED
1318 : },
1319 :
1320 : {
1321 : .ec = TALER_EC_EXCHANGE_CONTRACTS_UNKNOWN,
1322 : .hint = gettext_noop ("The exchange does not know a contract under the given contract public key."),
1323 : .http_code = MHD_HTTP_NOT_FOUND
1324 : },
1325 :
1326 : {
1327 : .ec = TALER_EC_EXCHANGE_CONTRACTS_INVALID_CONTRACT_PUB,
1328 : .hint = gettext_noop ("The URL does not encode a valid exchange public key in its path."),
1329 : .http_code = MHD_HTTP_BAD_REQUEST
1330 : },
1331 :
1332 : {
1333 : .ec = TALER_EC_EXCHANGE_CONTRACTS_DECRYPTION_FAILED,
1334 : .hint = gettext_noop ("The returned encrypted contract did not decrypt."),
1335 : .http_code = MHD_HTTP_UNINITIALIZED
1336 : },
1337 :
1338 : {
1339 : .ec = TALER_EC_EXCHANGE_CONTRACTS_SIGNATURE_INVALID,
1340 : .hint = gettext_noop ("The signature on the encrypted contract did not validate."),
1341 : .http_code = MHD_HTTP_UNINITIALIZED
1342 : },
1343 :
1344 : {
1345 : .ec = TALER_EC_EXCHANGE_CONTRACTS_DECODING_FAILED,
1346 : .hint = gettext_noop ("The decrypted contract was malformed."),
1347 : .http_code = MHD_HTTP_UNINITIALIZED
1348 : },
1349 :
1350 : {
1351 : .ec = TALER_EC_EXCHANGE_PURSE_DEPOSIT_COIN_SIGNATURE_INVALID,
1352 : .hint = gettext_noop ("A coin signature for a deposit into the purse is invalid."),
1353 : .http_code = MHD_HTTP_FORBIDDEN
1354 : },
1355 :
1356 : {
1357 : .ec = TALER_EC_MERCHANT_GENERIC_INSTANCE_UNKNOWN,
1358 : .hint = gettext_noop ("The backend could not find the merchant instance specified in the request."),
1359 : .http_code = MHD_HTTP_NOT_FOUND
1360 : },
1361 :
1362 : {
1363 : .ec = TALER_EC_MERCHANT_GENERIC_HOLE_IN_WIRE_FEE_STRUCTURE,
1364 : .hint = gettext_noop ("The start and end-times in the wire fee structure leave a hole. This is not allowed."),
1365 : .http_code = MHD_HTTP_UNINITIALIZED
1366 : },
1367 :
1368 : {
1369 : .ec = TALER_EC_MERCHANT_GENERIC_RESERVE_PUB_MALFORMED,
1370 : .hint = gettext_noop ("The reserve key of given to a /reserves/ handler was malformed."),
1371 : .http_code = MHD_HTTP_BAD_REQUEST
1372 : },
1373 :
1374 : {
1375 : .ec = TALER_EC_MERCHANT_GENERIC_ORDER_UNKNOWN,
1376 : .hint = gettext_noop ("The proposal is not known to the backend."),
1377 : .http_code = MHD_HTTP_NOT_FOUND
1378 : },
1379 :
1380 : {
1381 : .ec = TALER_EC_MERCHANT_GENERIC_PRODUCT_UNKNOWN,
1382 : .hint = gettext_noop ("The order provided to the backend could not be completed, because a product to be completed via inventory data is not actually in our inventory."),
1383 : .http_code = MHD_HTTP_NOT_FOUND
1384 : },
1385 :
1386 : {
1387 : .ec = TALER_EC_MERCHANT_GENERIC_TIP_ID_UNKNOWN,
1388 : .hint = gettext_noop ("The tip ID is unknown. This could happen if the tip has expired."),
1389 : .http_code = MHD_HTTP_NOT_FOUND
1390 : },
1391 :
1392 : {
1393 : .ec = TALER_EC_MERCHANT_GENERIC_DB_CONTRACT_CONTENT_INVALID,
1394 : .hint = gettext_noop ("The contract obtained from the merchant backend was malformed."),
1395 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1396 : },
1397 :
1398 : {
1399 : .ec = TALER_EC_MERCHANT_GENERIC_CONTRACT_HASH_DOES_NOT_MATCH_ORDER,
1400 : .hint = gettext_noop ("The order we found does not match the provided contract hash."),
1401 : .http_code = MHD_HTTP_FORBIDDEN
1402 : },
1403 :
1404 : {
1405 : .ec = TALER_EC_MERCHANT_GENERIC_EXCHANGE_KEYS_FAILURE,
1406 : .hint = gettext_noop ("The exchange failed to provide a valid response to the merchant's /keys request."),
1407 : .http_code = MHD_HTTP_BAD_GATEWAY
1408 : },
1409 :
1410 : {
1411 : .ec = TALER_EC_MERCHANT_GENERIC_EXCHANGE_TIMEOUT,
1412 : .hint = gettext_noop ("The exchange failed to respond to the merchant on time."),
1413 : .http_code = MHD_HTTP_GATEWAY_TIMEOUT
1414 : },
1415 :
1416 : {
1417 : .ec = TALER_EC_MERCHANT_GENERIC_EXCHANGE_CONNECT_FAILURE,
1418 : .hint = gettext_noop ("The merchant failed to talk to the exchange."),
1419 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1420 : },
1421 :
1422 : {
1423 : .ec = TALER_EC_MERCHANT_GENERIC_EXCHANGE_REPLY_MALFORMED,
1424 : .hint = gettext_noop ("The exchange returned a maformed response."),
1425 : .http_code = MHD_HTTP_BAD_GATEWAY
1426 : },
1427 :
1428 : {
1429 : .ec = TALER_EC_MERCHANT_GENERIC_EXCHANGE_UNEXPECTED_STATUS,
1430 : .hint = gettext_noop ("The exchange returned an unexpected response status."),
1431 : .http_code = MHD_HTTP_BAD_GATEWAY
1432 : },
1433 :
1434 : {
1435 : .ec = TALER_EC_MERCHANT_GENERIC_UNAUTHORIZED,
1436 : .hint = gettext_noop ("The merchant refused the request due to lack of authorization."),
1437 : .http_code = MHD_HTTP_UNAUTHORIZED
1438 : },
1439 :
1440 : {
1441 : .ec = TALER_EC_MERCHANT_GENERIC_INSTANCE_DELETED,
1442 : .hint = gettext_noop ("The merchant instance specified in the request was deleted."),
1443 : .http_code = MHD_HTTP_NOT_FOUND
1444 : },
1445 :
1446 : {
1447 : .ec = TALER_EC_MERCHANT_GENERIC_TRANSFER_UNKNOWN,
1448 : .hint = gettext_noop ("The backend could not find the inbound wire transfer specified in the request."),
1449 : .http_code = MHD_HTTP_NOT_FOUND
1450 : },
1451 :
1452 : {
1453 : .ec = TALER_EC_MERCHANT_GET_ORDERS_EXCHANGE_TRACKING_FAILURE,
1454 : .hint = gettext_noop ("The exchange failed to provide a valid answer to the tracking request, thus those details are not in the response."),
1455 : .http_code = MHD_HTTP_OK
1456 : },
1457 :
1458 : {
1459 : .ec = TALER_EC_MERCHANT_GET_ORDERS_ID_EXCHANGE_REQUEST_FAILURE,
1460 : .hint = gettext_noop ("The merchant backend failed to construct the request for tracking to the exchange, thus tracking details are not in the response."),
1461 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1462 : },
1463 :
1464 : {
1465 : .ec = TALER_EC_MERCHANT_GET_ORDERS_ID_EXCHANGE_LOOKUP_START_FAILURE,
1466 : .hint = gettext_noop ("The merchant backend failed trying to contact the exchange for tracking details, thus those details are not in the response."),
1467 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1468 : },
1469 :
1470 : {
1471 : .ec = TALER_EC_MERCHANT_GET_ORDERS_ID_INVALID_TOKEN,
1472 : .hint = gettext_noop ("The claim token used to authenticate the client is invalid for this order."),
1473 : .http_code = MHD_HTTP_FORBIDDEN
1474 : },
1475 :
1476 : {
1477 : .ec = TALER_EC_MERCHANT_GET_ORDERS_ID_INVALID_CONTRACT_HASH,
1478 : .hint = gettext_noop ("The contract terms hash used to authenticate the client is invalid for this order."),
1479 : .http_code = MHD_HTTP_FORBIDDEN
1480 : },
1481 :
1482 : {
1483 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_FUNDS,
1484 : .hint = gettext_noop ("The exchange responded saying that funds were insufficient (for example, due to double-spending)."),
1485 : .http_code = MHD_HTTP_CONFLICT
1486 : },
1487 :
1488 : {
1489 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_KEY_NOT_FOUND,
1490 : .hint = gettext_noop ("The denomination key used for payment is not listed among the denomination keys of the exchange."),
1491 : .http_code = MHD_HTTP_BAD_REQUEST
1492 : },
1493 :
1494 : {
1495 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_KEY_AUDITOR_FAILURE,
1496 : .hint = gettext_noop ("The denomination key used for payment is not audited by an auditor approved by the merchant."),
1497 : .http_code = MHD_HTTP_BAD_REQUEST
1498 : },
1499 :
1500 : {
1501 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_AMOUNT_OVERFLOW,
1502 : .hint = gettext_noop ("There was an integer overflow totaling up the amounts or deposit fees in the payment."),
1503 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1504 : },
1505 :
1506 : {
1507 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_FEES_EXCEED_PAYMENT,
1508 : .hint = gettext_noop ("The deposit fees exceed the total value of the payment."),
1509 : .http_code = MHD_HTTP_BAD_REQUEST
1510 : },
1511 :
1512 : {
1513 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_INSUFFICIENT_DUE_TO_FEES,
1514 : .hint = gettext_noop ("After considering deposit and wire fees, the payment is insufficient to satisfy the required amount for the contract. The client should revisit the logic used to calculate fees it must cover."),
1515 : .http_code = MHD_HTTP_NOT_ACCEPTABLE
1516 : },
1517 :
1518 : {
1519 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_PAYMENT_INSUFFICIENT,
1520 : .hint = gettext_noop ("Even if we do not consider deposit and wire fees, the payment is insufficient to satisfy the required amount for the contract."),
1521 : .http_code = MHD_HTTP_NOT_ACCEPTABLE
1522 : },
1523 :
1524 : {
1525 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_COIN_SIGNATURE_INVALID,
1526 : .hint = gettext_noop ("The signature over the contract of one of the coins was invalid."),
1527 : .http_code = MHD_HTTP_FORBIDDEN
1528 : },
1529 :
1530 : {
1531 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_LOOKUP_FAILED,
1532 : .hint = gettext_noop ("When we tried to find information about the exchange to issue the deposit, we failed. This usually only happens if the merchant backend is somehow unable to get its own HTTP client logic to work."),
1533 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1534 : },
1535 :
1536 : {
1537 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_REFUND_DEADLINE_PAST_WIRE_TRANSFER_DEADLINE,
1538 : .hint = gettext_noop ("The refund deadline in the contract is after the transfer deadline."),
1539 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1540 : },
1541 :
1542 : {
1543 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_ALREADY_PAID,
1544 : .hint = gettext_noop ("The order was already paid (maybe by another wallet)."),
1545 : .http_code = MHD_HTTP_CONFLICT
1546 : },
1547 :
1548 : {
1549 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_OFFER_EXPIRED,
1550 : .hint = gettext_noop ("The payment is too late, the offer has expired."),
1551 : .http_code = MHD_HTTP_GONE
1552 : },
1553 :
1554 : {
1555 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_MERCHANT_FIELD_MISSING,
1556 : .hint = gettext_noop ("The \"merchant\" field is missing in the proposal data. This is an internal error as the proposal is from the merchant's own database at this point."),
1557 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1558 : },
1559 :
1560 : {
1561 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_WIRE_HASH_UNKNOWN,
1562 : .hint = gettext_noop ("Failed to locate merchant's account information matching the wire hash given in the proposal."),
1563 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1564 : },
1565 :
1566 : {
1567 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_DENOMINATION_DEPOSIT_EXPIRED,
1568 : .hint = gettext_noop ("The deposit time for the denomination has expired."),
1569 : .http_code = MHD_HTTP_GONE
1570 : },
1571 :
1572 : {
1573 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_WIRE_FEE_ADDITION_FAILED,
1574 : .hint = gettext_noop ("The exchange of the deposited coin charges a wire fee that could not be added to the total (total amount too high)."),
1575 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1576 : },
1577 :
1578 : {
1579 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_REFUNDED,
1580 : .hint = gettext_noop ("The contract was not fully paid because of refunds. Note that clients MAY treat this as paid if, for example, contracts must be executed despite of refunds."),
1581 : .http_code = MHD_HTTP_PAYMENT_REQUIRED
1582 : },
1583 :
1584 : {
1585 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_REFUNDS_EXCEED_PAYMENTS,
1586 : .hint = gettext_noop ("According to our database, we have refunded more than we were paid (which should not be possible)."),
1587 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1588 : },
1589 :
1590 : {
1591 : .ec = TALER_EC_DEAD_QQQ_PAY_MERCHANT_POST_ORDERS_ID_ABORT_REFUND_REFUSED_PAYMENT_COMPLETE,
1592 : .hint = gettext_noop ("Legacy stuff. Remove me with protocol v1."),
1593 : .http_code = MHD_HTTP_UNINITIALIZED
1594 : },
1595 :
1596 : {
1597 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_EXCHANGE_FAILED,
1598 : .hint = gettext_noop ("The payment failed at the exchange."),
1599 : .http_code = MHD_HTTP_BAD_GATEWAY
1600 : },
1601 :
1602 : {
1603 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_MISSING,
1604 : .hint = gettext_noop ("The payment required a minimum age but one of the coins (of a denomination with support for age restriction) did not provide any age_commitment."),
1605 : .http_code = MHD_HTTP_BAD_REQUEST
1606 : },
1607 :
1608 : {
1609 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_SIZE_MISMATCH,
1610 : .hint = gettext_noop ("The payment required a minimum age but one of the coins provided an age_commitment that contained a wrong number of public keys compared to the number of age groups defined in the denomination of the coin."),
1611 : .http_code = MHD_HTTP_BAD_REQUEST
1612 : },
1613 :
1614 : {
1615 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_AGE_VERIFICATION_FAILED,
1616 : .hint = gettext_noop ("The payment required a minimum age but one of the coins provided a minimum_age_sig that couldn't be verified with the given age_commitment for that particular minimum age."),
1617 : .http_code = MHD_HTTP_BAD_REQUEST
1618 : },
1619 :
1620 : {
1621 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAY_AGE_COMMITMENT_HASH_MISSING,
1622 : .hint = gettext_noop ("The payment required no minimum age but one of the coins (of a denomination with support for age restriction) did not provide the required h_age_commitment."),
1623 : .http_code = MHD_HTTP_BAD_REQUEST
1624 : },
1625 :
1626 : {
1627 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAID_CONTRACT_HASH_MISMATCH,
1628 : .hint = gettext_noop ("The contract hash does not match the given order ID."),
1629 : .http_code = MHD_HTTP_BAD_REQUEST
1630 : },
1631 :
1632 : {
1633 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_PAID_COIN_SIGNATURE_INVALID,
1634 : .hint = gettext_noop ("The signature of the merchant is not valid for the given contract hash."),
1635 : .http_code = MHD_HTTP_FORBIDDEN
1636 : },
1637 :
1638 : {
1639 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_REFUND_FAILED,
1640 : .hint = gettext_noop ("The merchant failed to send the exchange the refund request."),
1641 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1642 : },
1643 :
1644 : {
1645 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_ABORT_EXCHANGE_LOOKUP_FAILED,
1646 : .hint = gettext_noop ("The merchant failed to find the exchange to process the lookup."),
1647 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1648 : },
1649 :
1650 : {
1651 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_ABORT_CONTRACT_NOT_FOUND,
1652 : .hint = gettext_noop ("The merchant could not find the contract."),
1653 : .http_code = MHD_HTTP_NOT_FOUND
1654 : },
1655 :
1656 : {
1657 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_ABORT_REFUND_REFUSED_PAYMENT_COMPLETE,
1658 : .hint = gettext_noop ("The payment was already completed and thus cannot be aborted anymore."),
1659 : .http_code = MHD_HTTP_PRECONDITION_FAILED
1660 : },
1661 :
1662 : {
1663 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_ABORT_CONTRACT_HASH_MISSMATCH,
1664 : .hint = gettext_noop ("The hash provided by the wallet does not match the order."),
1665 : .http_code = MHD_HTTP_FORBIDDEN
1666 : },
1667 :
1668 : {
1669 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_ABORT_COINS_ARRAY_EMPTY,
1670 : .hint = gettext_noop ("The array of coins cannot be empty."),
1671 : .http_code = MHD_HTTP_BAD_REQUEST
1672 : },
1673 :
1674 : {
1675 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_CLAIM_NOT_FOUND,
1676 : .hint = gettext_noop ("We could not claim the order because the backend is unaware of it."),
1677 : .http_code = MHD_HTTP_NOT_FOUND
1678 : },
1679 :
1680 : {
1681 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_CLAIM_ALREADY_CLAIMED,
1682 : .hint = gettext_noop ("We could not claim the order because someone else claimed it first."),
1683 : .http_code = MHD_HTTP_CONFLICT
1684 : },
1685 :
1686 : {
1687 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_CLAIM_CLIENT_INTERNAL_FAILURE,
1688 : .hint = gettext_noop ("The client-side experienced an internal failure."),
1689 : .http_code = MHD_HTTP_UNINITIALIZED
1690 : },
1691 :
1692 : {
1693 : .ec = TALER_EC_MERCHANT_POST_ORDERS_ID_REFUND_SIGNATURE_FAILED,
1694 : .hint = gettext_noop ("The backend failed to sign the refund request."),
1695 : .http_code = MHD_HTTP_UNINITIALIZED
1696 : },
1697 :
1698 : {
1699 : .ec = TALER_EC_MERCHANT_TIP_PICKUP_UNBLIND_FAILURE,
1700 : .hint = gettext_noop ("The client failed to unblind the signature returned by the merchant."),
1701 : .http_code = MHD_HTTP_UNINITIALIZED
1702 : },
1703 :
1704 : {
1705 : .ec = TALER_EC_MERCHANT_TIP_PICKUP_EXCHANGE_ERROR,
1706 : .hint = gettext_noop ("The exchange returned a failure code for the withdraw operation."),
1707 : .http_code = MHD_HTTP_BAD_GATEWAY
1708 : },
1709 :
1710 : {
1711 : .ec = TALER_EC_MERCHANT_TIP_PICKUP_SUMMATION_FAILED,
1712 : .hint = gettext_noop ("The merchant failed to add up the amounts to compute the pick up value."),
1713 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1714 : },
1715 :
1716 : {
1717 : .ec = TALER_EC_MERCHANT_TIP_PICKUP_HAS_EXPIRED,
1718 : .hint = gettext_noop ("The tip expired."),
1719 : .http_code = MHD_HTTP_GONE
1720 : },
1721 :
1722 : {
1723 : .ec = TALER_EC_MERCHANT_TIP_PICKUP_AMOUNT_EXCEEDS_TIP_REMAINING,
1724 : .hint = gettext_noop ("The requested withdraw amount exceeds the amount remaining to be picked up."),
1725 : .http_code = MHD_HTTP_BAD_REQUEST
1726 : },
1727 :
1728 : {
1729 : .ec = TALER_EC_MERCHANT_TIP_PICKUP_DENOMINATION_UNKNOWN,
1730 : .hint = gettext_noop ("The merchant did not find the specified denomination key in the exchange's key set."),
1731 : .http_code = MHD_HTTP_CONFLICT
1732 : },
1733 :
1734 : {
1735 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_INSTANCE_CONFIGURATION_LACKS_WIRE,
1736 : .hint = gettext_noop ("The backend lacks a wire transfer method configuration option for the given instance. Thus, this instance is unavailable (not findable for creating new orders)."),
1737 : .http_code = MHD_HTTP_NOT_FOUND
1738 : },
1739 :
1740 : {
1741 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_NO_LOCALTIME,
1742 : .hint = gettext_noop ("The proposal had no timestamp and the backend failed to obtain the local time. Likely to be an internal error."),
1743 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
1744 : },
1745 :
1746 : {
1747 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_PROPOSAL_PARSE_ERROR,
1748 : .hint = gettext_noop ("The order provided to the backend could not be parsed, some required fields were missing or ill-formed."),
1749 : .http_code = MHD_HTTP_BAD_REQUEST
1750 : },
1751 :
1752 : {
1753 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ALREADY_EXISTS,
1754 : .hint = gettext_noop ("The backend encountered an error: the proposal already exists."),
1755 : .http_code = MHD_HTTP_CONFLICT
1756 : },
1757 :
1758 : {
1759 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_REFUND_AFTER_WIRE_DEADLINE,
1760 : .hint = gettext_noop ("The request is invalid: the wire deadline is before the refund deadline."),
1761 : .http_code = MHD_HTTP_BAD_REQUEST
1762 : },
1763 :
1764 : {
1765 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_DELIVERY_DATE_IN_PAST,
1766 : .hint = gettext_noop ("The request is invalid: a delivery date was given, but it is in the past."),
1767 : .http_code = MHD_HTTP_BAD_REQUEST
1768 : },
1769 :
1770 : {
1771 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_WIRE_DEADLINE_IS_NEVER,
1772 : .hint = gettext_noop ("The request is invalid: the wire deadline for the order would be \"never\"."),
1773 : .http_code = MHD_HTTP_BAD_REQUEST
1774 : },
1775 :
1776 : {
1777 : .ec = TALER_EC_MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_SYNTAX_INCORRECT,
1778 : .hint = gettext_noop ("One of the paths to forget is malformed."),
1779 : .http_code = MHD_HTTP_BAD_REQUEST
1780 : },
1781 :
1782 : {
1783 : .ec = TALER_EC_MERCHANT_PRIVATE_PATCH_ORDERS_ID_FORGET_PATH_NOT_FORGETTABLE,
1784 : .hint = gettext_noop ("One of the paths to forget was not marked as forgettable."),
1785 : .http_code = MHD_HTTP_CONFLICT
1786 : },
1787 :
1788 : {
1789 : .ec = TALER_EC_MERCHANT_PRIVATE_DELETE_ORDERS_AWAITING_PAYMENT,
1790 : .hint = gettext_noop ("The order provided to the backend could not be deleted, our offer is still valid and awaiting payment."),
1791 : .http_code = MHD_HTTP_CONFLICT
1792 : },
1793 :
1794 : {
1795 : .ec = TALER_EC_MERCHANT_PRIVATE_DELETE_ORDERS_ALREADY_PAID,
1796 : .hint = gettext_noop ("The order provided to the backend could not be deleted as the order was already paid."),
1797 : .http_code = MHD_HTTP_CONFLICT
1798 : },
1799 :
1800 : {
1801 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_INCONSISTENT_AMOUNT,
1802 : .hint = gettext_noop ("The amount to be refunded is inconsistent: either is lower than the previous amount being awarded, or it is too big to be paid back. In this second case, the fault stays on the business dept. side."),
1803 : .http_code = MHD_HTTP_CONFLICT
1804 : },
1805 :
1806 : {
1807 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_ORDER_UNPAID,
1808 : .hint = gettext_noop ("The frontend gave an unpaid order id to issue the refund to."),
1809 : .http_code = MHD_HTTP_CONFLICT
1810 : },
1811 :
1812 : {
1813 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_ORDERS_ID_REFUND_NOT_ALLOWED_BY_CONTRACT,
1814 : .hint = gettext_noop ("The refund delay was set to 0 and thus no refunds are allowed for this order."),
1815 : .http_code = MHD_HTTP_FORBIDDEN
1816 : },
1817 :
1818 : {
1819 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TRANSFERS_EXCHANGE_UNKNOWN,
1820 : .hint = gettext_noop ("The exchange says it does not know this transfer."),
1821 : .http_code = MHD_HTTP_BAD_GATEWAY
1822 : },
1823 :
1824 : {
1825 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TRANSFERS_REQUEST_ERROR,
1826 : .hint = gettext_noop ("We internally failed to execute the /track/transfer request."),
1827 : .http_code = MHD_HTTP_BAD_GATEWAY
1828 : },
1829 :
1830 : {
1831 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_TRANSFERS,
1832 : .hint = gettext_noop ("The amount transferred differs between what was submitted and what the exchange claimed."),
1833 : .http_code = MHD_HTTP_CONFLICT
1834 : },
1835 :
1836 : {
1837 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_REPORTS,
1838 : .hint = gettext_noop ("The exchange gave conflicting information about a coin which has been wire transferred."),
1839 : .http_code = MHD_HTTP_CONFLICT
1840 : },
1841 :
1842 : {
1843 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TRANSFERS_BAD_WIRE_FEE,
1844 : .hint = gettext_noop ("The exchange charged a different wire fee than what it originally advertised, and it is higher."),
1845 : .http_code = MHD_HTTP_BAD_GATEWAY
1846 : },
1847 :
1848 : {
1849 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TRANSFERS_ACCOUNT_NOT_FOUND,
1850 : .hint = gettext_noop ("We did not find the account that the transfer was made to."),
1851 : .http_code = MHD_HTTP_NOT_FOUND
1852 : },
1853 :
1854 : {
1855 : .ec = TALER_EC_MERCHANT_PRIVATE_DELETE_TRANSFERS_ALREADY_CONFIRMED,
1856 : .hint = gettext_noop ("The backend could not delete the transfer as the echange already replied to our inquiry about it and we have integrated the result."),
1857 : .http_code = MHD_HTTP_CONFLICT
1858 : },
1859 :
1860 : {
1861 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TRANSFERS_CONFLICTING_SUBMISSION,
1862 : .hint = gettext_noop ("The backend was previously informed about a wire transfer with the same ID but a different amount. Multiple wire transfers with the same ID are not allowed. If the new amount is correct, the old transfer should first be deleted."),
1863 : .http_code = MHD_HTTP_CONFLICT
1864 : },
1865 :
1866 : {
1867 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_INSTANCES_ALREADY_EXISTS,
1868 : .hint = gettext_noop ("The merchant backend cannot create an instance under the given identifier as one already exists. Use PATCH to modify the existing entry."),
1869 : .http_code = MHD_HTTP_CONFLICT
1870 : },
1871 :
1872 : {
1873 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_INSTANCES_BAD_AUTH,
1874 : .hint = gettext_noop ("The merchant backend cannot create an instance because the authentication configuration field is malformed."),
1875 : .http_code = MHD_HTTP_BAD_REQUEST
1876 : },
1877 :
1878 : {
1879 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_INSTANCE_AUTH_BAD_AUTH,
1880 : .hint = gettext_noop ("The merchant backend cannot update an instance's authentication settings because the provided authentication settings are malformed."),
1881 : .http_code = MHD_HTTP_BAD_REQUEST
1882 : },
1883 :
1884 : {
1885 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_INSTANCES_PURGE_REQUIRED,
1886 : .hint = gettext_noop ("The merchant backend cannot create an instance under the given identifier, the previous one was deleted but must be purged first."),
1887 : .http_code = MHD_HTTP_CONFLICT
1888 : },
1889 :
1890 : {
1891 : .ec = TALER_EC_MERCHANT_PRIVATE_PATCH_INSTANCES_PURGE_REQUIRED,
1892 : .hint = gettext_noop ("The merchant backend cannot update an instance under the given identifier, the previous one was deleted but must be purged first."),
1893 : .http_code = MHD_HTTP_CONFLICT
1894 : },
1895 :
1896 : {
1897 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_PRODUCTS_CONFLICT_PRODUCT_EXISTS,
1898 : .hint = gettext_noop ("The product ID exists."),
1899 : .http_code = MHD_HTTP_CONFLICT
1900 : },
1901 :
1902 : {
1903 : .ec = TALER_EC_MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_LOST_REDUCED,
1904 : .hint = gettext_noop ("The update would have reduced the total amount of product lost, which is not allowed."),
1905 : .http_code = MHD_HTTP_CONFLICT
1906 : },
1907 :
1908 : {
1909 : .ec = TALER_EC_MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_LOST_EXCEEDS_STOCKS,
1910 : .hint = gettext_noop ("The update would have mean that more stocks were lost than what remains from total inventory after sales, which is not allowed."),
1911 : .http_code = MHD_HTTP_BAD_REQUEST
1912 : },
1913 :
1914 : {
1915 : .ec = TALER_EC_MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_STOCKED_REDUCED,
1916 : .hint = gettext_noop ("The update would have reduced the total amount of product in stock, which is not allowed."),
1917 : .http_code = MHD_HTTP_CONFLICT
1918 : },
1919 :
1920 : {
1921 : .ec = TALER_EC_MERCHANT_PRIVATE_PATCH_PRODUCTS_TOTAL_SOLD_REDUCED,
1922 : .hint = gettext_noop ("The update would have reduced the total amount of product sold, which is not allowed."),
1923 : .http_code = MHD_HTTP_CONFLICT
1924 : },
1925 :
1926 : {
1927 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_PRODUCTS_LOCK_INSUFFICIENT_STOCKS,
1928 : .hint = gettext_noop ("The lock request is for more products than we have left (unlocked) in stock."),
1929 : .http_code = MHD_HTTP_GONE
1930 : },
1931 :
1932 : {
1933 : .ec = TALER_EC_MERCHANT_PRIVATE_DELETE_PRODUCTS_CONFLICTING_LOCK,
1934 : .hint = gettext_noop ("The deletion request is for a product that is locked."),
1935 : .http_code = MHD_HTTP_CONFLICT
1936 : },
1937 :
1938 : {
1939 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_RESERVES_UNSUPPORTED_WIRE_METHOD,
1940 : .hint = gettext_noop ("The requested wire method is not supported by the exchange."),
1941 : .http_code = MHD_HTTP_CONFLICT
1942 : },
1943 :
1944 : {
1945 : .ec = TALER_EC_MERCHANT_PRIVATE_DELETE_RESERVES_NO_SUCH_RESERVE,
1946 : .hint = gettext_noop ("The reserve could not be deleted because it is unknown."),
1947 : .http_code = MHD_HTTP_NOT_FOUND
1948 : },
1949 :
1950 : {
1951 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_EXPIRED,
1952 : .hint = gettext_noop ("The reserve that was used to fund the tips has expired."),
1953 : .http_code = MHD_HTTP_GONE
1954 : },
1955 :
1956 : {
1957 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_UNKNOWN,
1958 : .hint = gettext_noop ("The reserve that was used to fund the tips was not found in the DB."),
1959 : .http_code = MHD_HTTP_SERVICE_UNAVAILABLE
1960 : },
1961 :
1962 : {
1963 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_INSUFFICIENT_FUNDS,
1964 : .hint = gettext_noop ("The backend knows the instance that was supposed to support the tip, and it was configured for tipping. However, the funds remaining are insufficient to cover the tip, and the merchant should top up the reserve."),
1965 : .http_code = MHD_HTTP_UNINITIALIZED
1966 : },
1967 :
1968 : {
1969 : .ec = TALER_EC_MERCHANT_PRIVATE_POST_TIP_AUTHORIZE_RESERVE_NOT_FOUND,
1970 : .hint = gettext_noop ("The backend failed to find a reserve needed to authorize the tip."),
1971 : .http_code = MHD_HTTP_SERVICE_UNAVAILABLE
1972 : },
1973 :
1974 : {
1975 : .ec = TALER_EC_MERCHANT_PRIVATE_GET_ORDERS_ID_AMOUNT_ARITHMETIC_FAILURE,
1976 : .hint = gettext_noop ("The merchant backend encountered a failure in computing the deposit total."),
1977 : .http_code = MHD_HTTP_OK
1978 : },
1979 :
1980 : {
1981 : .ec = TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID,
1982 : .hint = gettext_noop ("The signature from the exchange on the deposit confirmation is invalid."),
1983 : .http_code = MHD_HTTP_FORBIDDEN
1984 : },
1985 :
1986 : {
1987 : .ec = TALER_EC_AUDITOR_EXCHANGE_SIGNING_KEY_REVOKED,
1988 : .hint = gettext_noop ("The exchange key used for the signature on the deposit confirmation was revoked."),
1989 : .http_code = MHD_HTTP_GONE
1990 : },
1991 :
1992 : {
1993 : .ec = TALER_EC_BANK_SAME_ACCOUNT,
1994 : .hint = gettext_noop ("Wire transfer attempted with credit and debit party being the same bank account."),
1995 : .http_code = MHD_HTTP_BAD_REQUEST
1996 : },
1997 :
1998 : {
1999 : .ec = TALER_EC_BANK_UNALLOWED_DEBIT,
2000 : .hint = gettext_noop ("Wire transfer impossible, due to financial limitation of the party that attempted the payment."),
2001 : .http_code = MHD_HTTP_CONFLICT
2002 : },
2003 :
2004 : {
2005 : .ec = TALER_EC_BANK_NEGATIVE_NUMBER_AMOUNT,
2006 : .hint = gettext_noop ("Negative numbers are not allowed (as value and/or fraction) to instantiate an amount object."),
2007 : .http_code = MHD_HTTP_BAD_REQUEST
2008 : },
2009 :
2010 : {
2011 : .ec = TALER_EC_BANK_NUMBER_TOO_BIG,
2012 : .hint = gettext_noop ("A too big number was used (as value and/or fraction) to instantiate an amount object."),
2013 : .http_code = MHD_HTTP_BAD_REQUEST
2014 : },
2015 :
2016 : {
2017 : .ec = TALER_EC_BANK_LOGIN_FAILED,
2018 : .hint = gettext_noop ("Could not login for the requested operation."),
2019 : .http_code = MHD_HTTP_FORBIDDEN
2020 : },
2021 :
2022 : {
2023 : .ec = TALER_EC_BANK_UNKNOWN_ACCOUNT,
2024 : .hint = gettext_noop ("The bank account referenced in the requested operation was not found."),
2025 : .http_code = MHD_HTTP_NOT_FOUND
2026 : },
2027 :
2028 : {
2029 : .ec = TALER_EC_BANK_TRANSACTION_NOT_FOUND,
2030 : .hint = gettext_noop ("The transaction referenced in the requested operation (typically a reject operation), was not found."),
2031 : .http_code = MHD_HTTP_NOT_FOUND
2032 : },
2033 :
2034 : {
2035 : .ec = TALER_EC_BANK_BAD_FORMAT_AMOUNT,
2036 : .hint = gettext_noop ("Bank received a malformed amount string."),
2037 : .http_code = MHD_HTTP_BAD_REQUEST
2038 : },
2039 :
2040 : {
2041 : .ec = TALER_EC_BANK_REJECT_NO_RIGHTS,
2042 : .hint = gettext_noop ("The client does not own the account credited by the transaction which is to be rejected, so it has no rights do reject it."),
2043 : .http_code = MHD_HTTP_FORBIDDEN
2044 : },
2045 :
2046 : {
2047 : .ec = TALER_EC_BANK_UNMANAGED_EXCEPTION,
2048 : .hint = gettext_noop ("This error code is returned when no known exception types captured the exception."),
2049 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2050 : },
2051 :
2052 : {
2053 : .ec = TALER_EC_BANK_SOFT_EXCEPTION,
2054 : .hint = gettext_noop ("This error code is used for all those exceptions that do not really need a specific error code to return to the client. Used for example when a client is trying to register with a unavailable username."),
2055 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2056 : },
2057 :
2058 : {
2059 : .ec = TALER_EC_BANK_TRANSFER_REQUEST_UID_REUSED,
2060 : .hint = gettext_noop ("The request UID for a request to transfer funds has already been used, but with different details for the transfer."),
2061 : .http_code = MHD_HTTP_CONFLICT
2062 : },
2063 :
2064 : {
2065 : .ec = TALER_EC_BANK_WITHDRAWAL_OPERATION_RESERVE_SELECTION_CONFLICT,
2066 : .hint = gettext_noop ("The withdrawal operation already has a reserve selected. The current request conflicts with the existing selection."),
2067 : .http_code = MHD_HTTP_CONFLICT
2068 : },
2069 :
2070 : {
2071 : .ec = TALER_EC_BANK_DUPLICATE_RESERVE_PUB_SUBJECT,
2072 : .hint = gettext_noop ("The wire transfer subject duplicates an existing reserve public key. But wire transfer subjects must be unique."),
2073 : .http_code = MHD_HTTP_CONFLICT
2074 : },
2075 :
2076 : {
2077 : .ec = TALER_EC_BANK_ANCIENT_TRANSACTION_GONE,
2078 : .hint = gettext_noop ("The client requested a transaction that is so far in the past, that it has been forgotten by the bank."),
2079 : .http_code = MHD_HTTP_GONE
2080 : },
2081 :
2082 : {
2083 : .ec = TALER_EC_BANK_ABORT_CONFIRM_CONFLICT,
2084 : .hint = gettext_noop ("The client attempted to abort a transaction that was already confirmed."),
2085 : .http_code = MHD_HTTP_CONFLICT
2086 : },
2087 :
2088 : {
2089 : .ec = TALER_EC_BANK_CONFIRM_ABORT_CONFLICT,
2090 : .hint = gettext_noop ("The client attempted to confirm a transaction that was already aborted."),
2091 : .http_code = MHD_HTTP_CONFLICT
2092 : },
2093 :
2094 : {
2095 : .ec = TALER_EC_SYNC_ACCOUNT_UNKNOWN,
2096 : .hint = gettext_noop ("The sync service failed find the account in its database."),
2097 : .http_code = MHD_HTTP_NOT_FOUND
2098 : },
2099 :
2100 : {
2101 : .ec = TALER_EC_SYNC_BAD_IF_NONE_MATCH,
2102 : .hint = gettext_noop ("The SHA-512 hash provided in the If-None-Match header is malformed."),
2103 : .http_code = MHD_HTTP_BAD_REQUEST
2104 : },
2105 :
2106 : {
2107 : .ec = TALER_EC_SYNC_BAD_IF_MATCH,
2108 : .hint = gettext_noop ("The SHA-512 hash provided in the If-Match header is malformed or missing."),
2109 : .http_code = MHD_HTTP_BAD_REQUEST
2110 : },
2111 :
2112 : {
2113 : .ec = TALER_EC_SYNC_BAD_SYNC_SIGNATURE,
2114 : .hint = gettext_noop ("The signature provided in the \"Sync-Signature\" header is malformed or missing."),
2115 : .http_code = MHD_HTTP_BAD_REQUEST
2116 : },
2117 :
2118 : {
2119 : .ec = TALER_EC_SYNC_INVALID_SIGNATURE,
2120 : .hint = gettext_noop ("The signature provided in the \"Sync-Signature\" header does not match the account, old or new Etags."),
2121 : .http_code = MHD_HTTP_FORBIDDEN
2122 : },
2123 :
2124 : {
2125 : .ec = TALER_EC_SYNC_MALFORMED_CONTENT_LENGTH,
2126 : .hint = gettext_noop ("The \"Content-length\" field for the upload is not a number."),
2127 : .http_code = MHD_HTTP_BAD_REQUEST
2128 : },
2129 :
2130 : {
2131 : .ec = TALER_EC_SYNC_EXCESSIVE_CONTENT_LENGTH,
2132 : .hint = gettext_noop ("The \"Content-length\" field for the upload is too big based on the server's terms of service."),
2133 : .http_code = MHD_HTTP_PAYLOAD_TOO_LARGE
2134 : },
2135 :
2136 : {
2137 : .ec = TALER_EC_SYNC_OUT_OF_MEMORY_ON_CONTENT_LENGTH,
2138 : .hint = gettext_noop ("The server is out of memory to handle the upload. Trying again later may succeed."),
2139 : .http_code = MHD_HTTP_PAYLOAD_TOO_LARGE
2140 : },
2141 :
2142 : {
2143 : .ec = TALER_EC_SYNC_INVALID_UPLOAD,
2144 : .hint = gettext_noop ("The uploaded data does not match the Etag."),
2145 : .http_code = MHD_HTTP_BAD_REQUEST
2146 : },
2147 :
2148 : {
2149 : .ec = TALER_EC_SYNC_PAYMENT_GENERIC_TIMEOUT,
2150 : .hint = gettext_noop ("HTTP server experienced a timeout while awaiting promised payment."),
2151 : .http_code = MHD_HTTP_REQUEST_TIMEOUT
2152 : },
2153 :
2154 : {
2155 : .ec = TALER_EC_SYNC_PAYMENT_CREATE_BACKEND_ERROR,
2156 : .hint = gettext_noop ("Sync could not setup the payment request with its own backend."),
2157 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2158 : },
2159 :
2160 : {
2161 : .ec = TALER_EC_SYNC_PREVIOUS_BACKUP_UNKNOWN,
2162 : .hint = gettext_noop ("The sync service failed find the backup to be updated in its database."),
2163 : .http_code = MHD_HTTP_NOT_FOUND
2164 : },
2165 :
2166 : {
2167 : .ec = TALER_EC_SYNC_MISSING_CONTENT_LENGTH,
2168 : .hint = gettext_noop ("The \"Content-length\" field for the upload is missing."),
2169 : .http_code = MHD_HTTP_BAD_REQUEST
2170 : },
2171 :
2172 : {
2173 : .ec = TALER_EC_SYNC_GENERIC_BACKEND_ERROR,
2174 : .hint = gettext_noop ("Sync had problems communicating with its payment backend."),
2175 : .http_code = MHD_HTTP_BAD_GATEWAY
2176 : },
2177 :
2178 : {
2179 : .ec = TALER_EC_SYNC_GENERIC_BACKEND_TIMEOUT,
2180 : .hint = gettext_noop ("Sync experienced a timeout communicating with its payment backend."),
2181 : .http_code = MHD_HTTP_GATEWAY_TIMEOUT
2182 : },
2183 :
2184 : {
2185 : .ec = TALER_EC_WALLET_EXCHANGE_PROTOCOL_VERSION_INCOMPATIBLE,
2186 : .hint = gettext_noop ("The wallet does not implement a version of the exchange protocol that is compatible with the protocol version of the exchange."),
2187 : .http_code = MHD_HTTP_NOT_IMPLEMENTED
2188 : },
2189 :
2190 : {
2191 : .ec = TALER_EC_WALLET_UNEXPECTED_EXCEPTION,
2192 : .hint = gettext_noop ("The wallet encountered an unexpected exception. This is likely a bug in the wallet implementation."),
2193 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2194 : },
2195 :
2196 : {
2197 : .ec = TALER_EC_WALLET_RECEIVED_MALFORMED_RESPONSE,
2198 : .hint = gettext_noop ("The wallet received a response from a server, but the response can't be parsed."),
2199 : .http_code = MHD_HTTP_UNINITIALIZED
2200 : },
2201 :
2202 : {
2203 : .ec = TALER_EC_WALLET_NETWORK_ERROR,
2204 : .hint = gettext_noop ("The wallet tried to make a network request, but it received no response."),
2205 : .http_code = MHD_HTTP_UNINITIALIZED
2206 : },
2207 :
2208 : {
2209 : .ec = TALER_EC_WALLET_HTTP_REQUEST_THROTTLED,
2210 : .hint = gettext_noop ("The wallet tried to make a network request, but it was throttled."),
2211 : .http_code = MHD_HTTP_UNINITIALIZED
2212 : },
2213 :
2214 : {
2215 : .ec = TALER_EC_WALLET_UNEXPECTED_REQUEST_ERROR,
2216 : .hint = gettext_noop ("The wallet made a request to a service, but received an error response it does not know how to handle."),
2217 : .http_code = MHD_HTTP_UNINITIALIZED
2218 : },
2219 :
2220 : {
2221 : .ec = TALER_EC_WALLET_EXCHANGE_DENOMINATIONS_INSUFFICIENT,
2222 : .hint = gettext_noop ("The denominations offered by the exchange are insufficient. Likely the exchange is badly configured or not maintained."),
2223 : .http_code = MHD_HTTP_UNINITIALIZED
2224 : },
2225 :
2226 : {
2227 : .ec = TALER_EC_WALLET_CORE_API_OPERATION_UNKNOWN,
2228 : .hint = gettext_noop ("The wallet does not support the operation requested by a client."),
2229 : .http_code = MHD_HTTP_UNINITIALIZED
2230 : },
2231 :
2232 : {
2233 : .ec = TALER_EC_WALLET_INVALID_TALER_PAY_URI,
2234 : .hint = gettext_noop ("The given taler://pay URI is invalid."),
2235 : .http_code = MHD_HTTP_UNINITIALIZED
2236 : },
2237 :
2238 : {
2239 : .ec = TALER_EC_WALLET_EXCHANGE_COIN_SIGNATURE_INVALID,
2240 : .hint = gettext_noop ("The signature on a coin by the exchange's denomination key is invalid after unblinding it."),
2241 : .http_code = MHD_HTTP_UNINITIALIZED
2242 : },
2243 :
2244 : {
2245 : .ec = TALER_EC_WALLET_EXCHANGE_WITHDRAW_RESERVE_UNKNOWN_AT_EXCHANGE,
2246 : .hint = gettext_noop ("The exchange does not know about the reserve (yet), and thus withdrawal can't progress."),
2247 : .http_code = MHD_HTTP_NOT_FOUND
2248 : },
2249 :
2250 : {
2251 : .ec = TALER_EC_WALLET_CORE_NOT_AVAILABLE,
2252 : .hint = gettext_noop ("The wallet core service is not available."),
2253 : .http_code = MHD_HTTP_UNINITIALIZED
2254 : },
2255 :
2256 : {
2257 : .ec = TALER_EC_WALLET_WITHDRAWAL_OPERATION_ABORTED_BY_BANK,
2258 : .hint = gettext_noop ("The bank has aborted a withdrawal operation, and thus a withdrawal can't complete."),
2259 : .http_code = MHD_HTTP_UNINITIALIZED
2260 : },
2261 :
2262 : {
2263 : .ec = TALER_EC_WALLET_HTTP_REQUEST_GENERIC_TIMEOUT,
2264 : .hint = gettext_noop ("An HTTP request made by the wallet timed out."),
2265 : .http_code = MHD_HTTP_UNINITIALIZED
2266 : },
2267 :
2268 : {
2269 : .ec = TALER_EC_WALLET_ORDER_ALREADY_CLAIMED,
2270 : .hint = gettext_noop ("The order has already been claimed by another wallet."),
2271 : .http_code = MHD_HTTP_UNINITIALIZED
2272 : },
2273 :
2274 : {
2275 : .ec = TALER_EC_WALLET_WITHDRAWAL_GROUP_INCOMPLETE,
2276 : .hint = gettext_noop ("A group of withdrawal operations (typically for the same reserve at the same exchange) has errors and will be tried again later."),
2277 : .http_code = MHD_HTTP_UNINITIALIZED
2278 : },
2279 :
2280 : {
2281 : .ec = TALER_EC_WALLET_TIPPING_COIN_SIGNATURE_INVALID,
2282 : .hint = gettext_noop ("The signature on a coin by the exchange's denomination key (obtained through the merchant via tipping) is invalid after unblinding it."),
2283 : .http_code = MHD_HTTP_UNINITIALIZED
2284 : },
2285 :
2286 : {
2287 : .ec = TALER_EC_WALLET_BANK_INTEGRATION_PROTOCOL_VERSION_INCOMPATIBLE,
2288 : .hint = gettext_noop ("The wallet does not implement a version of the bank integration API that is compatible with the version offered by the bank."),
2289 : .http_code = MHD_HTTP_UNINITIALIZED
2290 : },
2291 :
2292 : {
2293 : .ec = TALER_EC_WALLET_CONTRACT_TERMS_BASE_URL_MISMATCH,
2294 : .hint = gettext_noop ("The wallet processed a taler://pay URI, but the merchant base URL in the downloaded contract terms does not match the merchant base URL derived from the URI."),
2295 : .http_code = MHD_HTTP_UNINITIALIZED
2296 : },
2297 :
2298 : {
2299 : .ec = TALER_EC_WALLET_CONTRACT_TERMS_SIGNATURE_INVALID,
2300 : .hint = gettext_noop ("The merchant's signature on the contract terms is invalid."),
2301 : .http_code = MHD_HTTP_UNINITIALIZED
2302 : },
2303 :
2304 : {
2305 : .ec = TALER_EC_WALLET_CONTRACT_TERMS_MALFORMED,
2306 : .hint = gettext_noop ("The contract terms given by the merchant are malformed."),
2307 : .http_code = MHD_HTTP_UNINITIALIZED
2308 : },
2309 :
2310 : {
2311 : .ec = TALER_EC_WALLET_PENDING_OPERATION_FAILED,
2312 : .hint = gettext_noop ("A pending operation failed, and thus the request can't be completed."),
2313 : .http_code = MHD_HTTP_UNINITIALIZED
2314 : },
2315 :
2316 : {
2317 : .ec = TALER_EC_ANASTASIS_GENERIC_BACKEND_TIMEOUT,
2318 : .hint = gettext_noop ("We encountered a timeout with our payment backend."),
2319 : .http_code = MHD_HTTP_GATEWAY_TIMEOUT
2320 : },
2321 :
2322 : {
2323 : .ec = TALER_EC_ANASTASIS_GENERIC_INVALID_PAYMENT_REQUEST,
2324 : .hint = gettext_noop ("The backend requested payment, but the request is malformed."),
2325 : .http_code = MHD_HTTP_UNINITIALIZED
2326 : },
2327 :
2328 : {
2329 : .ec = TALER_EC_ANASTASIS_GENERIC_BACKEND_ERROR,
2330 : .hint = gettext_noop ("The backend got an unexpected reply from the payment processor."),
2331 : .http_code = MHD_HTTP_BAD_GATEWAY
2332 : },
2333 :
2334 : {
2335 : .ec = TALER_EC_ANASTASIS_GENERIC_MISSING_CONTENT_LENGTH,
2336 : .hint = gettext_noop ("The \"Content-length\" field for the upload is missing."),
2337 : .http_code = MHD_HTTP_BAD_REQUEST
2338 : },
2339 :
2340 : {
2341 : .ec = TALER_EC_ANASTASIS_GENERIC_MALFORMED_CONTENT_LENGTH,
2342 : .hint = gettext_noop ("The \"Content-length\" field for the upload is malformed."),
2343 : .http_code = MHD_HTTP_BAD_REQUEST
2344 : },
2345 :
2346 : {
2347 : .ec = TALER_EC_ANASTASIS_GENERIC_ORDER_CREATE_BACKEND_ERROR,
2348 : .hint = gettext_noop ("The backend failed to setup an order with the payment processor."),
2349 : .http_code = MHD_HTTP_BAD_GATEWAY
2350 : },
2351 :
2352 : {
2353 : .ec = TALER_EC_ANASTASIS_GENERIC_PAYMENT_CHECK_UNAUTHORIZED,
2354 : .hint = gettext_noop ("The backend was not authorized to check for payment with the payment processor."),
2355 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2356 : },
2357 :
2358 : {
2359 : .ec = TALER_EC_ANASTASIS_GENERIC_PAYMENT_CHECK_START_FAILED,
2360 : .hint = gettext_noop ("The backend could not check payment status with the payment processor."),
2361 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2362 : },
2363 :
2364 : {
2365 : .ec = TALER_EC_ANASTASIS_GENERIC_PROVIDER_UNREACHABLE,
2366 : .hint = gettext_noop ("The Anastasis provider could not be reached."),
2367 : .http_code = MHD_HTTP_UNINITIALIZED
2368 : },
2369 :
2370 : {
2371 : .ec = TALER_EC_ANASTASIS_PAYMENT_GENERIC_TIMEOUT,
2372 : .hint = gettext_noop ("HTTP server experienced a timeout while awaiting promised payment."),
2373 : .http_code = MHD_HTTP_REQUEST_TIMEOUT
2374 : },
2375 :
2376 : {
2377 : .ec = TALER_EC_ANASTASIS_TRUTH_UNKNOWN,
2378 : .hint = gettext_noop ("The key share is unknown to the provider."),
2379 : .http_code = MHD_HTTP_NOT_FOUND
2380 : },
2381 :
2382 : {
2383 : .ec = TALER_EC_ANASTASIS_TRUTH_AUTHORIZATION_METHOD_NO_LONGER_SUPPORTED,
2384 : .hint = gettext_noop ("The authorization method used for the key share is no longer supported by the provider."),
2385 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2386 : },
2387 :
2388 : {
2389 : .ec = TALER_EC_ANASTASIS_TRUTH_CHALLENGE_RESPONSE_REQUIRED,
2390 : .hint = gettext_noop ("The client needs to respond to the challenge."),
2391 : .http_code = MHD_HTTP_FORBIDDEN
2392 : },
2393 :
2394 : {
2395 : .ec = TALER_EC_ANASTASIS_TRUTH_CHALLENGE_FAILED,
2396 : .hint = gettext_noop ("The client's response to the challenge was invalid."),
2397 : .http_code = MHD_HTTP_FORBIDDEN
2398 : },
2399 :
2400 : {
2401 : .ec = TALER_EC_ANASTASIS_TRUTH_CHALLENGE_UNKNOWN,
2402 : .hint = gettext_noop ("The backend is not aware of having issued the provided challenge code. Either this is the wrong code, or it has expired."),
2403 : .http_code = MHD_HTTP_NOT_FOUND
2404 : },
2405 :
2406 : {
2407 : .ec = TALER_EC_ANASTASIS_TRUTH_AUTHORIZATION_START_FAILED,
2408 : .hint = gettext_noop ("The backend failed to initiate the authorization process."),
2409 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2410 : },
2411 :
2412 : {
2413 : .ec = TALER_EC_ANASTASIS_TRUTH_KEY_SHARE_GONE,
2414 : .hint = gettext_noop ("The authorization succeeded, but the key share is no longer available."),
2415 : .http_code = MHD_HTTP_NOT_FOUND
2416 : },
2417 :
2418 : {
2419 : .ec = TALER_EC_ANASTASIS_TRUTH_ORDER_DISAPPEARED,
2420 : .hint = gettext_noop ("The backend forgot the order we asked the client to pay for"),
2421 : .http_code = MHD_HTTP_BAD_GATEWAY
2422 : },
2423 :
2424 : {
2425 : .ec = TALER_EC_ANASTASIS_TRUTH_BACKEND_EXCHANGE_BAD,
2426 : .hint = gettext_noop ("The backend itself reported a bad exchange interaction."),
2427 : .http_code = MHD_HTTP_BAD_GATEWAY
2428 : },
2429 :
2430 : {
2431 : .ec = TALER_EC_ANASTASIS_TRUTH_UNEXPECTED_PAYMENT_STATUS,
2432 : .hint = gettext_noop ("The backend reported a payment status we did not expect."),
2433 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2434 : },
2435 :
2436 : {
2437 : .ec = TALER_EC_ANASTASIS_TRUTH_PAYMENT_CREATE_BACKEND_ERROR,
2438 : .hint = gettext_noop ("The backend failed to setup the order for payment."),
2439 : .http_code = MHD_HTTP_BAD_GATEWAY
2440 : },
2441 :
2442 : {
2443 : .ec = TALER_EC_ANASTASIS_TRUTH_DECRYPTION_FAILED,
2444 : .hint = gettext_noop ("The decryption of the key share failed with the provided key."),
2445 : .http_code = MHD_HTTP_BAD_REQUEST
2446 : },
2447 :
2448 : {
2449 : .ec = TALER_EC_ANASTASIS_TRUTH_RATE_LIMITED,
2450 : .hint = gettext_noop ("The request rate is too high. The server is refusing requests to guard against brute-force attacks."),
2451 : .http_code = MHD_HTTP_TOO_MANY_REQUESTS
2452 : },
2453 :
2454 : {
2455 : .ec = TALER_EC_ANASTASIS_TRUTH_CHALLENGE_WRONG_METHOD,
2456 : .hint = gettext_noop ("A request to issue a challenge is not valid for this authentication method."),
2457 : .http_code = MHD_HTTP_BAD_REQUEST
2458 : },
2459 :
2460 : {
2461 : .ec = TALER_EC_ANASTASIS_TRUTH_UPLOAD_UUID_EXISTS,
2462 : .hint = gettext_noop ("The backend failed to store the key share because the UUID is already in use."),
2463 : .http_code = MHD_HTTP_CONFLICT
2464 : },
2465 :
2466 : {
2467 : .ec = TALER_EC_ANASTASIS_TRUTH_UPLOAD_METHOD_NOT_SUPPORTED,
2468 : .hint = gettext_noop ("The backend failed to store the key share because the authorization method is not supported."),
2469 : .http_code = MHD_HTTP_BAD_REQUEST
2470 : },
2471 :
2472 : {
2473 : .ec = TALER_EC_ANASTASIS_SMS_PHONE_INVALID,
2474 : .hint = gettext_noop ("The provided phone number is not an acceptable number."),
2475 : .http_code = MHD_HTTP_CONFLICT
2476 : },
2477 :
2478 : {
2479 : .ec = TALER_EC_ANASTASIS_SMS_HELPER_EXEC_FAILED,
2480 : .hint = gettext_noop ("Failed to run the SMS transmission helper process."),
2481 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2482 : },
2483 :
2484 : {
2485 : .ec = TALER_EC_ANASTASIS_SMS_HELPER_COMMAND_FAILED,
2486 : .hint = gettext_noop ("Provider failed to send SMS. Helper terminated with a non-successful result."),
2487 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2488 : },
2489 :
2490 : {
2491 : .ec = TALER_EC_ANASTASIS_EMAIL_INVALID,
2492 : .hint = gettext_noop ("The provided email address is not an acceptable address."),
2493 : .http_code = MHD_HTTP_CONFLICT
2494 : },
2495 :
2496 : {
2497 : .ec = TALER_EC_ANASTASIS_EMAIL_HELPER_EXEC_FAILED,
2498 : .hint = gettext_noop ("Failed to run the E-mail transmission helper process."),
2499 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2500 : },
2501 :
2502 : {
2503 : .ec = TALER_EC_ANASTASIS_EMAIL_HELPER_COMMAND_FAILED,
2504 : .hint = gettext_noop ("Provider failed to send E-mail. Helper terminated with a non-successful result."),
2505 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2506 : },
2507 :
2508 : {
2509 : .ec = TALER_EC_ANASTASIS_POST_INVALID,
2510 : .hint = gettext_noop ("The provided postal address is not an acceptable address."),
2511 : .http_code = MHD_HTTP_CONFLICT
2512 : },
2513 :
2514 : {
2515 : .ec = TALER_EC_ANASTASIS_POST_HELPER_EXEC_FAILED,
2516 : .hint = gettext_noop ("Failed to run the mail transmission helper process."),
2517 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2518 : },
2519 :
2520 : {
2521 : .ec = TALER_EC_ANASTASIS_POST_HELPER_COMMAND_FAILED,
2522 : .hint = gettext_noop ("Provider failed to send mail. Helper terminated with a non-successful result."),
2523 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2524 : },
2525 :
2526 : {
2527 : .ec = TALER_EC_ANASTASIS_IBAN_INVALID,
2528 : .hint = gettext_noop ("The provided IBAN address is not an acceptable IBAN."),
2529 : .http_code = MHD_HTTP_CONFLICT
2530 : },
2531 :
2532 : {
2533 : .ec = TALER_EC_ANASTASIS_IBAN_MISSING_TRANSFER,
2534 : .hint = gettext_noop ("The provider has not yet received the IBAN wire transfer authorizing the disclosure of the key share."),
2535 : .http_code = MHD_HTTP_FORBIDDEN
2536 : },
2537 :
2538 : {
2539 : .ec = TALER_EC_ANASTASIS_TOTP_KEY_MISSING,
2540 : .hint = gettext_noop ("The backend did not find a TOTP key in the data provided."),
2541 : .http_code = MHD_HTTP_CONFLICT
2542 : },
2543 :
2544 : {
2545 : .ec = TALER_EC_ANASTASIS_TOTP_KEY_INVALID,
2546 : .hint = gettext_noop ("The key provided does not satisfy the format restrictions for an Anastasis TOTP key."),
2547 : .http_code = MHD_HTTP_CONFLICT
2548 : },
2549 :
2550 : {
2551 : .ec = TALER_EC_ANASTASIS_POLICY_BAD_IF_NONE_MATCH,
2552 : .hint = gettext_noop ("The given if-none-match header is malformed."),
2553 : .http_code = MHD_HTTP_BAD_REQUEST
2554 : },
2555 :
2556 : {
2557 : .ec = TALER_EC_ANASTASIS_POLICY_OUT_OF_MEMORY_ON_CONTENT_LENGTH,
2558 : .hint = gettext_noop ("The server is out of memory to handle the upload. Trying again later may succeed."),
2559 : .http_code = MHD_HTTP_PAYLOAD_TOO_LARGE
2560 : },
2561 :
2562 : {
2563 : .ec = TALER_EC_ANASTASIS_POLICY_BAD_SIGNATURE,
2564 : .hint = gettext_noop ("The signature provided in the \"Anastasis-Policy-Signature\" header is malformed or missing."),
2565 : .http_code = MHD_HTTP_BAD_REQUEST
2566 : },
2567 :
2568 : {
2569 : .ec = TALER_EC_ANASTASIS_POLICY_BAD_IF_MATCH,
2570 : .hint = gettext_noop ("The given if-match header is malformed."),
2571 : .http_code = MHD_HTTP_BAD_REQUEST
2572 : },
2573 :
2574 : {
2575 : .ec = TALER_EC_ANASTASIS_POLICY_INVALID_UPLOAD,
2576 : .hint = gettext_noop ("The uploaded data does not match the Etag."),
2577 : .http_code = MHD_HTTP_BAD_REQUEST
2578 : },
2579 :
2580 : {
2581 : .ec = TALER_EC_ANASTASIS_POLICY_NOT_FOUND,
2582 : .hint = gettext_noop ("The provider is unaware of the requested policy."),
2583 : .http_code = MHD_HTTP_NOT_FOUND
2584 : },
2585 :
2586 : {
2587 : .ec = TALER_EC_ANASTASIS_REDUCER_ACTION_INVALID,
2588 : .hint = gettext_noop ("The given action is invalid for the current state of the reducer."),
2589 : .http_code = MHD_HTTP_UNINITIALIZED
2590 : },
2591 :
2592 : {
2593 : .ec = TALER_EC_ANASTASIS_REDUCER_STATE_INVALID,
2594 : .hint = gettext_noop ("The given state of the reducer is invalid."),
2595 : .http_code = MHD_HTTP_UNINITIALIZED
2596 : },
2597 :
2598 : {
2599 : .ec = TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID,
2600 : .hint = gettext_noop ("The given input to the reducer is invalid."),
2601 : .http_code = MHD_HTTP_UNINITIALIZED
2602 : },
2603 :
2604 : {
2605 : .ec = TALER_EC_ANASTASIS_REDUCER_AUTHENTICATION_METHOD_NOT_SUPPORTED,
2606 : .hint = gettext_noop ("The selected authentication method does not work for the Anastasis provider."),
2607 : .http_code = MHD_HTTP_UNINITIALIZED
2608 : },
2609 :
2610 : {
2611 : .ec = TALER_EC_ANASTASIS_REDUCER_INPUT_INVALID_FOR_STATE,
2612 : .hint = gettext_noop ("The given input and action do not work for the current state."),
2613 : .http_code = MHD_HTTP_UNINITIALIZED
2614 : },
2615 :
2616 : {
2617 : .ec = TALER_EC_ANASTASIS_REDUCER_BACKEND_FAILURE,
2618 : .hint = gettext_noop ("We experienced an unexpected failure interacting with the backend."),
2619 : .http_code = MHD_HTTP_UNINITIALIZED
2620 : },
2621 :
2622 : {
2623 : .ec = TALER_EC_ANASTASIS_REDUCER_RESOURCE_MALFORMED,
2624 : .hint = gettext_noop ("The contents of a resource file did not match our expectations."),
2625 : .http_code = MHD_HTTP_UNINITIALIZED
2626 : },
2627 :
2628 : {
2629 : .ec = TALER_EC_ANASTASIS_REDUCER_RESOURCE_MISSING,
2630 : .hint = gettext_noop ("A required resource file is missing."),
2631 : .http_code = MHD_HTTP_UNINITIALIZED
2632 : },
2633 :
2634 : {
2635 : .ec = TALER_EC_ANASTASIS_REDUCER_INPUT_REGEX_FAILED,
2636 : .hint = gettext_noop ("An input did not match the regular expression."),
2637 : .http_code = MHD_HTTP_UNINITIALIZED
2638 : },
2639 :
2640 : {
2641 : .ec = TALER_EC_ANASTASIS_REDUCER_INPUT_VALIDATION_FAILED,
2642 : .hint = gettext_noop ("An input did not match the custom validation logic."),
2643 : .http_code = MHD_HTTP_UNINITIALIZED
2644 : },
2645 :
2646 : {
2647 : .ec = TALER_EC_ANASTASIS_REDUCER_POLICY_LOOKUP_FAILED,
2648 : .hint = gettext_noop ("Our attempts to download the recovery document failed with all providers. Most likely the personal information you entered differs from the information you provided during the backup process and you should go back to the previous step. Alternatively, if you used a backup provider that is unknown to this application, you should add that provider manually."),
2649 : .http_code = MHD_HTTP_UNINITIALIZED
2650 : },
2651 :
2652 : {
2653 : .ec = TALER_EC_ANASTASIS_REDUCER_BACKUP_PROVIDER_FAILED,
2654 : .hint = gettext_noop ("Anastasis provider reported a fatal failure."),
2655 : .http_code = MHD_HTTP_UNINITIALIZED
2656 : },
2657 :
2658 : {
2659 : .ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_CONFIG_FAILED,
2660 : .hint = gettext_noop ("Anastasis provider failed to respond to the configuration request."),
2661 : .http_code = MHD_HTTP_UNINITIALIZED
2662 : },
2663 :
2664 : {
2665 : .ec = TALER_EC_ANASTASIS_REDUCER_POLICY_MALFORMED,
2666 : .hint = gettext_noop ("The policy we downloaded is malformed. Must have been a client error while creating the backup."),
2667 : .http_code = MHD_HTTP_UNINITIALIZED
2668 : },
2669 :
2670 : {
2671 : .ec = TALER_EC_ANASTASIS_REDUCER_NETWORK_FAILED,
2672 : .hint = gettext_noop ("We failed to obtain the policy, likely due to a network issue."),
2673 : .http_code = MHD_HTTP_UNINITIALIZED
2674 : },
2675 :
2676 : {
2677 : .ec = TALER_EC_ANASTASIS_REDUCER_SECRET_MALFORMED,
2678 : .hint = gettext_noop ("The recovered secret did not match the required syntax."),
2679 : .http_code = MHD_HTTP_UNINITIALIZED
2680 : },
2681 :
2682 : {
2683 : .ec = TALER_EC_ANASTASIS_REDUCER_CHALLENGE_DATA_TOO_BIG,
2684 : .hint = gettext_noop ("The challenge data provided is too large for the available providers."),
2685 : .http_code = MHD_HTTP_UNINITIALIZED
2686 : },
2687 :
2688 : {
2689 : .ec = TALER_EC_ANASTASIS_REDUCER_SECRET_TOO_BIG,
2690 : .hint = gettext_noop ("The provided core secret is too large for some of the providers."),
2691 : .http_code = MHD_HTTP_UNINITIALIZED
2692 : },
2693 :
2694 : {
2695 : .ec = TALER_EC_ANASTASIS_REDUCER_PROVIDER_INVALID_CONFIG,
2696 : .hint = gettext_noop ("The provider returned in invalid configuration."),
2697 : .http_code = MHD_HTTP_UNINITIALIZED
2698 : },
2699 :
2700 : {
2701 : .ec = TALER_EC_ANASTASIS_REDUCER_INTERNAL_ERROR,
2702 : .hint = gettext_noop ("The reducer encountered an internal error, likely a bug that needs to be reported."),
2703 : .http_code = MHD_HTTP_UNINITIALIZED
2704 : },
2705 :
2706 : {
2707 : .ec = TALER_EC_ANASTASIS_REDUCER_PROVIDERS_ALREADY_SYNCED,
2708 : .hint = gettext_noop ("The reducer already synchronized with all providers."),
2709 : .http_code = MHD_HTTP_UNINITIALIZED
2710 : },
2711 :
2712 : {
2713 : .ec = TALER_EC_LIBEUFIN_NEXUS_GENERIC_ERROR,
2714 : .hint = gettext_noop ("A generic error happened in the LibEuFin nexus. See the enclose details JSON for more information."),
2715 : .http_code = MHD_HTTP_UNINITIALIZED
2716 : },
2717 :
2718 : {
2719 : .ec = TALER_EC_LIBEUFIN_NEXUS_UNCAUGHT_EXCEPTION,
2720 : .hint = gettext_noop ("An uncaught exception happened in the LibEuFin nexus service."),
2721 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2722 : },
2723 :
2724 : {
2725 : .ec = TALER_EC_LIBEUFIN_SANDBOX_GENERIC_ERROR,
2726 : .hint = gettext_noop ("A generic error happened in the LibEuFin sandbox. See the enclose details JSON for more information."),
2727 : .http_code = MHD_HTTP_UNINITIALIZED
2728 : },
2729 :
2730 : {
2731 : .ec = TALER_EC_LIBEUFIN_SANDBOX_UNCAUGHT_EXCEPTION,
2732 : .hint = gettext_noop ("An uncaught exception happened in the LibEuFin sandbox service."),
2733 : .http_code = MHD_HTTP_INTERNAL_SERVER_ERROR
2734 : },
2735 :
2736 : {
2737 : .ec = TALER_EC_TALDIR_METHOD_NOT_SUPPORTED,
2738 : .hint = gettext_noop ("This validation method is not supported by the service."),
2739 : .http_code = MHD_HTTP_NOT_FOUND
2740 : },
2741 :
2742 : {
2743 : .ec = TALER_EC_TALDIR_REGISTER_RATE_LIMITED,
2744 : .hint = gettext_noop ("Number of allowed attempts for initiating a challenge exceeded."),
2745 : .http_code = MHD_HTTP_TOO_MANY_REQUESTS
2746 : },
2747 :
2748 : {
2749 : .ec = TALER_EC_END,
2750 : .hint = gettext_noop ("End of error code range."),
2751 : .http_code = MHD_HTTP_UNINITIALIZED
2752 : },
2753 :
2754 :
2755 : };
2756 :
2757 :
2758 : /**
2759 : * The length of @e code_hint_pairs.
2760 : */
2761 : static const unsigned int code_hint_pairs_length = 449;
2762 :
2763 :
2764 :
2765 : const char *
2766 2 : TALER_ErrorCode_get_hint (enum TALER_ErrorCode ec)
2767 : {
2768 2 : unsigned int lower = 0;
2769 2 : unsigned int upper = code_hint_pairs_length - 1;
2770 2 : unsigned int mid = upper / 2;
2771 17 : while (lower <= upper)
2772 : {
2773 17 : mid = (upper + lower) / 2;
2774 17 : if (code_hint_pairs[mid].ec < ec)
2775 : {
2776 12 : lower = mid + 1;
2777 : }
2778 5 : else if (code_hint_pairs[mid].ec > ec)
2779 : {
2780 3 : upper = mid - 1;
2781 : }
2782 : else
2783 : {
2784 2 : return code_hint_pairs[mid].hint;
2785 : }
2786 : }
2787 0 : return "<no hint found>";
2788 : }
2789 :
2790 :
2791 : unsigned int
2792 0 : TALER_ErrorCode_get_http_status (enum TALER_ErrorCode ec)
2793 : {
2794 0 : unsigned int lower = 0;
2795 0 : unsigned int upper = code_hint_pairs_length - 1;
2796 0 : unsigned int mid = upper / 2;
2797 0 : while (lower <= upper)
2798 : {
2799 0 : mid = (upper + lower) / 2;
2800 0 : if (code_hint_pairs[mid].ec < ec)
2801 : {
2802 0 : lower = mid + 1;
2803 : }
2804 0 : else if (code_hint_pairs[mid].ec > ec)
2805 : {
2806 0 : upper = mid - 1;
2807 : }
2808 : else
2809 : {
2810 0 : return code_hint_pairs[mid].http_code;
2811 : }
2812 : }
2813 0 : return UINT_MAX;
2814 : }
2815 :
2816 :
2817 : unsigned int
2818 0 : TALER_ErrorCode_get_http_status_safe (enum TALER_ErrorCode ec)
2819 : {
2820 : unsigned int hc;
2821 :
2822 0 : hc = TALER_ErrorCode_get_http_status (ec);
2823 0 : if ( (0 == hc) ||
2824 : (UINT_MAX == hc) )
2825 0 : return MHD_HTTP_INTERNAL_SERVER_ERROR;
2826 0 : return hc;
2827 : }
|