aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/src/paths/instance
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-06-13 15:23:31 -0300
committerSebastian <sebasjm@gmail.com>2024-06-13 15:23:40 -0300
commit4f7eac1af8704d11fb3f58650558f932791f3d8e (patch)
tree08b029e79a44d454a8eff40d38dd2439f3051dba /packages/merchant-backoffice-ui/src/paths/instance
parent70926f609c766d47235a1fc47f189482bc9052bd (diff)
downloadwallet-core-4f7eac1af8704d11fb3f58650558f932791f3d8e.tar.xz
fix checking bank account with revenue api
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance')
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/accounts/create/CreatePage.tsx25
-rw-r--r--packages/merchant-backoffice-ui/src/paths/instance/accounts/create/index.tsx2
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;
}