Restore Parcel2Go account reads for client credentials
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m48s

This commit is contained in:
Hickmeister
2026-10-11 17:59:59 +01:00
parent 141a1f9379
commit c892b615b6
4 changed files with 32 additions and 17 deletions
+10 -8
View File
@@ -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);