Skip to content

Commit

Permalink
merge with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbonds committed Feb 15, 2016
2 parents 0a454eb + 3b9d01c commit 084ae74
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 47 deletions.
2 changes: 1 addition & 1 deletion src/Endpoints/Carriers.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getCarrier($carrierCode = '')
*/
public function addFunds($carrierCode = '', $amount = 0)
{
return $this->post('addfunds', ['body' => compact('carrierCode', 'amount')]);
return $this->post('addfunds', ['form_params' => compact('carrierCode', 'amount')]);
}

/**
Expand Down
43 changes: 9 additions & 34 deletions src/Endpoints/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function deleteOrder($order_id = '')
public function addTag($order_id, $tag_id)
{
return $this->post('addTag', [
'body' => [
'form_params' => [
'orderId' => $order_id,
'tagId' => $tag_id
]
Expand All @@ -57,57 +57,32 @@ public function addTag($order_id, $tag_id)
public function assignUser($order_ids = [], $user_id = '')
{
return $this->post('assignUser', [
'body' => [
'form_params' => [
'orderIds' => $order_ids,
'userId' => $user_id
]
]);
}

/**
* @param int $order_id
* @param string $carrier_code
* @param string $service_code
* @param string $package_code
* @param string $confirmation
* @param string $ship_date
* @param Weight|null $weight
* @param Dimensions|null $dimensions
* @param InsuranceOptions|null $insurance_options
* @param InternationalOptions|null $international_options
* @param AdvancedOptions|null $advanced_options
* @param bool|false $test_label
* @param Order $order
* @param bool $test
*
* @return \GuzzleHttp\Psr7\Response
*/
public function createLabelForOrder($order_id, $carrier_code = '', $service_code = '',
$package_code = '', $confirmation = '', $ship_date = '', Weight $weight = null, Dimensions $dimensions = null,
InsuranceOptions $insurance_options = null, InternationalOptions $international_options = null, AdvancedOptions
$advanced_options = null, $test_label = false)
public function createLabelForOrder(Order $order, $test = false)
{
return $this->post('createlabelfororder', [
'body' => [
'orderId'=> $order_id,
'carrierCode' => $carrier_code,
'serviceCode' => $service_code,
'packageCode' => $package_code,
'confirmation' => $confirmation,
'shipDate' => $ship_date,
'weight' => $weight,
'dimensions' => $dimensions,
'insuranceOptions' => $insurance_options,
'internationalOptions' => $international_options,
'advancedOptions' => $advanced_options,
'testLabel' => $test_label
]
]);
$form_params = $order->toArray();
$form_params['testLabel'] = $test;

return $this->post('createlabelfororder', [compact('form_params')]);
}

/**
* Create a single order
*
* @param Order $order
*
* @return \GuzzleHttp\Psr7\Response
*/
public function createOrder(Order $order)
Expand Down
4 changes: 2 additions & 2 deletions src/Endpoints/Products.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function update(Product $product)
{
return $this->put('', [
'query' => ['id' => $product->productId],
'body' => $product->toArray()
'form_params' => $product->toArray()
]);
}

Expand All @@ -43,6 +43,6 @@ public function update(Product $product)
*/
public function getList($query = [])
{
return $this->get('', ['body' => $query]);
return $this->get('', ['form_params' => $query]);
}
}
8 changes: 4 additions & 4 deletions src/Endpoints/Shipments.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Shipments extends BaseEndpoint
*/
public function listShipments($query = [])
{
return $this->get('', ['body' => $query]);
return $this->get('', ['form_params' => $query]);
}

/**
Expand All @@ -25,7 +25,7 @@ public function listShipments($query = [])
*/
public function createLabel($label = [])
{
return $this->post('createlabel', ['body' => $label]);
return $this->post('createlabel', ['form_params' => $label]);
}

/**
Expand All @@ -35,7 +35,7 @@ public function createLabel($label = [])
*/
public function getRates($query = [])
{
return $this->post('getrates', ['body' => $query]);
return $this->post('getrates', ['form_params' => $query]);
}

/**
Expand All @@ -46,6 +46,6 @@ public function getRates($query = [])
*/
public function voidLabel($shipmentId = '')
{
return $this->post('voidlabel', ['body' => compact('shipmentId')]);
return $this->post('voidlabel', ['form_params' => compact('shipmentId')]);
}
}
6 changes: 3 additions & 3 deletions src/Endpoints/Stores.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function getStore($storeId = '')
*/
public function update(Store $store)
{
return $this->put($store->storeId, ['body' => $store->toArray()]);
return $this->put($store->storeId, ['form_params' => $store->toArray()]);
}

/**
Expand Down Expand Up @@ -80,7 +80,7 @@ public function getRefreshStatus($storeId ='')
*/
public function deactivateStore($storeId = '')
{
return $this->post('deactivate', ['body' => compact('storeId')]);
return $this->post('deactivate', ['form_params' => compact('storeId')]);
}

/**
Expand All @@ -90,6 +90,6 @@ public function deactivateStore($storeId = '')
*/
public function reactivateStore($storeId = '')
{
return $this->post('reactivate', ['body' => compact('storeId')]);
return $this->post('reactivate', ['form_params' => compact('storeId')]);
}
}
4 changes: 2 additions & 2 deletions src/Endpoints/Warehouses.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getWarehouse($warehouseId = '')
*/
public function updateWarehouse(Warehouse $warehouse)
{
return $this->put($warehouse->warehouseId, ['body' => $warehouse->toArray()]);
return $this->put($warehouse->warehouseId, ['form_params' => $warehouse->toArray()]);
}

/**
Expand All @@ -36,7 +36,7 @@ public function updateWarehouse(Warehouse $warehouse)
*/
public function createWarehouse(Warehouse $warehouse)
{
return $this->post('createwarehouse', ['body' => $warehouse->toArray()]);
return $this->post('createwarehouse', ['form_params' => $warehouse->toArray()]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Endpoints/Webhooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Webhooks extends BaseEndpoint
*/
public function subscribe($friendly_name = '', $target_url = '', $event = '', $store_id = '')
{
return $this->post('subscribe', ['body' => compact('friendly_name', 'target_url', 'event', 'store_id')]);
return $this->post('subscribe', ['form_params' => compact('friendly_name', 'target_url', 'event', 'store_id')]);
}

/**
Expand Down

0 comments on commit 084ae74

Please sign in to comment.