From c892b615b6a402f6d3404f56a0eb084889d9d8fb Mon Sep 17 00:00:00 2001
From: Hickmeister <35031453+Hickmeister@users.noreply.github.com>
Date: Sun, 11 Oct 2026 17:59:59 +0100
Subject: [PATCH] Restore Parcel2Go account reads for client credentials
---
app/Http/Controllers/ShippingController.php | 18 +++++++++-------
resources/views/settings/index.blade.php | 6 +++---
resources/views/shipping.blade.php | 2 +-
tests/Feature/IntegrationsTest.php | 23 ++++++++++++++++-----
4 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/app/Http/Controllers/ShippingController.php b/app/Http/Controllers/ShippingController.php
index 0b452e9..0152e84 100644
--- a/app/Http/Controllers/ShippingController.php
+++ b/app/Http/Controllers/ShippingController.php
@@ -45,16 +45,18 @@ class ShippingController extends Controller
$profileNotice = $parcel2Go->profileConnected()
? 'Parcel2Go account access needs attention. Reconnect the account in Settings.'
: ($exception instanceof RequestException && in_array($exception->response->status(), [401, 403], true)
- ? 'Parcel2Go denied shipment history for this client. Connect an Authorization Code client in Settings.'
+ ? 'Parcel2Go denied shipment history for the saved Client Credentials client. Check that its Client ID and secret match the client used by your previous dashboard.'
: 'Parcel2Go shipment history is temporarily unavailable.');
}
- if ($parcel2Go->profileConnected() || $parcel2Go->hasScope('my-profile')) {
- try {
- $account = $parcel2Go->fetch('me/detail');
- $balance = $parcel2Go->fetch('me/prepay/balance');
- } catch (Throwable $exception) {
- report($exception);
- }
+ try {
+ $account = $parcel2Go->fetch('me/detail');
+ } catch (Throwable $exception) {
+ report($exception);
+ }
+ try {
+ $balance = $parcel2Go->fetch('me/prepay/balance');
+ } catch (Throwable $exception) {
+ report($exception);
}
} catch (Throwable $exception) {
report($exception);
diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.php
index 9e9854c..05fd885 100644
--- a/resources/views/settings/index.blade.php
+++ b/resources/views/settings/index.blade.php
@@ -59,16 +59,16 @@
-
Keep basic public-api access for quotes and bookings. The separate Authorization Code client connects your own account for shipment history and labels.
+
The dashboard tries shipments, account details and balance with your Client Credentials connection, as the previous dashboard did. If Parcel2Go denies history, check that these credentials belong to the same client that worked before.
Create an Authorization Code client in Parcel2Go. Set Application URL to {{ url('/') }} and Redirect URI to this exact address:
{{ $integrations['parcel2go']['callback_url'] }}
Save its Client ID above, then sign in and approve my-profile access. The account tokens are encrypted in the database. If Parcel2Go does not issue a refresh token, reconnect when access expires. If consent rejects this scope, contact apihelp@parcel2go.com.
{{ $historyAvailable ? 'No shipments in Parcel2Go account history.' : 'Shipment history is unavailable until Parcel2Go grants access to this client.' }}
@endforelse
+ @empty
{{ $historyAvailable ? 'No shipments in Parcel2Go account history.' : 'Shipment history is unavailable. Check the Client Credentials in Settings.' }}