PSD2 Open Banking integration via Enable Banking API. Connect DACH bank accounts (Sparkasse, Volksbank, Deutsche Bank, Commerzbank, DKB, ING, Postbank + Austrian banks) to fetch balances and transactions. Multi-mandant architecture with 3 modes: onboard, fetch, renew. Designed for tax advisory automation.
通过启用银行API实现PSD2开放银行集成。
用于接入银行连接、获取余额/交易记录以及会话续期的多租户架构。
┌─────────────┐ POST /auth ┌──────────────────────┐
│ onboard.py │ ──────────────────→ │ 启用银行API │
│ renew.py │ ←── redirect_url ── │ api.enablebanking.com│
└──────┬──────┘ └──────────┬───────────┘
│ │
│ 轮询 pending_callbacks/ │ 用户在银行门户
│ │ 进行授权
▼ ▼
┌──────────────────┐ GET /callback ┌─────────────┐
│ callback_server │ ←───────────────── │ 银行OAuth │
│ (端口 8443 HTTPS)│ │ 重定向 │
└──────────────────┘ └─────────────┘
│
│ 保存 code → pending_callbacks/{state}.json
│
▼
┌─────────────┐ POST /sessions ┌──────────────────────┐
│ onboard.py │ ──────────────────→ │ 启用银行API │
│ renew.py │ ←── session + accs ── │ │
└──────┬──────┘ └──────────────────────┘
│
│ 保存 mandanten/{id}.json
▼
┌─────────────┐ GET /accounts/{uid}/ ┌──────────────────────┐
│ fetch.py │ ──────────────────→ │ 启用银行API │
│ │ ←── balances + txns ──│ │
└──────┬──────┘ └──────────────────────┘
│
│ 保存 data/{id}/{date}.json
▼
stdout: JSON
enable-banking/
├── SKILL.md # 本文件
├── config.json # 应用凭证(请勿提交)
├── .keys/ # 私钥 + 回调证书(请勿提交)
├── .gitignore
├── scripts/
│ ├── lib/
│ │ ├── init.py
│ │ └── auth.py # 共享JWT + API辅助函数 + 租户I/O
│ ├── callback_server.py # HTTPS回调守护进程
│ ├── onboard.py # 新租户连接
│ ├── fetch.py # 自主数据获取
│ └── renew.py # 会话续期
├── references/
│ └── api-reference.md
├── mandanten/ # 每个租户的JSON文件(请勿提交)
├── data/ # 获取的数据(请勿提交)
└── pending_callbacks/ # 临时回调代码(请勿提交)
| 函数 | 描述 |
|---|---|
| loadconfig() | 加载 config.json |
| generatejwt(config) |
bash
python scripts/callback_server.py # 端口 8443 (HTTPS)
python scripts/callback_server.py --port 9443 # 自定义端口
python scripts/callback_server.py --no-ssl # 仅HTTP(开发环境)
bash
流程(不使用 --code):
bash
bash
python scripts/renew.py --mandant-id mueller
python scripts/renew.py --mandant-id mueller --code ABC123
mandanten/{id}.json:
json
{
mandantId: mueller,
bank: Sparkasse Karlsruhe,
country: DE,
psuType: personal,
sessionId: cbe3cd33-...,
accounts: [
{
uid: 2818be38-...,
iban: DE17...,
name: Max Mueller,
currency: EUR,
product: Sichteinlagen
}
],
validUntil: 2026-09-06T07:18:35Z,
createdAt: 2026-03-10T08:18:00Z,
lastFetch: null
}
data/{id}/{date}.json 和 stdout:
json
{
mandantId: mueller,
fetchedAt: 2026-03-10T08:00:00Z,
accounts: [
{
uid: ...,
iban: DE17...,
name: Max Mueller,
balances: [
{type: CLBD, amount: -993.13, currency: EUR, date: 2026-03-10}
],
transactions: [
{
date: 2026-03-02,
amount: -171.00,
currency: EUR,
creditDebit: DBIT,
counterparty: ...,
description: ...,
bookingDate: 2026-03-02,
valueDate: 2026-03-02
}
]
}
]
}
本地(开发/测试):
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 openfin-enable-banking-1776172504 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 openfin-enable-banking-1776172504 技能
skillhub install openfin-enable-banking-1776172504
文件大小: 19.37 KB | 发布时间: 2026-4-15 10:25