Fix server error reported by Mira: failed to approve address due to an error related to VT portal: Client error: POST http://portal.vtnation.com.my/Services/DataControllerService.asmx/Login

This commit is contained in:
Dillon Ngo
2026-06-30 12:20:30 +08:00
parent 000c212085
commit dc553e5e95
7 changed files with 16 additions and 16 deletions
@@ -69,7 +69,7 @@ class SuccessUpdatePaymentStatusV2CommandJob implements ShouldQueue
$packingList->save(); $packingList->save();
if(app()->environment('production')){ if(app()->environment('production')){
(App()->make(UpdateDoFromVTPortalProcessor::class))->execute($packingList); //(App()->make(UpdateDoFromVTPortalProcessor::class))->execute($packingList);
(App()->make(UpdateDoFromYDPortalProcessor::class))->execute($packingList); (App()->make(UpdateDoFromYDPortalProcessor::class))->execute($packingList);
} }
@@ -68,7 +68,7 @@ class ApproveChangeOrderAddressProcessor
$appointee = $address->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id; $appointee = $address->owner->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_FREIGHT_FORWARDER)->first()->appointee->id;
if($appointee === 2) { if($appointee === 2) {
foreach($address->owner->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST) as $packingList){ foreach($address->owner->packingLists()->where('type', PackingListType::SHIPPING_PACKING_LIST) as $packingList){
$this->updateDoFromVTPortalProcessor->execute($packingList); //$this->updateDoFromVTPortalProcessor->execute($packingList);
} }
} }
@@ -144,7 +144,7 @@ class CreatePaymentTransactionOneTimeFixProcessor
$packingList->save(); $packingList->save();
if(app()->environment('production')){ if(app()->environment('production')){
$this->updateDoFromVTPortalProcessor->execute($packingList); //$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList); $this->updateDoFromYDPortalProcessor->execute($packingList);
} }
} }
@@ -135,7 +135,7 @@ class CreatePaymentTransactionProcessor
$packingList->save(); $packingList->save();
if(app()->environment('production')){ if(app()->environment('production')){
$this->updateDoFromVTPortalProcessor->execute($packingList); //$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList); $this->updateDoFromYDPortalProcessor->execute($packingList);
} }
} }
@@ -93,7 +93,7 @@ class ReleaseGoodsToCustomerProcessor
$packingList->save(); $packingList->save();
if (app()->environment('production')) { if (app()->environment('production')) {
$this->updateDoFromVTPortalProcessor->execute($packingList); // $this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList); $this->updateDoFromYDPortalProcessor->execute($packingList);
} }
@@ -76,10 +76,10 @@ class SuccessUpdatePaymentStatusButFailedCallback extends Command
*/ */
public function handle() public function handle()
{ {
ini_set('memory_limit', '-1'); ini_set('memory_limit', '-1');
$this->info(Carbon::now() . ' : Billplz Failled Callback cron started.'); $this->info(Carbon::now() . ' : Billplz Failled Callback cron started.');
$this->outputArray = []; $this->outputArray = [];
$start = new Carbon(); $start = new Carbon();
$approvalStatusArray = ApprovalStatus::APPROVAL_STATUS_ID; $approvalStatusArray = ApprovalStatus::APPROVAL_STATUS_ID;
@@ -107,27 +107,27 @@ class SuccessUpdatePaymentStatusButFailedCallback extends Command
$this->info('PackingList has no owner. PackingList ID: ' . $packingList->id); $this->info('PackingList has no owner. PackingList ID: ' . $packingList->id);
continue; continue;
} }
if ($invoice->status == ApprovalStatus::APPROVED) { if ($invoice->status == ApprovalStatus::APPROVED) {
$totalPaidAmount = $invoice->transactions->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount'); $totalPaidAmount = $invoice->transactions->where('type', TransactionType::PAYMENT)->whereIn('status', [ApprovalStatus::APPROVED, ApprovalStatus::COMPLETED])->sum('amount');
if(($invoice->amount - $totalPaidAmount) < 0.01) { if(($invoice->amount - $totalPaidAmount) < 0.01) {
$this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED); $this->updatesTransactionStatus->execute($invoice, ApprovalStatus::COMPLETED);
$packingList->status = ApprovalStatus::APPROVED; $packingList->status = ApprovalStatus::APPROVED;
$packingList->save(); $packingList->save();
if(app()->environment('production')){ if(app()->environment('production')){
$this->updateDoFromVTPortalProcessor->execute($packingList); //$this->updateDoFromVTPortalProcessor->execute($packingList);
$this->updateDoFromYDPortalProcessor->execute($packingList); $this->updateDoFromYDPortalProcessor->execute($packingList);
} }
dump('Updated invoice ' . $invoice->id . '. Order: '. $order->reference); dump('Updated invoice ' . $invoice->id . '. Order: '. $order->reference);
} else { } else {
$this->info('Failed Update invoice ' . $invoice->id . ' because payment not enough. Invoice Amount: ' . $invoice->amount . ' . Paid Amount: ' . $totalPaidAmount . ' . Order: '. $order->reference); $this->info('Failed Update invoice ' . $invoice->id . ' because payment not enough. Invoice Amount: ' . $invoice->amount . ' . Paid Amount: ' . $totalPaidAmount . ' . Order: '. $order->reference);
} }
} }
} }
$end = new Carbon(); $end = new Carbon();
+2 -2
View File
@@ -863,7 +863,7 @@ Route::get('/billplz/fix', function () {
$packingList = $payment->owner->owner; $packingList = $payment->owner->owner;
if (app()->environment('production')) { if (app()->environment('production')) {
try { try {
(App()->make(UpdateDoFromVTPortalProcessor::class))->execute($packingList); //(App()->make(UpdateDoFromVTPortalProcessor::class))->execute($packingList);
(App()->make(UpdateDoFromYDPortalProcessor::class))->execute($packingList); (App()->make(UpdateDoFromYDPortalProcessor::class))->execute($packingList);
} catch (Exception $exception) { } catch (Exception $exception) {
echo '<br><span style="color: red">Malformed Address: <a href="' . route('order.show', $orderNumber) . '" target="_blank">' . $orderNumber . '</a></span><br>'; echo '<br><span style="color: red">Malformed Address: <a href="' . route('order.show', $orderNumber) . '" target="_blank">' . $orderNumber . '</a></span><br>';
@@ -1336,7 +1336,7 @@ Route::get('fix-payment-status-updated-but-failed-update-invoice', function (Upd
$packingList->save(); $packingList->save();
if (app()->environment('production')) { if (app()->environment('production')) {
$updateDoFromVTPortalProcessor->execute($packingList); //$updateDoFromVTPortalProcessor->execute($packingList);
$updateDoFromYDPortalProcessor->execute($packingList); $updateDoFromYDPortalProcessor->execute($packingList);
} }