Adapt libeufin test suite to recent API.
The new libeufin-sandbox API enforces every bank account to be owned by one bank customer; this change therefore provides every test user a customer profile before trying the banking operations.
This commit is contained in:
parent
68811cc5f5
commit
d4710ba700
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
import axiosImp from "axios";
|
import axiosImp from "axios";
|
||||||
const axios = axiosImp.default;
|
const axios = axiosImp.default;
|
||||||
import { URL } from "@gnu-taler/taler-util";
|
import { Logger, URL } from "@gnu-taler/taler-util";
|
||||||
|
|
||||||
export interface LibeufinSandboxServiceInterface {
|
export interface LibeufinSandboxServiceInterface {
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
@ -167,13 +167,12 @@ function getRandomString(): string {
|
|||||||
return Math.random().toString(36).substring(2);
|
return Math.random().toString(36).substring(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APIs spread accross Legacy and Access, it is therefore
|
||||||
|
* the "base URL" relative to which API every call addresses.
|
||||||
|
*/
|
||||||
export namespace LibeufinSandboxApi {
|
export namespace LibeufinSandboxApi {
|
||||||
/**
|
// Need Access API base URL.
|
||||||
* Return balance and payto-address of 'accountLabel'.
|
|
||||||
* Note: the demobank serving the request is hard-coded
|
|
||||||
* inside the base URL, and therefore contained in
|
|
||||||
* 'libeufinSandboxService'.
|
|
||||||
*/
|
|
||||||
export async function demobankAccountInfo(
|
export async function demobankAccountInfo(
|
||||||
username: string,
|
username: string,
|
||||||
password: string,
|
password: string,
|
||||||
@ -193,18 +192,24 @@ export namespace LibeufinSandboxApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Creates one bank account via the Access API.
|
// Creates one bank account via the Access API.
|
||||||
|
// Need the /demobanks/$id/access-api as the base URL
|
||||||
export async function createDemobankAccount(
|
export async function createDemobankAccount(
|
||||||
username: string,
|
username: string,
|
||||||
password: string,
|
password: string,
|
||||||
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
||||||
|
iban: string|null = null,
|
||||||
) {
|
) {
|
||||||
let url = new URL("testing/register", libeufinSandboxService.baseUrl);
|
let url = new URL(
|
||||||
|
"testing/register",
|
||||||
|
libeufinSandboxService.baseUrl
|
||||||
|
);
|
||||||
await axios.post(url.href, {
|
await axios.post(url.href, {
|
||||||
username: username,
|
username: username,
|
||||||
password: password,
|
password: password,
|
||||||
|
iban: iban
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Need /demobanks/$id as the base URL
|
||||||
export async function createDemobankEbicsSubscriber(
|
export async function createDemobankEbicsSubscriber(
|
||||||
req: CreateEbicsSubscriberRequest,
|
req: CreateEbicsSubscriberRequest,
|
||||||
demobankAccountLabel: string,
|
demobankAccountLabel: string,
|
||||||
@ -213,7 +218,10 @@ export namespace LibeufinSandboxApi {
|
|||||||
password: string = "secret",
|
password: string = "secret",
|
||||||
) {
|
) {
|
||||||
// baseUrl should already be pointed to one demobank.
|
// baseUrl should already be pointed to one demobank.
|
||||||
let url = new URL("ebics/subscribers", libeufinSandboxService.baseUrl);
|
let url = new URL(
|
||||||
|
"ebics/subscribers",
|
||||||
|
libeufinSandboxService.baseUrl
|
||||||
|
);
|
||||||
await axios.post(
|
await axios.post(
|
||||||
url.href,
|
url.href,
|
||||||
{
|
{
|
||||||
@ -301,6 +309,10 @@ export namespace LibeufinSandboxApi {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new bank account and associate it to
|
||||||
|
* a existing EBICS subscriber.
|
||||||
|
*/
|
||||||
export async function createEbicsBankAccount(
|
export async function createEbicsBankAccount(
|
||||||
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
libeufinSandboxService: LibeufinSandboxServiceInterface,
|
||||||
req: CreateEbicsBankAccountRequest,
|
req: CreateEbicsBankAccountRequest,
|
||||||
@ -712,7 +724,7 @@ export namespace LibeufinNexusApi {
|
|||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const baseUrl = libeufinNexusService.baseUrl;
|
const baseUrl = libeufinNexusService.baseUrl;
|
||||||
let url = new URL(`/bank-accounts/${bankAccountName}/schedule`, baseUrl);
|
let url = new URL(`/bank-accounts/${bankAccountName}/schedule`, baseUrl);
|
||||||
if (taskName) url = new URL(taskName, `${url}/`);
|
if (taskName) url = new URL(taskName, `${url.href}/`);
|
||||||
|
|
||||||
// It's caller's responsibility to interpret the response.
|
// It's caller's responsibility to interpret the response.
|
||||||
return await axios.get(url.href, {
|
return await axios.get(url.href, {
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
* Imports.
|
* Imports.
|
||||||
*/
|
*/
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { URL } from "@gnu-taler/taler-util";
|
import { URL, Logger } from "@gnu-taler/taler-util";
|
||||||
import {
|
import {
|
||||||
GlobalTestState,
|
GlobalTestState,
|
||||||
DbInfo,
|
DbInfo,
|
||||||
@ -56,6 +56,9 @@ import {
|
|||||||
CreateNexusUserRequest,
|
CreateNexusUserRequest,
|
||||||
} from "../harness/libeufin-apis.js";
|
} from "../harness/libeufin-apis.js";
|
||||||
|
|
||||||
|
|
||||||
|
const logger = new Logger("libeufin.ts");
|
||||||
|
|
||||||
export { LibeufinSandboxApi, LibeufinNexusApi };
|
export { LibeufinSandboxApi, LibeufinNexusApi };
|
||||||
|
|
||||||
export interface LibeufinServices {
|
export interface LibeufinServices {
|
||||||
@ -125,7 +128,7 @@ export interface LibeufinCliDetails {
|
|||||||
sandboxUrl: string;
|
sandboxUrl: string;
|
||||||
nexusDatabaseUri: string;
|
nexusDatabaseUri: string;
|
||||||
sandboxDatabaseUri: string;
|
sandboxDatabaseUri: string;
|
||||||
user: LibeufinNexusUser;
|
nexusUser: LibeufinNexusUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LibeufinEbicsSubscriberDetails {
|
export interface LibeufinEbicsSubscriberDetails {
|
||||||
@ -448,6 +451,21 @@ export class LibeufinCli {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async registerBankCustomer(username: string, password: string): Promise<void> {
|
||||||
|
const stdout = await sh(
|
||||||
|
this.globalTestState,
|
||||||
|
"libeufin-cli-registercustomer",
|
||||||
|
"libeufin-cli sandbox demobank register --name='Test Customer'",
|
||||||
|
{
|
||||||
|
...process.env,
|
||||||
|
LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl + "/demobanks/default",
|
||||||
|
LIBEUFIN_SANDBOX_USERNAME: username,
|
||||||
|
LIBEUFIN_SANDBOX_PASSWORD: password,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
console.log(stdout);
|
||||||
|
}
|
||||||
|
|
||||||
async createEbicsHost(hostId: string): Promise<void> {
|
async createEbicsHost(hostId: string): Promise<void> {
|
||||||
const stdout = await sh(
|
const stdout = await sh(
|
||||||
this.globalTestState,
|
this.globalTestState,
|
||||||
@ -528,8 +546,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -546,8 +564,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -562,8 +580,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -577,8 +595,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -592,8 +610,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -607,8 +625,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -627,8 +645,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -642,8 +660,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -657,8 +675,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -678,8 +696,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -698,8 +716,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -716,8 +734,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -734,8 +752,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -749,8 +767,8 @@ export class LibeufinCli {
|
|||||||
{
|
{
|
||||||
...process.env,
|
...process.env,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.nexusUser.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.nexusUser.password,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
@ -773,7 +791,7 @@ interface NewTalerWireGatewayReq {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch Nexus and Sandbox AND creates users / facades / bank accounts /
|
* Launch Nexus and Sandbox AND creates users / facades / bank accounts /
|
||||||
* .. all that's required to start making banking traffic.
|
* .. all that's required to start making bank traffic.
|
||||||
*/
|
*/
|
||||||
export async function launchLibeufinServices(
|
export async function launchLibeufinServices(
|
||||||
t: GlobalTestState,
|
t: GlobalTestState,
|
||||||
@ -799,7 +817,7 @@ export async function launchLibeufinServices(
|
|||||||
await libeufinNexus.start();
|
await libeufinNexus.start();
|
||||||
await libeufinNexus.pingUntilAvailable();
|
await libeufinNexus.pingUntilAvailable();
|
||||||
console.log("Libeufin services launched!");
|
console.log("Libeufin services launched!");
|
||||||
|
|
||||||
for (let sb of sandboxUserBundle) {
|
for (let sb of sandboxUserBundle) {
|
||||||
await LibeufinSandboxApi.createEbicsHost(
|
await LibeufinSandboxApi.createEbicsHost(
|
||||||
libeufinSandbox,
|
libeufinSandbox,
|
||||||
@ -809,9 +827,15 @@ export async function launchLibeufinServices(
|
|||||||
libeufinSandbox,
|
libeufinSandbox,
|
||||||
sb.ebicsBankAccount.subscriber,
|
sb.ebicsBankAccount.subscriber,
|
||||||
);
|
);
|
||||||
await LibeufinSandboxApi.createEbicsBankAccount(
|
await LibeufinSandboxApi.createDemobankAccount(
|
||||||
libeufinSandbox,
|
sb.ebicsBankAccount.label,
|
||||||
sb.ebicsBankAccount,
|
"password-unused",
|
||||||
|
{ baseUrl: libeufinSandbox.baseUrl + "/demobanks/default/access-api/" }
|
||||||
|
);
|
||||||
|
await LibeufinSandboxApi.createDemobankEbicsSubscriber(
|
||||||
|
sb.ebicsBankAccount.subscriber,
|
||||||
|
sb.ebicsBankAccount.label,
|
||||||
|
{ baseUrl: libeufinSandbox.baseUrl + "/demobanks/default/" }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
console.log("Sandbox user(s) / account(s) / subscriber(s): created");
|
console.log("Sandbox user(s) / account(s) / subscriber(s): created");
|
||||||
|
@ -49,22 +49,21 @@ export async function runLibeufinApiBankaccountTest(t: GlobalTestState) {
|
|||||||
await sandbox.start();
|
await sandbox.start();
|
||||||
await sandbox.pingUntilAvailable();
|
await sandbox.pingUntilAvailable();
|
||||||
await LibeufinSandboxApi.createEbicsHost(sandbox, "mock");
|
await LibeufinSandboxApi.createEbicsHost(sandbox, "mock");
|
||||||
await LibeufinSandboxApi.createEbicsSubscriber(sandbox, {
|
await LibeufinSandboxApi.createDemobankAccount(
|
||||||
hostID: "mock",
|
"mock",
|
||||||
userID: "mock",
|
"password-unused",
|
||||||
partnerID: "mock",
|
{ baseUrl: sandbox.baseUrl + "/demobanks/default/access-api/" },
|
||||||
});
|
"DE71500105179674997361"
|
||||||
await LibeufinSandboxApi.createEbicsBankAccount(sandbox, {
|
);
|
||||||
subscriber: {
|
await LibeufinSandboxApi.createDemobankEbicsSubscriber(
|
||||||
|
{
|
||||||
hostID: "mock",
|
hostID: "mock",
|
||||||
partnerID: "mock",
|
partnerID: "mock",
|
||||||
userID: "mock",
|
userID: "mock",
|
||||||
},
|
},
|
||||||
iban: "DE71500105179674997361",
|
"mock",
|
||||||
bic: "BELADEBEXXX",
|
{ baseUrl: sandbox.baseUrl + "/demobanks/default/" }
|
||||||
name: "mock",
|
);
|
||||||
label: "mock",
|
|
||||||
});
|
|
||||||
await LibeufinNexusApi.createEbicsBankConnection(nexus, {
|
await LibeufinNexusApi.createEbicsBankConnection(nexus, {
|
||||||
name: "bankaccount-api-test-connection",
|
name: "bankaccount-api-test-connection",
|
||||||
ebicsURL: "http://localhost:5012/ebicsweb",
|
ebicsURL: "http://localhost:5012/ebicsweb",
|
||||||
|
@ -33,18 +33,17 @@ export async function runLibeufinApiSandboxCamtTest(t: GlobalTestState) {
|
|||||||
});
|
});
|
||||||
await sandbox.start();
|
await sandbox.start();
|
||||||
await sandbox.pingUntilAvailable();
|
await sandbox.pingUntilAvailable();
|
||||||
await LibeufinSandboxApi.createBankAccount(sandbox, {
|
|
||||||
iban: "DE71500105179674997361",
|
await LibeufinSandboxApi.createDemobankAccount(
|
||||||
bic: "BELADEBEXXX",
|
"mock-account-0",
|
||||||
name: "Mock Name",
|
"password-unused",
|
||||||
label: "mock-account-0",
|
{ baseUrl: sandbox.baseUrl + "/demobanks/default/access-api/" }
|
||||||
});
|
);
|
||||||
await LibeufinSandboxApi.createBankAccount(sandbox, {
|
await LibeufinSandboxApi.createDemobankAccount(
|
||||||
iban: "DE71500105179674997361",
|
"mock-account-1",
|
||||||
bic: "BELADEBEXXX",
|
"password-unused",
|
||||||
name: "Mock Name",
|
{ baseUrl: sandbox.baseUrl + "/demobanks/default/access-api/" }
|
||||||
label: "mock-account-1",
|
);
|
||||||
});
|
|
||||||
await sandbox.makeTransaction(
|
await sandbox.makeTransaction(
|
||||||
"mock-account-0",
|
"mock-account-0",
|
||||||
"mock-account-1",
|
"mock-account-1",
|
||||||
|
@ -32,12 +32,12 @@ export async function runLibeufinApiSandboxTransactionsTest(
|
|||||||
});
|
});
|
||||||
await sandbox.start();
|
await sandbox.start();
|
||||||
await sandbox.pingUntilAvailable();
|
await sandbox.pingUntilAvailable();
|
||||||
await LibeufinSandboxApi.createBankAccount(sandbox, {
|
await LibeufinSandboxApi.createDemobankAccount(
|
||||||
iban: "DE71500105179674997361",
|
"mock-account",
|
||||||
bic: "BELADEBEXXX",
|
"password-unused",
|
||||||
name: "Mock Name",
|
{ baseUrl: sandbox.baseUrl + "/demobanks/default/access-api/" },
|
||||||
label: "mock-account",
|
"DE71500105179674997361"
|
||||||
});
|
);
|
||||||
await LibeufinSandboxApi.simulateIncomingTransaction(
|
await LibeufinSandboxApi.simulateIncomingTransaction(
|
||||||
sandbox,
|
sandbox,
|
||||||
"mock-account",
|
"mock-account",
|
||||||
|
@ -81,41 +81,37 @@ export async function createLibeufinTestEnvironment(
|
|||||||
|
|
||||||
await LibeufinSandboxApi.createEbicsHost(libeufinSandbox, "host01");
|
await LibeufinSandboxApi.createEbicsHost(libeufinSandbox, "host01");
|
||||||
// Subscriber and bank Account for the exchange
|
// Subscriber and bank Account for the exchange
|
||||||
await LibeufinSandboxApi.createEbicsSubscriber(libeufinSandbox, {
|
await LibeufinSandboxApi.createDemobankAccount(
|
||||||
hostID: "host01",
|
"exchangeacct",
|
||||||
partnerID: "partner01",
|
"password-unused",
|
||||||
userID: "user01",
|
{ baseUrl: libeufinSandbox.baseUrl + "/demobanks/default/access-api/" },
|
||||||
});
|
exchangeIban
|
||||||
await LibeufinSandboxApi.createEbicsBankAccount(libeufinSandbox, {
|
);
|
||||||
bic: "DEUTDEBB101",
|
await LibeufinSandboxApi.createDemobankEbicsSubscriber(
|
||||||
iban: exchangeIban,
|
{
|
||||||
label: "exchangeacct",
|
|
||||||
name: "Taler Exchange",
|
|
||||||
subscriber: {
|
|
||||||
hostID: "host01",
|
hostID: "host01",
|
||||||
partnerID: "partner01",
|
partnerID: "partner01",
|
||||||
userID: "user01",
|
userID: "user01",
|
||||||
},
|
},
|
||||||
});
|
"exchangeacct",
|
||||||
// Subscriber and bank Account for the merchant
|
{ baseUrl: libeufinSandbox.baseUrl + "/demobanks/default/" }
|
||||||
// (Merchant doesn't need EBICS access, but sandbox right now only supports EBICS
|
);
|
||||||
// accounts.)
|
|
||||||
await LibeufinSandboxApi.createEbicsSubscriber(libeufinSandbox, {
|
await LibeufinSandboxApi.createDemobankAccount(
|
||||||
hostID: "host01",
|
"merchantacct",
|
||||||
partnerID: "partner02",
|
"password-unused",
|
||||||
userID: "user02",
|
{ baseUrl: libeufinSandbox.baseUrl + "/demobanks/default/access-api/" },
|
||||||
});
|
merchantIban
|
||||||
await LibeufinSandboxApi.createEbicsBankAccount(libeufinSandbox, {
|
);
|
||||||
bic: "AUTOATW1XXX",
|
await LibeufinSandboxApi.createDemobankEbicsSubscriber(
|
||||||
iban: merchantIban,
|
{
|
||||||
label: "merchantacct",
|
|
||||||
name: "Merchant",
|
|
||||||
subscriber: {
|
|
||||||
hostID: "host01",
|
hostID: "host01",
|
||||||
partnerID: "partner02",
|
partnerID: "partner02",
|
||||||
userID: "user02",
|
userID: "user02",
|
||||||
},
|
},
|
||||||
});
|
"merchantacct",
|
||||||
|
{ baseUrl: libeufinSandbox.baseUrl + "/demobanks/default/" },
|
||||||
|
);
|
||||||
|
|
||||||
await LibeufinNexusApi.createEbicsBankConnection(libeufinNexus, {
|
await LibeufinNexusApi.createEbicsBankConnection(libeufinNexus, {
|
||||||
name: "myconn",
|
name: "myconn",
|
||||||
|
@ -23,6 +23,7 @@ import {
|
|||||||
NexusUserBundle,
|
NexusUserBundle,
|
||||||
launchLibeufinServices,
|
launchLibeufinServices,
|
||||||
LibeufinNexusApi,
|
LibeufinNexusApi,
|
||||||
|
LibeufinCli
|
||||||
} from "../harness/libeufin.js";
|
} from "../harness/libeufin.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,7 +67,6 @@ export async function runLibeufinNexusBalanceTest(t: GlobalTestState) {
|
|||||||
"EUR:10",
|
"EUR:10",
|
||||||
"first payment",
|
"first payment",
|
||||||
);
|
);
|
||||||
|
|
||||||
// user 01 gets another 10
|
// user 01 gets another 10
|
||||||
await libeufinServices.libeufinSandbox.makeTransaction(
|
await libeufinServices.libeufinSandbox.makeTransaction(
|
||||||
user02sandbox.ebicsBankAccount.label, // debit
|
user02sandbox.ebicsBankAccount.label, // debit
|
||||||
|
@ -32,19 +32,19 @@ export async function runLibeufinSandboxWireTransferCliTest(
|
|||||||
});
|
});
|
||||||
await sandbox.start();
|
await sandbox.start();
|
||||||
await sandbox.pingUntilAvailable();
|
await sandbox.pingUntilAvailable();
|
||||||
await LibeufinSandboxApi.createBankAccount(sandbox, {
|
await LibeufinSandboxApi.createDemobankAccount(
|
||||||
iban: "DE71500105179674997361",
|
"mock-account",
|
||||||
bic: "BELADEBEXXX",
|
"password-unused",
|
||||||
name: "Mock Name",
|
{ baseUrl: sandbox.baseUrl + "/demobanks/default/access-api/" },
|
||||||
label: "mock-account",
|
"DE71500105179674997361"
|
||||||
});
|
);
|
||||||
|
await LibeufinSandboxApi.createDemobankAccount(
|
||||||
|
"mock-account-2",
|
||||||
|
"password-unused",
|
||||||
|
{ baseUrl: sandbox.baseUrl + "/demobanks/default/access-api/" },
|
||||||
|
"DE71500105179674997364"
|
||||||
|
);
|
||||||
|
|
||||||
await LibeufinSandboxApi.createBankAccount(sandbox, {
|
|
||||||
iban: "DE71500105179674997364",
|
|
||||||
bic: "BELADEBEXXX",
|
|
||||||
name: "Mock Name 2",
|
|
||||||
label: "mock-account-2",
|
|
||||||
});
|
|
||||||
await sandbox.makeTransaction(
|
await sandbox.makeTransaction(
|
||||||
"mock-account",
|
"mock-account",
|
||||||
"mock-account-2",
|
"mock-account-2",
|
||||||
|
@ -49,7 +49,7 @@ export async function runLibeufinTutorialTest(t: GlobalTestState) {
|
|||||||
nexusUrl: libeufinNexus.baseUrl,
|
nexusUrl: libeufinNexus.baseUrl,
|
||||||
sandboxDatabaseUri: `jdbc:sqlite:${t.testDir}/libeufin-sandbox.sqlite3`,
|
sandboxDatabaseUri: `jdbc:sqlite:${t.testDir}/libeufin-sandbox.sqlite3`,
|
||||||
nexusDatabaseUri: `jdbc:sqlite:${t.testDir}/libeufin-nexus.sqlite3`,
|
nexusDatabaseUri: `jdbc:sqlite:${t.testDir}/libeufin-nexus.sqlite3`,
|
||||||
user: nexusUser,
|
nexusUser: nexusUser,
|
||||||
});
|
});
|
||||||
|
|
||||||
const ebicsDetails = {
|
const ebicsDetails = {
|
||||||
|
Loading…
Reference in New Issue
Block a user