Skip to content

Commit

Permalink
Release v20.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wsagen committed Jun 7, 2016
2 parents b2fd5c6 + 7839c61 commit e2d60b8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- SHQ16-950 store allowed methods in configuration
- SHQ16-1006 Log API key and request as JSON

## [20.0.6] - 2016-06-07
### Added
- SHQ16-1065 correct method signature for logger
- SHQ16-1041 handle null value for carrier group detail
7 changes: 5 additions & 2 deletions src/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,15 @@ public function getWebserviceTimeout()
public function encodeShippingDetails($shippingDetails)
{
return $this->jsonHelper->jsonEncode($shippingDetails);

}

public function decodeShippingDetails($shippingDetailsEnc)
{
return $this->jsonHelper->jsonDecode($shippingDetailsEnc);
$decoded = array();
if(!is_null($shippingDetailsEnc) && $shippingDetailsEnc != '') {
$decoded = $this->jsonHelper->jsonDecode($shippingDetailsEnc);
}
return $decoded;
}

/**
Expand Down
14 changes: 10 additions & 4 deletions src/Helper/LogAssist.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function __construct(
*/
public function postDebug($module, $message, $data, array $context = array()) {
if ($this->shipperDataHelper->getConfigValue('carriers/shipper/debug')) {
$this->logger->debug(array($module, $message,$data),$context);
$this->logger->debug($this->getMessage($module, $message, $data),$context);
}
}

Expand All @@ -76,7 +76,7 @@ public function postDebug($module, $message, $data, array $context = array()) {
*/
public function postInfo($module, $message, $data, array $context = array()) {
if ($this->shipperDataHelper->getConfigValue('carriers/shipper/debug')) {
$this->logger->info(array($module, $message,$data),$context);
$this->logger->info($this->getMessage($module, $message, $data),$context);
}
}

Expand All @@ -87,7 +87,7 @@ public function postInfo($module, $message, $data, array $context = array()) {
*/
public function postWarning($module, $message, $data, array $context = array()) {
if ($this->shipperDataHelper->getConfigValue('carriers/shipper/debug')) {
$this->logger->warning(array($module, $message,$data),$context);
$this->logger->warning($this->getMessage($module, $message, $data),$context);
}
}

Expand All @@ -98,7 +98,7 @@ public function postWarning($module, $message, $data, array $context = array())
*/
public function postCritical($module, $message, $data, array $context = array()) {
if ($this->shipperDataHelper->getConfigValue('carriers/shipper/debug')) {
$this->logger->warning(array($module, $message,$data),$context);
$this->logger->warning($this->getMessage($module, $message, $data),$context);
}
}

Expand All @@ -113,4 +113,10 @@ public function getDebugFlag()
{
return $this->shipperDataHelper->getConfigValue('carriers/shipper/debug');
}

protected function getMessage($module, $message, $data)
{
$data = is_string($data) ? $data : var_export($data,true);
return $module .'- ' .$message .': ' .$data;
}
}
2 changes: 1 addition & 1 deletion src/Plugin/Checkout/ShippingInformationPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected function saveCarrierGroupInformation($shippingAddress)
{

$foundRate = $shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod());
if($foundRate) {
if($foundRate && $foundRate->getCarriergroupShippingDetails() != '') {
$shipDetails = $this->shipperDataHelper->decodeShippingDetails($foundRate->getCarriergroupShippingDetails());
if(array_key_exists('carrierGroupId', $shipDetails)) {
$arrayofShipDetails = array();
Expand Down
2 changes: 1 addition & 1 deletion src/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
<ws_timeout>120</ws_timeout>
<use_cache>0</use_cache>
<extension_version>20.0.5</extension_version>
<extension_version>20.0.6</extension_version>
<allowed_methods></allowed_methods>
</shipper>
</carriers>
Expand Down

0 comments on commit e2d60b8

Please sign in to comment.