From 6757edf5d16dd0e4ace2e225190b6c5c7a3c3847 Mon Sep 17 00:00:00 2001 From: Dave Shoreman Date: Fri, 31 May 2024 20:49:36 +0100 Subject: [PATCH] Trim regional locales to two-letter country codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GoCardless' Bank Account Data API requires two-letter ISO 639-1 country codes. IN passes the full locale such as *en_GB* or *pt_BR*, which causes an "unknown error" when selecting banks in Connect Accounts. Note: Norwegian will use the Bokmål (`nb`) form over Nynorsk (`nn`). Fixes #9566 --- app/Http/Controllers/Bank/NordigenController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Bank/NordigenController.php b/app/Http/Controllers/Bank/NordigenController.php index ebefc7b5bd..5e6764ecb0 100644 --- a/app/Http/Controllers/Bank/NordigenController.php +++ b/app/Http/Controllers/Bank/NordigenController.php @@ -35,7 +35,7 @@ class NordigenController extends BaseController /** @var array $context */ $context = $request->getTokenContent(); $company = $request->getCompany(); - $lang = $company->locale(); + $lang = substr($company->locale(), 0, 2); $context["lang"] = $lang; if (!$context) { @@ -143,7 +143,7 @@ class NordigenController extends BaseController $data = $request->all(); $company = $request->getCompany(); $account = $company->account; - $lang = $company->locale(); + $lang = substr($company->locale(), 0, 2); /** @var array $context */ $context = $request->getTokenContent();