M3 Security Fixes for Pass 39

This commit is contained in:
Mark Gregory
2026-09-17 13:08:40 +01:00
parent e0d8e1a725
commit 34c3460760
63 changed files with 655 additions and 503 deletions
@@ -17,9 +17,7 @@ use Str;
class CloseShipment extends Controller
{
private const ZERO_PAD = '000000';
private const JSON_CONTENT_TYPE = 'application/json';
private const NULL_M3_RESPONSE = 'M3 API responded with null value';
// CloseShipmentCoChargeAPI : with URL PARAMS COCharge
@@ -56,6 +54,7 @@ class CloseShipment extends Controller
$pdfFilePath = Config::get('arrays.PdfPath');
$dELIVERYNO = $mANIFEST != '' ? $mANIFEST : self::ZERO_PAD;
if ($urlParams != '') {
// Write to Logs : JSON
$jSONIN = json_encode([
@@ -217,6 +216,7 @@ class CloseShipment extends Controller
}
$iCM695M1TMP = $iCM695M1TMPF;
$freightTermsTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm321m')
->selectRaw('TRIM(ARCODE) as FREIGHTTERMS,ARCHARGE as BILLABLE')
->get();
@@ -261,9 +261,7 @@ class CloseShipment extends Controller
// PFC : Check that Picked / Packed are all Equal
foreach ($iCM688M2SL as $key => $ICM688M2SLR) {
$a5PACKED = isset($ICM688M2SLR->A5PACKED) ? $ICM688M2SLR->A5PACKED : 0;
$a5PICKED = isset($ICM688M2SLR->A5PICKED) ? $ICM688M2SLR->A5PICKED : 0;
$a5PKLN = isset($ICM688M2SLR->A5PKLN) ? $ICM688M2SLR->A5PKLN : 0;
$a5RSVQTY = isset($ICM688M2SLR->A5RSVQTY) ? $ICM688M2SLR->A5RSVQTY : 0;
$a5ShortShipQty = (int) $a5RSVQTY - (int) $a5PICKED;
@@ -607,10 +605,10 @@ class CloseShipment extends Controller
Helper::logToICM699M($data);
$response = Http::withHeaders([
'accept' => self::JSON_CONTENT_TYPE,
'Content-Type' => self::JSON_CONTENT_TYPE,
'Connection' => 'close',
])
'accept' => self::JSON_CONTENT_TYPE,
'Content-Type' => self::JSON_CONTENT_TYPE,
'Connection' => 'close',
])
->withToken($token)
->withBody($jSONCS, self::JSON_CONTENT_TYPE)
->timeout(Config::get('arrays.curlTimeOut'))
@@ -828,10 +826,10 @@ class CloseShipment extends Controller
Helper::logToICM699M($data);
$response = Http::withHeaders([
'accept' => self::JSON_CONTENT_TYPE,
'Content-Type' => self::JSON_CONTENT_TYPE,
'Connection' => 'close',
])
'accept' => self::JSON_CONTENT_TYPE,
'Content-Type' => self::JSON_CONTENT_TYPE,
'Connection' => 'close',
])
->withToken($token)
->withBody($jSONCS, self::JSON_CONTENT_TYPE)
->timeout(Config::get('arrays.curlTimeOut'))