Skip to content

Commit

Permalink
Merge pull request #18 from grongor/itemid-not-required
Browse files Browse the repository at this point in the history
productItemIds are not required
  • Loading branch information
grongor committed May 26, 2016
2 parents 11f6d99 + 9ec32a3 commit cdfa865
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/ShopCertification.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public function logOrder()
$data['orderId'] = $this->orderId;
}

$data['productItemIds'] = $this->productItemIds;
if ($this->productItemIds) {
$data['productItemIds'] = $this->productItemIds;
}

$result = $this->requester->request(IRequester::ACTION_LOG_ORDER, $data);
if ($result->code !== 200) {
Expand Down
6 changes: 0 additions & 6 deletions tests/ShopCertificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ public function testLogOrderSuccessWithoutOptionalFields()
$data = [
'apiKey' => $apiKey = 'xxxxxxxxxx',
'email' => $email = '[email protected]',
'productItemIds' => [
$product1 = 'ab12345',
$product2 = '123459',
],
];

$requester->shouldReceive('request')
Expand All @@ -92,8 +88,6 @@ public function testLogOrderSuccessWithoutOptionalFields()

$shopCertification = new ShopCertification($apiKey, [], $requester);
$shopCertification->setEmail($email);
$shopCertification->addProductItemId($product1);
$shopCertification->addProductItemId($product2);
$shopCertification->logOrder();
}

Expand Down

0 comments on commit cdfa865

Please sign in to comment.