{pageState.error.title}
{pageState.error.description}
{pageState.info}
{
submitDataSetter((submitData: any) => ({
...submitData,
iban: e.currentTarget.value,
}));
}}
/>
{
submitDataSetter((submitData: any) => ({
...submitData,
subject: e.currentTarget.value,
}));
}}
/>
{
submitDataSetter((submitData: any) => ({
...submitData,
amount: e.currentTarget.value,
}));
}}
/>
{ if ( typeof submitData === "undefined" || typeof submitData.iban === "undefined" || submitData.iban === "" || typeof submitData.subject === "undefined" || submitData.subject === "" || typeof submitData.amount === "undefined" || submitData.amount === "" ) { console.log("Not all the fields were given."); pageStateSetter((prevState: PageStateType) => ({ ...prevState, error: { title: i18n`Field(s) missing.`, }, })); return; } transactionData = { paytoUri: `payto://iban/${ submitData.iban }?message=${encodeURIComponent(submitData.subject)}`, amount: `${currency}:${submitData.amount}`, }; return await createTransactionCall( transactionData, backendState, pageStateSetter, () => submitDataSetter((p) => ({ amount: undefined, iban: undefined, subject: undefined, })), ); }} /> { submitDataSetter((p) => ({ amount: undefined, iban: undefined, subject: undefined, })); }} />
{i18n`Transfer money to account identified by payto:// URI:`}
{
rawPaytoInputSetter(e.currentTarget.value);
}}
/>
payto://iban/[receiver-iban]?message=[subject]&amount=[{currency}
:X.Y]
{ // empty string evaluates to false. if (!rawPaytoInput) { console.log("Didn't get any raw Payto string!"); return; } transactionData = { paytoUri: rawPaytoInput }; if ( typeof transactionData.paytoUri === "undefined" || transactionData.paytoUri.length === 0 ) return; return await createTransactionCall( transactionData, backendState, pageStateSetter, () => rawPaytoInputSetter(undefined), ); }} />
{i18n`Use this QR code to withdraw to your mobile wallet:`}
{QR({ text: talerWithdrawUri })}Click {i18n`this link`}{" "} to open your Taler wallet!
{i18n`Waiting the bank to create the operation...`}
; /** * Wallet didn't communicate withdrawal details yet: */ console.log("withdrawal status", data); if (data.aborted) pageStateSetter((prevState: PageStateType) => { const { withdrawalId, talerWithdrawUri, ...rest } = prevState; return { ...rest, withdrawalInProgress: false, error: { title: i18n`This withdrawal was aborted!`, }, }; }); if (!data.selection_done) { return ({ // FIXME: validate using 'parseAmount()', // deactivate submit button as long as // amount is not valid submitAmount = e.currentTarget.value; }} />
Transactions page {pageNumber} was not found.
; } case 401: { returnWrong credentials given.
; } default: { returnTransaction page {pageNumber} could not be retrieved.
; } } } if (!data) { console.log(`History data of ${accountLabel} not arrived`); returnTransactions page loading...
; } console.log(`History data of ${accountLabel}`, data); return ({i18n`Date`} | {i18n`Amount`} | {i18n`Counterpart`} | {i18n`Subject`} |
---|---|---|---|
{date} | {sign} {item.amount} {item.currency} | {counterpart} | {item.subject} |
Profile not found...
; } case HttpStatusCode.Unauthorized: case HttpStatusCode.Forbidden: { setPageState((prevState: PageStateType) => ({ ...prevState, isLoggedIn: false, error: { title: i18n`Wrong credentials given.`, }, })); returnWrong credentials...
; } default: { setPageState((prevState: PageStateType) => ({ ...prevState, isLoggedIn: false, error: { title: i18n`Account information could not be retrieved.`, debug: JSON.stringify(error), }, })); returnUnknown problem...
; } } } if (!data) returnRetrieving the profile page...
; /** * This block shows the withdrawal QR code. * * A withdrawal operation replaces everything in the page and * (ToDo:) starts polling the backend until either the wallet * selected a exchange and reserve public key, or a error / abort * happened. * * After reaching one of the above states, the user should be * brought to this ("Account") page where they get informed about * the outcome. */ console.log(`maybe new withdrawal ${talerWithdrawUri}`); if (talerWithdrawUri) { console.log("Bank created a new Taler withdrawal"); return (Waiting public accounts list...
; const txs: any = {}; const accountsBar = []; /** * Show the account specified in the props, or just one * from the list if that's not given. */ if (typeof showAccount === "undefined" && data.publicAccounts.length > 0) setShowAccount(data.publicAccounts[1].accountLabel); console.log(`Public history tab: ${showAccount}`); // Ask story of all the public accounts. for (const account of data.publicAccounts) { console.log("Asking transactions for", account.accountLabel); const isSelected = account.accountLabel == showAccount; accountsBar.push({i18n`Currently, the bank is not accepting new registrations!`}
Error: waiting for details...
; } console.log("Showing the profile page.."); return (