Add Parcel2Go account consent with PKCE
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 26s
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 26s
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user