diff --git a/src/Models/Order.php b/src/Models/Order.php index f3cfded..3aa7bd3 100644 --- a/src/Models/Order.php +++ b/src/Models/Order.php @@ -146,6 +146,8 @@ public function setCommentList(array $CommentList): void */ public function addItem(Item $item): void { + $item_count = count($this->ItemList); + $item->setNumber($item_count + 1); $this->ItemList[] = $item; } diff --git a/src/Utils/Response.php b/src/Utils/Response.php index 3f8060b..0938ce9 100644 --- a/src/Utils/Response.php +++ b/src/Utils/Response.php @@ -50,48 +50,4 @@ public function getValue($key) { return (new XmlParser($this->getRawBody()))->getValue($key); } - - /** - * @return array|string - * @throws \JsonException - */ - public function getResult() - { - return $this->getValue($this->requestMethod . 'Result'); - } - - /** - * @return bool - */ - public function isSuccessful(): bool - { - return $this->getResult()['ServiceResult'] === 'Successful'; - } - - /** - * @return string - * @throws \JsonException - */ - public function getStatus(): string - { - return $this->getResult()['ServiceResult']; - } - - /** - * @return string - * @throws \JsonException - */ - public function getStatusDesc(): string - { - return $this->getResult()['ServiceResultDescription']; - } - - /** - * @return string - * @throws \JsonException - */ - public function getErrorCode(): string - { - return $this->getResult()['ErrorCode']; - } }