M3 Security Fixes for Pass 40

This commit is contained in:
Mark Gregory
2026-09-17 13:22:35 +01:00
parent 34c3460760
commit a9b63e43b3
28 changed files with 80 additions and 116 deletions
@@ -17,7 +17,9 @@ 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
@@ -54,7 +56,6 @@ class CloseShipment extends Controller
$pdfFilePath = Config::get('arrays.PdfPath');
$dELIVERYNO = $mANIFEST != '' ? $mANIFEST : self::ZERO_PAD;
if ($urlParams != '') {
// Write to Logs : JSON
$jSONIN = json_encode([
@@ -216,7 +217,6 @@ class CloseShipment extends Controller
}
$iCM695M1TMP = $iCM695M1TMPF;
$freightTermsTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm321m')
->selectRaw('TRIM(ARCODE) as FREIGHTTERMS,ARCHARGE as BILLABLE')
->get();
@@ -605,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'))
@@ -826,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'))