aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-05-07 12:14:26 -0300
committerSebastian <sebasjm@gmail.com>2024-05-07 12:14:26 -0300
commit6fd830ad57fe12ce6acac453f523dcf00f71a5bb (patch)
tree04df66b7fb848f787f04d2a01284ad51a0c62ac4 /packages
parent7b78c1350cfe49e06ce31ed076f69aa9dfac3490 (diff)
downloadwallet-core-6fd830ad57fe12ce6acac453f523dcf00f71a5bb.tar.xz
fix error code placement
Diffstat (limited to 'packages')
-rw-r--r--packages/bank-ui/src/pages/PaytoWireTransferForm.tsx9
-rw-r--r--packages/taler-util/src/http-client/bank-core.ts5
-rw-r--r--packages/taler-util/src/http-client/types.ts170
3 files changed, 4 insertions, 180 deletions
diff --git a/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx
index 157e1c3a9..dfea7166b 100644
--- a/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx
+++ b/packages/bank-ui/src/pages/PaytoWireTransferForm.tsx
@@ -244,15 +244,6 @@ export function PaytoWireTransferForm({
debug: resp.detail,
when: AbsoluteTime.now(),
});
- case TalerErrorCode.BANK_CONVERSION_AMOUNT_TO_SMALL: {
- return notify({
- type: "error",
- title: i18n.str`The amount is less than the minimum allowed.`,
- description: resp.detail.hint as TranslatedString,
- debug: resp.detail,
- when: AbsoluteTime.now(),
- });
- }
case HttpStatusCode.NotFound:
return notify({
type: "error",
diff --git a/packages/taler-util/src/http-client/bank-core.ts b/packages/taler-util/src/http-client/bank-core.ts
index 50a5cbc5b..6c8051ada 100644
--- a/packages/taler-util/src/http-client/bank-core.ts
+++ b/packages/taler-util/src/http-client/bank-core.ts
@@ -511,7 +511,6 @@ export class TalerCoreBankHttpClient {
| OperationFail<HttpStatusCode.Unauthorized>
| OperationFail<TalerErrorCode.BANK_UNALLOWED_DEBIT>
| OperationFail<TalerErrorCode.BANK_ADMIN_CREDITOR>
- | OperationFail<TalerErrorCode.BANK_CONVERSION_AMOUNT_TO_SMALL>
| OperationFail<TalerErrorCode.BANK_SAME_ACCOUNT>
| OperationFail<TalerErrorCode.BANK_UNKNOWN_CREDITOR>
| OperationFail<TalerErrorCode.BANK_TRANSFER_REQUEST_UID_REUSED>
@@ -552,8 +551,6 @@ export class TalerCoreBankHttpClient {
return opKnownTalerFailure(details.code, details);
case TalerErrorCode.BANK_UNKNOWN_CREDITOR:
return opKnownTalerFailure(details.code, details);
- case TalerErrorCode.BANK_CONVERSION_AMOUNT_TO_SMALL:
- return opKnownTalerFailure(details.code, details);
case TalerErrorCode.BANK_UNALLOWED_DEBIT:
return opKnownTalerFailure(details.code, details);
case TalerErrorCode.BANK_TRANSFER_REQUEST_UID_REUSED:
@@ -759,6 +756,8 @@ export class TalerCoreBankHttpClient {
switch (details.code) {
case TalerErrorCode.BANK_TRANSFER_REQUEST_UID_REUSED:
return opKnownTalerFailure(details.code, details);
+ case TalerErrorCode.BANK_CONVERSION_AMOUNT_TO_SMALL:
+ return opKnownTalerFailure(details.code, details);
case TalerErrorCode.BANK_BAD_CONVERSION:
return opKnownTalerFailure(details.code, details);
case TalerErrorCode.BANK_UNALLOWED_DEBIT:
diff --git a/packages/taler-util/src/http-client/types.ts b/packages/taler-util/src/http-client/types.ts
index 3b1fff9f1..c0004a218 100644
--- a/packages/taler-util/src/http-client/types.ts
+++ b/packages/taler-util/src/http-client/types.ts
@@ -1038,6 +1038,7 @@ export const codecForAccountMinimalData =
.property("name", codecForString())
.property("payto_uri", codecForPaytoString())
.property("balance", codecForBalance())
+ .property("row_id", codecForNumber())
.property("debit_threshold", codecForAmountString())
.property("min_cashout", codecOptional(codecForAmountString()))
.property("is_public", codecForBoolean())
@@ -1411,7 +1412,7 @@ export const codecForAddIncomingResponse =
export const codecForAmlRecords = (): Codec<TalerExchangeApi.AmlRecords> =>
buildCodecForObject<TalerExchangeApi.AmlRecords>()
.property("records", codecForList(codecForAmlRecord()))
- .build("TalerExchangeApi.PublicAccountsResponse");
+ .build("TalerExchangeApi.AmlRecords");
export const codecForAmlRecord = (): Codec<TalerExchangeApi.AmlRecord> =>
buildCodecForObject<TalerExchangeApi.AmlRecord>()
@@ -4463,173 +4464,6 @@ export namespace TalerMerchantApi {
confirmed?: boolean;
}
- interface ReserveCreateRequest {
- // Amount that the merchant promises to put into the reserve.
- initial_balance: AmountString;
-
- // Exchange the merchant intends to use for rewards.
- exchange_url: string;
-
- // Desired wire method, for example "iban" or "x-taler-bank".
- wire_method: string;
- }
- interface ReserveCreateConfirmation {
- // Public key identifying the reserve.
- reserve_pub: EddsaPublicKey;
-
- // Wire accounts of the exchange where to transfer the funds.
- accounts: TalerExchangeApi.WireAccount[];
- }
-
- interface RewardReserveStatus {
- // Array of all known reserves (possibly empty!).
- reserves: ReserveStatusEntry[];
- }
- interface ReserveStatusEntry {
- // Public key of the reserve.
- reserve_pub: EddsaPublicKey;
-
- // Timestamp when it was established.
- creation_time: Timestamp;
-
- // Timestamp when it expires.
- expiration_time: Timestamp;
-
- // Initial amount as per reserve creation call.
- merchant_initial_amount: AmountString;
-
- // Initial amount as per exchange, 0 if exchange did
- // not confirm reserve creation yet.
- exchange_initial_amount: AmountString;
-
- // Amount picked up so far.
- pickup_amount: AmountString;
-
- // Amount approved for rewards that exceeds the pickup_amount.
- committed_amount: AmountString;
-
- // Is this reserve active (false if it was deleted but not purged)?
- active: boolean;
- }
-
- interface ReserveDetail {
- // Timestamp when it was established.
- creation_time: Timestamp;
-
- // Timestamp when it expires.
- expiration_time: Timestamp;
-
- // Initial amount as per reserve creation call.
- merchant_initial_amount: AmountString;
-
- // Initial amount as per exchange, 0 if exchange did
- // not confirm reserve creation yet.
- exchange_initial_amount: AmountString;
-
- // Amount picked up so far.
- pickup_amount: AmountString;
-
- // Amount approved for rewards that exceeds the pickup_amount.
- committed_amount: AmountString;
-
- // Array of all rewards created by this reserves (possibly empty!).
- // Only present if asked for explicitly.
- rewards?: RewardStatusEntry[];
-
- // Is this reserve active (false if it was deleted but not purged)?
- active: boolean;
-
- // Array of wire accounts of the exchange that could
- // be used to fill the reserve, can be NULL
- // if the reserve is inactive or was already filled
- accounts?: TalerExchangeApi.WireAccount[];
-
- // URL of the exchange hosting the reserve,
- // NULL if the reserve is inactive
- exchange_url: string;
- }
- interface RewardStatusEntry {
- // Unique identifier for the reward.
- reward_id: HashCode;
-
- // Total amount of the reward that can be withdrawn.
- total_amount: AmountString;
-
- // Human-readable reason for why the reward was granted.
- reason: string;
- }
-
- interface RewardCreateRequest {
- // Amount that the customer should be rewarded.
- amount: AmountString;
-
- // Justification for giving the reward.
- justification: string;
-
- // URL that the user should be directed to after receiving the reward,
- // will be included in the reward_token.
- next_url: string;
- }
- interface RewardCreateConfirmation {
- // Unique reward identifier for the reward that was created.
- reward_id: HashCode;
-
- // taler://reward URI for the reward.
- taler_reward_uri: string;
-
- // URL that will directly trigger processing
- // the reward when the browser is redirected to it.
- reward_status_url: string;
-
- // When does the reward expire?
- reward_expiration: Timestamp;
- }
-
- interface RewardDetails {
- // Amount that we authorized for this reward.
- total_authorized: AmountString;
-
- // Amount that was picked up by the user already.
- total_picked_up: AmountString;
-
- // Human-readable reason given when authorizing the reward.
- reason: string;
-
- // Timestamp indicating when the reward is set to expire (may be in the past).
- expiration: Timestamp;
-
- // Reserve public key from which the reward is funded.
- reserve_pub: EddsaPublicKey;
-
- // Array showing the pickup operations of the wallet (possibly empty!).
- // Only present if asked for explicitly.
- pickups?: PickupDetail[];
- }
- interface PickupDetail {
- // Unique identifier for the pickup operation.
- pickup_id: HashCode;
-
- // Number of planchets involved.
- num_planchets: Integer;
-
- // Total amount requested for this pickup_id.
- requested_amount: AmountString;
- }
-
- interface RewardsResponse {
- // List of rewards that are present in the backend.
- rewards: Reward[];
- }
- interface Reward {
- // ID of the reward in the backend database.
- row_id: number;
-
- // Unique identifier for the reward.
- reward_id: HashCode;
-
- // (Remaining) amount of the reward (including fees).
- reward_amount: AmountString;
- }
export interface OtpDeviceAddDetails {
// Device ID to use.