Restore Parcel2Go account reads for client credentials
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m48s
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 1m48s
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user