whisper-money/app/Http/Controllers/OpenBanking
Toni Grunwald 1c5a76a3a4
feat: add Wise open banking integration with balance sync (#525)
## Summary
Adds **Wise** as an API-token banking provider — connect flow,
transaction sync, and per-wallet balance sync — and fixes two bugs that
kept business/extra profiles and balances from working.

## Changes
- **Balance sync** — new `WiseBalanceSyncService` pulls
borderless-account balances on every sync. Previously Wise balances were
never fetched, so the displayed balance went stale (frozen at the last
value).
- **Multi-profile connect** — `WiseController` now creates accounts for
**every** profile on the token (personal *and* business), not just one.
- **ID-format fix** — `external_account_id` is now
`"{profileId}:{currency}"`. The connect flow previously wrote the
**borderless-account id**, but both sync services parse the **profile
id** — so any UI-connected account (and every business profile) silently
failed to sync.
- **Tests** — `WiseBalanceSyncTest` (currency matching, idempotent
today-balance, skip-when-unmapped) and `WiseControllerTest`
(multi-profile pending accounts, onboarding auto-create, invalid token).

## Test plan
- [x] `php artisan test
tests/Feature/OpenBanking/WiseBalanceSyncTest.php
tests/Feature/OpenBanking/WiseControllerTest.php` — 6 passing / 28
assertions
- [x] `vendor/bin/pint` — clean
- [ ] CI (full pest + lint + build)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Víctor Falcón <victoor89@gmail.com>
2026-06-16 13:23:25 +00:00
..
Concerns feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
AccountMappingController.php fix(accounts): sync currency from first account (#430) 2026-05-25 20:55:24 +02:00
AuthorizationController.php feat(open-banking): finalize bank connection without a session via state token (#498) 2026-06-06 12:12:07 +02:00
BinanceController.php fix(accounts): sync currency from first account (#430) 2026-05-25 20:55:24 +02:00
BitpandaController.php fix(accounts): sync currency from first account (#430) 2026-05-25 20:55:24 +02:00
CoinbaseController.php fix(accounts): sync currency from first account (#430) 2026-05-25 20:55:24 +02:00
ConnectionController.php feat: Coinbase banking integration (#388) 2026-05-13 19:53:30 +02:00
IndexaCapitalController.php fix(accounts): sync currency from first account (#430) 2026-05-25 20:55:24 +02:00
InstitutionController.php feat: Integrate EnableBanking as open banking provider (#106) 2026-02-12 09:09:28 +01:00
WiseController.php feat: add Wise open banking integration with balance sync (#525) 2026-06-16 13:23:25 +00:00