diff --git a/src/ShipmentData.php b/src/ShipmentData.php index eaa2c71..bc25440 100644 --- a/src/ShipmentData.php +++ b/src/ShipmentData.php @@ -196,10 +196,10 @@ public static function fromJson(array $json): self { /** @var ShipmentData $result */ $result = self::create(); - $result->orderIncrement = $json['order_increment_id'] ?? null; + $result->orderIncrement = $json['orderIncrementId'] ?? null; $result->arguments = Argument::fromJson($json['arguments'] ?? []); $result->notify = $json['notify'] ?? false; - $result->appendComment = $json['append_comment'] ?? false; + $result->appendComment = $json['appendComment'] ?? false; $result->comments = CommentCollection::fromJson($json['comments'] ?? []); $result->items = ItemCollection::fromJson($json['items']); $result->packages = PackageCollection::fromJson($json['packages'] ?? []); @@ -212,7 +212,7 @@ public function toJson() : array $json = []; if ($this->getOrderIncrement()) { - $json['order_increment_id'] = $this->getOrderIncrement(); + $json['orderIncrementId'] = $this->getOrderIncrement(); } if (!$this->getTracks()->isEmpty()) { $json['tracks'] = $this->getTracks()->toJson(); @@ -233,7 +233,7 @@ public function toJson() : array $json['notify'] = $this->getNotify(); } if ($this->getAppendComment()) { - $json['append_comment'] = $this->getAppendComment(); + $json['appendComment'] = $this->getAppendComment(); } return $json; diff --git a/test/unit/ShipmentDataTest.php b/test/unit/ShipmentDataTest.php index 7b4c06e..ca33107 100644 --- a/test/unit/ShipmentDataTest.php +++ b/test/unit/ShipmentDataTest.php @@ -46,7 +46,7 @@ public function testEquals() private function getShipmentsJson() { return [ - "order_increment_id" => "100", + "orderIncrementId" => "100", "arguments" => Argument::create()->withExtensionAttributes( ExtensionAttributeSet::of([ ExtensionAttribute::of('code1', 'value1'), @@ -54,7 +54,7 @@ private function getShipmentsJson() ]) )->toJson(), "notify" => true, - "append_comment" => true, + "appendComment" => true, "comments" => CommentCollection::create()->with(Comment::create() ->withComment("test comment") ->withIsCustomerNotified(1)