taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 049ecb4d04139f0d14d11d0a3cb5b5d289b32485
parent b08e8704036f3fd69d1361b25c3931d00ecdac1f
Author: Sebastian <sebasjm@taler-systems.com>
Date:   Wed, 10 Dec 2025 15:07:00 -0300

add refund detaul for creation

Diffstat:
Mpackages/merchant-backoffice-ui/src/components/SolveMFA.tsx | 2+-
Mpackages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx | 21++++++++++-----------
Mpackages/merchant-backoffice-ui/src/paths/instance/password/index.tsx | 4++--
Mpackages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/create/CreatePage.tsx | 2+-
Mpackages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/list/index.tsx | 2+-
Mpackages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/update/UpdatePage.tsx | 2+-
Mpackages/merchant-backoffice-ui/src/paths/instance/update/DeletePage.tsx | 2+-
Mpackages/merchant-backoffice-ui/src/paths/login/index.tsx | 4++--
Mpackages/merchant-backoffice-ui/src/settings.json | 2+-
9 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/packages/merchant-backoffice-ui/src/components/SolveMFA.tsx b/packages/merchant-backoffice-ui/src/components/SolveMFA.tsx @@ -437,7 +437,7 @@ export function SolveMFAChallenges({ <i18n.Translate>Cancel</i18n.Translate> </button> <ButtonBetterBulma type="is-info" onClick={doComplete}> - <i18n.Translate>Complete</i18n.Translate> + <i18n.Translate context="multi-factor challenge">Complete</i18n.Translate> </ButtonBetterBulma> </footer> </div> diff --git a/packages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/admin/create/CreatePage.tsx @@ -71,23 +71,25 @@ export interface Props { } const twoHours = Duration.fromSpec({ hours: 2 }); +const oneDay = Duration.fromSpec({ days: 1 }); const twoDays = Duration.fromSpec({ days: 2 }); -function with_defaults(id?: string): Partial<Entity> { +function with_defaults(id: string | undefined, config: TalerMerchantApi.MerchantVersionResponse): Partial<Entity> { return { id, use_stefan: true, - default_pay_delay: Duration.toTalerProtocolDuration(twoHours), - default_wire_transfer_delay: Duration.toTalerProtocolDuration(twoDays), + default_pay_delay: config.default_pay_delay ?? Duration.toTalerProtocolDuration(twoHours), + default_refund_delay: config.default_refund_delay ?? Duration.toTalerProtocolDuration(oneDay), + default_wire_transfer_delay: config.default_wire_transfer_delay ?? Duration.toTalerProtocolDuration(twoDays), }; } -// type TokenForm = { }; - export function CreatePage({ onConfirm, onBack, forceId }: Props): VNode { - const [pref, updatePref] = usePreference(); const { i18n } = useTranslationContext(); - const [value, valueHandler] = useState(with_defaults(forceId)); + const { state: session, lib, logIn, config } = useSessionContext(); + const [value, valueHandler] = useState(with_defaults(forceId, config)); + const [notification, safeFunctionHandler] = useLocalNotificationBetter(); + const mfa = useChallengeHandler(); const errors = undefinedIfEmpty<FormErrors<Entity>>({ id: !value.id @@ -144,9 +146,6 @@ export function CreatePage({ onConfirm, onBack, forceId }: Props): VNode { }); const hasErrors = errors !== undefined; - const [notification, safeFunctionHandler] = useLocalNotificationBetter(); - const { state: session, lib, logIn } = useSessionContext(); - const mfa = useChallengeHandler(); const data: TalerMerchantApi.InstanceConfigurationMessage = { ...(value as TalerMerchantApi.InstanceConfigurationMessage), @@ -196,7 +195,7 @@ export function CreatePage({ onConfirm, onBack, forceId }: Props): VNode { mfa.onChallengeRequired(fail.body); return i18n.str`Second factor authentication required.`; case HttpStatusCode.Unauthorized: - return i18n.str`Unaouthorized.`; + return i18n.str`Unauthorized.`; case HttpStatusCode.Conflict: return i18n.str`Conflict.`; case HttpStatusCode.NotFound: diff --git a/packages/merchant-backoffice-ui/src/paths/instance/password/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/password/index.tsx @@ -94,7 +94,7 @@ export default function PasswordPage({ onCancel, onChange }: Props): VNode { mfa.onChallengeRequired(fail.body); return i18n.str`Second factor authentication required.`; case HttpStatusCode.Unauthorized: - return i18n.str`Unaouthorized.`; + return i18n.str`Unauthorized.`; case HttpStatusCode.NotFound: return i18n.str`Not found.`; } @@ -184,7 +184,7 @@ export function AdminPassword({ mfa.onChallengeRequired(fail.body); return i18n.str`Second factor authentication required.`; case HttpStatusCode.Unauthorized: - return i18n.str`Unaouthorized.`; + return i18n.str`Unauthorized.`; case HttpStatusCode.NotFound: return i18n.str`Not found.`; } diff --git a/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/create/CreatePage.tsx @@ -93,7 +93,7 @@ export function CreatePage({ onCreated, onBack }: Props): VNode { create.onFail = (fail) => { switch (fail.case) { case HttpStatusCode.Unauthorized: - return i18n.str`Unaouthorized`; + return i18n.str`Unauthorized`; case HttpStatusCode.NotFound: return i18n.str`Not found`; } diff --git a/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/list/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/list/index.tsx @@ -88,7 +88,7 @@ export default function TokenFamilyList({ onCreate, onSelect }: Props): VNode { remove.onFail = (fail) => { switch (fail.case) { case HttpStatusCode.Unauthorized: - return i18n.str`Unaouthorized`; + return i18n.str`Unauthorized`; case HttpStatusCode.NotFound: return i18n.str`Not found`; } diff --git a/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/update/UpdatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/tokenfamilies/update/UpdatePage.tsx @@ -73,7 +73,7 @@ export function UpdatePage({ onUpdated, onBack, tokenFamily }: Props) { update.onFail = (fail) => { switch (fail.case) { case HttpStatusCode.Unauthorized: - return i18n.str`Unaouthorized`; + return i18n.str`Unauthorized`; case HttpStatusCode.NotFound: return i18n.str`Not found`; } diff --git a/packages/merchant-backoffice-ui/src/paths/instance/update/DeletePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/update/DeletePage.tsx @@ -91,7 +91,7 @@ export function DeletePage({ instanceId, onBack, onDeleted }: Props): VNode { ); return i18n.str`Second factor authentication required.`; case HttpStatusCode.Unauthorized: - return i18n.str`Unaouthorized.`; + return i18n.str`Unauthorized.`; case HttpStatusCode.NotFound: return i18n.str`Not found.`; case HttpStatusCode.Conflict: diff --git a/packages/merchant-backoffice-ui/src/paths/login/index.tsx b/packages/merchant-backoffice-ui/src/paths/login/index.tsx @@ -144,7 +144,7 @@ export function LoginPage({ showCreateAccount }: Props): VNode { <input class="input" type="text" - placeholder={"instance name"} + placeholder={i18n.str`instance name`} name="username" onKeyPress={(e) => e.keyCode === 13 ? login.call() : null @@ -170,7 +170,7 @@ export function LoginPage({ showCreateAccount }: Props): VNode { <input class="input" type="password" - placeholder={"current password"} + placeholder={i18n.str`current password`} name="token" onKeyPress={(e) => e.keyCode === 13 ? login.call() : null diff --git a/packages/merchant-backoffice-ui/src/settings.json b/packages/merchant-backoffice-ui/src/settings.json @@ -1,4 +1,4 @@ { - "backendBaseURL": "http://merchant.taler.test/", + "backendBaseURL": "https://merchant.taler.test/", "supportedWireMethods": ["iban"] }