Tie Parcel2Go shipping to pending Etsy orders
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 26s

This commit is contained in:
Hickmeister
2026-10-11 17:11:43 +01:00
parent 55c987ef47
commit 1c80811713
8 changed files with 199 additions and 71 deletions
+3 -3
View File
@@ -47,11 +47,11 @@ class DashboardController extends Controller
if ($isAdmin && filled($shippingConfig['client_id'] ?? null) && filled($shippingConfig['client_secret'] ?? null) && filled($shippingConfig['auth_url'] ?? null)) {
try {
$parcel2Go->verifyCredentials();
if ($parcel2Go->hasScope('my-profile')) {
try {
$shipments = array_slice($parcel2Go->fetch('me/orders/detail')['Orders'] ?? [], 0, 4);
$shippingStatus = 'Live account';
} else {
$shippingStatus = 'Quotes available';
} catch (Throwable $exception) {
$shippingStatus = 'History access needed';
}
} catch (Throwable $exception) {
report($exception);