Skip to content

Commit

Permalink
chore: fix errorhandling
Browse files Browse the repository at this point in the history
  • Loading branch information
sytheveenje committed May 11, 2023
1 parent 74c9b0b commit 77a8529
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/LaravelPostnlApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public function generateLabelForMultiCollo(
* @param string $productCodeDelivery
* @param $reference string|null
* @param $remark string|null
* @param bool $fullLabel
* @return void
*
* This method uses the Confirming API
Expand All @@ -179,6 +178,7 @@ public function generateLabelForMultiCollo(
*/
public function confirmShipment(
string $barcode = null,
string $printertype = 'GraphicFile|PDF',
array $address = null,
array $contact = null,
string $productCodeDelivery = '3085',
Expand Down Expand Up @@ -209,6 +209,8 @@ public function confirmShipment(

if($response->successful()) {
return collect($response->object()->ResponseShipments)->first();
} else {
abort(500, 'PostNL API Error: '.$response->object()->ErrorMessage->Description);
}

}
Expand Down

0 comments on commit 77a8529

Please sign in to comment.