Skip to content

Commit

Permalink
Merge pull request #21 from stefandoorn/check-no-stdclass-charge-value
Browse files Browse the repository at this point in the history
Check no stdclass charges MonetaryValue
  • Loading branch information
gabrielbull committed Apr 20, 2015
2 parents b6a2e01 + 75085ed commit ac1ef51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Ups/Entity/Charges.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function __construct($response = null)
if (isset($response->CurrencyCode)) {
$this->CurrencyCode = $response->CurrencyCode;
}
if (isset($response->MonetaryValue)) {
if (isset($response->MonetaryValue) && !$response->MonetaryValue instanceof \stdClass) {
$this->MonetaryValue = (float)$response->MonetaryValue;
}
if (isset($response->Code)) {
Expand All @@ -29,4 +29,4 @@ function __construct($response = null)
}
}
}
}
}
8 changes: 4 additions & 4 deletions src/Ups/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ class Response implements ResponseInterface
/**
* @var SimpleXMLElement
*/
protected $reponse;
protected $response;

/**
* @return SimpleXMLElement
*/
public function getResponse()
{
return $this->reponse;
return $this->response;
}

/**
Expand All @@ -29,7 +29,7 @@ public function getResponse()
*/
public function setResponse(SimpleXMLElement $response)
{
$this->reponse = $response;
$this->response = $response;
return $this;
}

Expand All @@ -50,4 +50,4 @@ public function setText($text)
$this->text = $text;
return $this;
}
}
}

0 comments on commit ac1ef51

Please sign in to comment.