summaryrefslogtreecommitdiff
path: root/contrib/taler-nexus-prepare
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-06-02 14:58:30 +0200
committerMS <ms@taler.net>2020-06-02 14:58:30 +0200
commit71eeb72b21884bdf300d686524f6103a4a8fbb9f (patch)
tree8cf145d5ada90fb34366006fbe845e4a8ddb9448 /contrib/taler-nexus-prepare
parentf6e1583016de3f54e437c49ef31f19a052b3a0c8 (diff)
downloadexchange-71eeb72b21884bdf300d686524f6103a4a8fbb9f.tar.gz
exchange-71eeb72b21884bdf300d686524f6103a4a8fbb9f.tar.bz2
exchange-71eeb72b21884bdf300d686524f6103a4a8fbb9f.zip
nexus-based tests
more preparation
Diffstat (limited to 'contrib/taler-nexus-prepare')
-rwxr-xr-xcontrib/taler-nexus-prepare82
1 files changed, 72 insertions, 10 deletions
diff --git a/contrib/taler-nexus-prepare b/contrib/taler-nexus-prepare
index 99bcffb4f..23dbf6d76 100755
--- a/contrib/taler-nexus-prepare
+++ b/contrib/taler-nexus-prepare
@@ -5,6 +5,21 @@ from requests import get, post
from subprocess import call
import base64
+# EBICS details
+EBICS_URL = "http://localhost:5000/ebicsweb"
+HOST_ID = "HOST01"
+PARTNER_ID = "PARTNER1"
+USER_ID = "USER1"
+EBICS_VERSION = "H004"
+
+SUBSCRIBER_IBAN = "ES9121000418450200051332"
+SUBSCRIBER_BIC = "BIC"
+SUBSCRIBER_NAME = "Exchange"
+
+BANK_ACCOUNT_LABEL = "my-bank-account"
+BANK_CONNECTION_LABEL = "my-bank-connection"
+FACADE_LABEL="my-facade"
+
USERNAME="Exchange"
USER_AUTHORIZATION_HEADER = "basic {}".format(
base64.b64encode(b"Exchange:x").decode("utf-8")
@@ -27,30 +42,28 @@ assertResponse(
post(
"http://localhost:5001/bank-connections",
json=dict(
- name="my-loopback",
+ name=BANK_CONNECTION_LABEL,
source="new",
- type="loopback",
+ type="ebics",
data=dict(
- account="my-bank-account",
- iban="x",
- bic="x",
- holder="x",
- )
+ ebicsURL=EBICS_URL, hostID=HOST_ID, partnerID=PARTNER_ID, userID=USER_ID
+ ),
),
headers=dict(Authorization=USER_AUTHORIZATION_HEADER),
)
)
+
# Create a facade
assertResponse(
post(
"http://localhost:5001/facades",
json=dict(
- name="my-facade",
+ name=FACADE_LABEL,
type="taler-wire-gateway",
creator=USERNAME,
config=dict(
- bankAccount="my-bank-account",
- bankConnection="my-local",
+ bankAccount=BANK_ACCOUNT_LABEL,
+ bankConnection=BANK_CONNECTION_LABEL,
reserveTransferLevel="UNUSED",
intervalIncremental="UNUSED"
)
@@ -58,3 +71,52 @@ assertResponse(
headers=dict(Authorization=USER_AUTHORIZATION_HEADER),
)
)
+
+# Create the EBICS host at the Sandbox.
+assertResponse(
+ post(
+ "http://localhost:5000/admin/ebics/host",
+ json=dict(hostID=HOST_ID, ebicsVersion=EBICS_VERSION),
+ )
+)
+
+# Create Exchange EBICS subscriber at the Sandbox.
+assertResponse(
+ post(
+ "http://localhost:5000/admin/ebics/subscribers",
+ json=dict(hostID=HOST_ID, partnerID=PARTNER_ID, userID=USER_ID),
+ )
+)
+
+# Create a bank account associated to the Exchange's EBICS subscriber,
+# again at the Sandbox.
+assertResponse(
+ post(
+ "http://localhost:5000/admin/ebics/bank-accounts",
+ json=dict(
+ subscriber=dict(hostID=HOST_ID, partnerID=PARTNER_ID, userID=USER_ID),
+ iban=SUBSCRIBER_IBAN,
+ bic=SUBSCRIBER_BIC,
+ name=SUBSCRIBER_NAME,
+ label=BANK_ACCOUNT_LABEL,
+ ),
+ )
+)
+
+# 'connect' to the bank: upload+download keys.
+assertResponse(
+ post(
+ "http://localhost:5001/bank-connections/{}/connect".format(BANK_CONNECTION_LABEL),
+ json=dict(),
+ headers=dict(Authorization=USER_AUTHORIZATION_HEADER),
+ )
+)
+
+# Download bank accounts.
+assertResponse(
+ post(
+ "http://localhost:5001/bank-connections/{}/ebics/import-accounts".format(BANK_CONNECTION_LABEL),
+ json=dict(),
+ headers=dict(Authorization=USER_AUTHORIZATION_HEADER),
+ )
+)