Skip to content

Commit

Permalink
Merge pull request #760 from MrTieGuy06/master
Browse files Browse the repository at this point in the history
Endpoint ApiException message fix
  • Loading branch information
sandervanhooft authored Jan 24, 2025
2 parents b6e9848 + 115d23d commit e605844
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Endpoints/CustomerEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function get($customerId, array $parameters = [])
public function update($customerId, array $data = [])
{
if (empty($customerId) || strpos($customerId, self::RESOURCE_ID_PREFIX) !== 0) {
throw new ApiException("Invalid order ID: '{$customerId}'. An order ID should start with '" . self::RESOURCE_ID_PREFIX . "'.");
throw new ApiException("Invalid customer ID: '{$customerId}'. A customer ID should start with '" . self::RESOURCE_ID_PREFIX . "'.");
}

return parent::rest_update($customerId, $data);
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoints/ProfileEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function get($profileId, array $parameters = [])
public function update($profileId, array $data = [])
{
if (empty($profileId) || strpos($profileId, self::RESOURCE_ID_PREFIX) !== 0) {
throw new ApiException("Invalid profile id: '{$profileId}'. An profile id should start with '" . self::RESOURCE_ID_PREFIX . "'.");
throw new ApiException("Invalid profile ID: '{$profileId}'. A profile ID should start with '" . self::RESOURCE_ID_PREFIX . "'.");
}

return parent::rest_update($profileId, $data);
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoints/ShipmentEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function getForId($orderId, $shipmentId, array $parameters = [])
public function update($orderId, $shipmentId, array $data = [])
{
if (empty($shipmentId) || strpos($shipmentId, self::RESOURCE_ID_PREFIX) !== 0) {
throw new ApiException("Invalid subscription ID: '{$shipmentId}'. An subscription ID should start with '" . self::RESOURCE_ID_PREFIX . "'.");
throw new ApiException("Invalid shipment ID: '{$shipmentId}'. A shipment ID should start with '" . self::RESOURCE_ID_PREFIX . "'.");
}

$this->parentId = $orderId;
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoints/SubscriptionEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function createForId($customerId, array $options = [], array $filters = [
public function update($customerId, $subscriptionId, array $data = [])
{
if (empty($subscriptionId) || strpos($subscriptionId, self::RESOURCE_ID_PREFIX) !== 0) {
throw new ApiException("Invalid subscription ID: '{$subscriptionId}'. An subscription ID should start with '" . self::RESOURCE_ID_PREFIX . "'.");
throw new ApiException("Invalid subscription ID: '{$subscriptionId}'. A subscription ID should start with '" . self::RESOURCE_ID_PREFIX . "'.");
}

$this->parentId = $customerId;
Expand Down

0 comments on commit e605844

Please sign in to comment.