Skip to content
This repository was archived by the owner on Jul 29, 2020. It is now read-only.

Commit 433902f

Browse files
committed
#17 - Parsing result of Automatic invoice matching call fixed
1 parent 0292e9e commit 433902f

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/FlexiPeeHP/FlexiBeeRO.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ public function setupProperty($options, $name, $constant = null)
487487
{
488488
if (array_key_exists($name, $options)) {
489489
$this->$name = $options[$name];
490+
} elseif (array_key_exists($constant, $options)) {
491+
$this->$name = $options[$constant];
490492
} else {
491493
if (property_exists($this, $name) && !empty($constant) && defined($constant)) {
492494
$this->$name = constant($constant);
@@ -1032,8 +1034,9 @@ public function parseResponse($responseDecoded, $responseCode)
10321034
}
10331035

10341036
$this->lastResult = $mainResult;
1035-
1036-
if (!is_null($mainResult)) {
1037+
if (array_key_exists('stats', $responseDecoded)) {
1038+
$this->responseStats = $responseDecoded['stats'];
1039+
} elseif (!empty($mainResult)) {
10371040
if (array_key_exists('success', $mainResult) && ($mainResult['success']
10381041
== 'false')) {
10391042
$this->responseStats = ['read' => 0];
@@ -1042,7 +1045,7 @@ public function parseResponse($responseDecoded, $responseCode)
10421045
} else {
10431046
$this->responseStats = ['read' => empty($this->rowCount)
10441047
? count($mainResult[$this->getResponseEvidence()])
1045-
: $this->rowCount];
1048+
: $this->rowCount];
10461049
}
10471050
}
10481051
break;

0 commit comments

Comments
 (0)