fix yd delivery address update api

This commit is contained in:
omair saleh
2022-01-27 13:28:05 +08:00
parent a6ef50d350
commit c89510dda7
@@ -42,12 +42,11 @@ class UpdateDoFromYDPortalProcessor
->where('status', '!=', ApprovalStatus::SUSPENDED)
->orderBy('id', 'desc')->get();
Log::error($packing_lists);
dd($packing_lists);
foreach ($packing_lists as $key => $row) {
if ($row->status === ApprovalStatus::SUSPENDED) {
$yd_do_update = $this->fetchesDataFRomYDPortal->clientRequest(
$this->fetchesDataFRomYDPortal->clientRequest(
'http://www.yd-wl.com/api/UpdateOrderAddress.ashx',
'POST',
[
@@ -58,7 +57,6 @@ class UpdateDoFromYDPortalProcessor
'streetAddress' => ''
]);
$this->fetchesDataFRomYDPortal->getResponseBody($yd_do_update);
continue;
}
@@ -68,7 +66,7 @@ class UpdateDoFromYDPortalProcessor
$phone = $contact ? $contact->phone : null;
$reference = $contact ? $contact->reference : null;
$yd_do_update = $this->fetchesDataFRomYDPortal->clientRequest(
$this->fetchesDataFRomYDPortal->clientRequest(
'http://www.yd-wl.com/api/UpdateOrderAddress.ashx',
'POST',
[
@@ -80,12 +78,10 @@ class UpdateDoFromYDPortalProcessor
]);
Log::error($this->fetchesDataFRomYDPortal->getResponseBody($yd_do_update));
}
} catch (\Exception $exception){
Log::error($exception);
throw new InternalServerErrorException('failed to approve address due to an error related to YD portal');
}
}