Skip to content

Commit

Permalink
fix: some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin committed Oct 27, 2023
1 parent c82c3c2 commit e385512
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
15 changes: 8 additions & 7 deletions src/Resources/Fulfillment.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class Fulfillment extends Resource
{
protected $category = 'fulfillment';

public function searchCombinablePackages($params = [])
public function searchCombinablePackages($query = [])
{
$params = array_merge([
$query = array_merge([
'page_size' => 20,
], $params);
], $query);

return $this->call('GET', 'combinable_packages/search', [
RequestOptions::QUERY => $params
RequestOptions::QUERY => $query
]);
}

Expand Down Expand Up @@ -59,13 +59,14 @@ public function updatePackageShippingInfo($package_id, $tracking_number, $shippi
]);
}

public function searchPackage($params = [])
public function searchPackage($query = [], $params = [])
{
$params = array_merge([
$query = array_merge([
'page_size' => 20,
], $params);
], $query);

return $this->call('POST', 'packages/search', [
RequestOptions::QUERY => $query,
RequestOptions::JSON => $params,
]);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Resources/GlobalProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ public function updateGlobalInventory($global_product_id, $params = [])
]);
}

public function searchGlobalProducts($params = [])
public function searchGlobalProducts($params = [], $page_size = 20, $page_token = '')
{
$params = array_merge([
'page_size' => 20,
], $params);

return $this->call('POST', 'global_products/search', [
RequestOptions::QUERY => [
'page_size' => $page_size,
'page_token' => $page_token,
],
RequestOptions::JSON => $params
]);
}
Expand Down
7 changes: 4 additions & 3 deletions src/Resources/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ public function getOrderDetail($ids = [])
]);
}

public function getOrderList($params = [])
public function getOrderList($query = [], $params = [])
{
$params = array_merge([
$query = array_merge([
'page_size' => 20, // required
], $params);
], $query);

return $this->call('POST', 'orders/search', [
RequestOptions::QUERY => $query,
RequestOptions::JSON => $params,
]);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ public function getCategories($params = [])
]);
}

public function getBrands($params = [])
public function getBrands($query = [])
{
$params = array_merge([
$query = array_merge([
'page_size' => 20,
], $params);
], $query);

return $this->call('GET', 'brands', [
RequestOptions::QUERY => $params
RequestOptions::QUERY => $query
]);
}

Expand Down
5 changes: 4 additions & 1 deletion src/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ class Webhook
public const REVERSE_ORDER_STATUS_UPDATE = 2;
public const RECIPIENT_ADDRESS_UPDATE = 3;
public const PACKAGE_UPDATE = 4;
public const PRODUCT_AUDIT_RESULT_UPDATE = 5;
public const PRODUCT_STATUS_UPDATE = 5;
public const RETURN_STATUS_UPDATE = 12;
public const SELLER_DEAUTHORIZATION = 6;
public const UPCOMING_AUTHORIZATION_EXPIRATION = 7;

/**
* @var Client
Expand Down

0 comments on commit e385512

Please sign in to comment.