diff options
author | Sebastian <sebasjm@gmail.com> | 2023-12-13 14:24:33 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-12-13 14:24:33 -0300 |
commit | 145c36e9ba549b7ccc72a29eaf102879011060a4 (patch) | |
tree | 3097fb8091f62b26026fe6cb90194fce3e97e99f /packages/taler-util | |
parent | c29d3e6c94861cd9afd743e9391cd60b382d1ee4 (diff) | |
download | wallet-core-145c36e9ba549b7ccc72a29eaf102879011060a4.tar.xz |
up to date with latest libeufin api
Diffstat (limited to 'packages/taler-util')
-rw-r--r-- | packages/taler-util/src/http-client/bank-core.ts | 3 | ||||
-rw-r--r-- | packages/taler-util/src/http-client/types.ts | 17 | ||||
-rw-r--r-- | packages/taler-util/src/taler-error-codes.ts | 16 |
3 files changed, 27 insertions, 9 deletions
diff --git a/packages/taler-util/src/http-client/bank-core.ts b/packages/taler-util/src/http-client/bank-core.ts index 2b67fc638..51d6d7c96 100644 --- a/packages/taler-util/src/http-client/bank-core.ts +++ b/packages/taler-util/src/http-client/bank-core.ts @@ -160,9 +160,10 @@ export class TalerCoreBankHttpClient { const body = await resp.json() const details = codecForTalerErrorDetail().decode(body) switch (details.code) { - case TalerErrorCode.BANK_PATCH_ADMIN_EXCHANGE: return opKnownFailure("admin-cant-be-exchange", resp); case TalerErrorCode.BANK_NON_ADMIN_PATCH_LEGAL_NAME: return opKnownFailure("user-cant-change-name", resp); case TalerErrorCode.BANK_NON_ADMIN_PATCH_DEBT_LIMIT: return opKnownFailure("user-cant-change-debt", resp); + case TalerErrorCode.BANK_NON_ADMIN_PATCH_CASHOUT: return opKnownFailure("user-cant-change-cashout", resp); + case TalerErrorCode.BANK_NON_ADMIN_PATCH_CONTACT: return opKnownFailure("user-cant-change-contact", resp); default: return opUnknownFailure(resp, body) } } diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts index efff7bb0a..b0d4deca1 100644 --- a/packages/taler-util/src/http-client/types.ts +++ b/packages/taler-util/src/http-client/types.ts @@ -1477,22 +1477,23 @@ export namespace TalerCorebankApi { // If missing, cashouts will fail. // In the future, might be used for other transactions // as well. + // Only admin can change this property. contact_data?: ChallengeContactData; - // 'payto' address pointing a bank account - // external to the libeufin-bank. + // 'payto' URI of a fiat bank account. // Payments will be sent to this bank account - // when the user wants to convert the local currency - // back to fiat currency outside libeufin-bank. + // when the user wants to convert the regional currency + // back to fiat currency outside bank. + // Only admin can change this property if not allowed in config cashout_payto_uri?: PaytoString; + // If present, change the legal name associated with $username. + // Only admin can change this property if not allowed in config + name?: string; + // Make this account visible to anyone? is_public?: boolean; - // Legal name associated with $username. - // When missing, the old name is kept. - name?: string; - // If present, change the max debit allowed for this user // Only admin can change this property. debit_threshold?: AmountString; diff --git a/packages/taler-util/src/taler-error-codes.ts b/packages/taler-util/src/taler-error-codes.ts index 694adff8f..5b72ae7ec 100644 --- a/packages/taler-util/src/taler-error-codes.ts +++ b/packages/taler-util/src/taler-error-codes.ts @@ -3473,6 +3473,22 @@ export enum TalerErrorCode { /** + * A non-admin user has tried to change their cashout account. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + BANK_NON_ADMIN_PATCH_CASHOUT = 5140, + + + /** + * A non-admin user has tried to change their contact info. + * Returned with an HTTP status code of #MHD_HTTP_CONFLICT (409). + * (A value of 0 indicates that the error is generated client-side). + */ + BANK_NON_ADMIN_PATCH_CONTACT = 5141, + + + /** * The sync service failed find the account in its database. * Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND (404). * (A value of 0 indicates that the error is generated client-side). |