diff options
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx | 25 | ||||
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx | 2 |
2 files changed, 15 insertions, 12 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx index 1d08c5058..8b583308f 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx @@ -118,8 +118,21 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { setImporting(false); }} onConfirm={(ac) => { - state.payto_uri = ac.accountURI; const u = new URL(ac.infoURL); + const user = u.username + const pwd = u.password + u.password = ""; + u.username = ""; + const credit_facade_url = u.href; + setState({ + payto_uri: ac.accountURI, + credit_facade_credentials: user || pwd ? { + type: "basic", + password: pwd, + username: user, + }: undefined, + credit_facade_url, + }) // if (u.username && ac.accesToken) { // state.credit_facade_credentials = { // type: "bearer", @@ -127,16 +140,6 @@ export function CreatePage({ onCreate, onBack }: Props): VNode { // username: u.username, // }; // } else - if (u.username || u.password) { - state.credit_facade_credentials = { - type: "basic", - password: u.password, - username: u.username, - }; - } - u.password = ""; - u.username = ""; - state.credit_facade_url = u.href; setImporting(false); }} /> diff --git a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx index aa1481a2e..7abff255c 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx @@ -111,7 +111,7 @@ export default function CreateValidator({ onConfirm, onBack }: Props): VNode { setNotif({ message: i18n.str`Could not add bank account`, type: "ERROR", - description: i18n.str`The account info URL returned information from an account which is not the same in the account form: ${resp.detail.hint}`, + description: i18n.str`The account info URL returned information from an account which is not the same in the account form: ${resp.detail.hint} and ${request.payto_uri}`, }); return; } |