Add Parcel2Go account consent with PKCE
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 26s

This commit is contained in:
Hickmeister
2026-10-11 17:27:07 +01:00
parent 1c80811713
commit 1be66f099c
9 changed files with 321 additions and 9 deletions
+6 -4
View File
@@ -42,11 +42,13 @@ class ShippingController extends Controller
$orders = $parcel2Go->fetch('me/orders/detail');
$historyAvailable = true;
} catch (Throwable $exception) {
$profileNotice = $exception instanceof RequestException && in_array($exception->response->status(), [401, 403], true)
? 'Parcel2Go denied shipment history for this client. Request my-profile access from Parcel2Go API support.'
: 'Parcel2Go shipment history is temporarily unavailable.';
$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 shipment history is temporarily unavailable.');
}
if ($parcel2Go->hasScope('my-profile')) {
if ($parcel2Go->profileConnected() || $parcel2Go->hasScope('my-profile')) {
try {
$account = $parcel2Go->fetch('me/detail');
$balance = $parcel2Go->fetch('me/prepay/balance');