Skip to content

Commit c252d12

Browse files
Merge pull request #7 from moveis-simonetti/feature/analise-risco
Ajustes no toArray
2 parents db4d35a + d393969 commit c252d12

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Braspag/Lib/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static protected function capitalizeRequestData($data)
3838

3939
$data[ucfirst($key)] = $value;
4040

41-
if (ctype_lower($key{0})) {
41+
if (is_string($key) && ctype_lower($key{0})) {
4242
unset($data[$key]);
4343
}
4444
}

src/Braspag/Model/Antifraud/FraudAnalysis.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public function toArray()
9898
'captureOnLowRisk' => $this->isCaptureOnLowRisk(),
9999
'voidOnHighRisk' => $this->isVoidOnHighRisk(),
100100
'status' => $this->getStatus(),
101-
'browser' => $this->getBrowser()->toArray(),
102-
'cart' => $this->getCart()->toArray(),
101+
'browser' => (($this->getBrowser()) ? $this->getBrowser()->toArray() : null),
102+
'cart' => (($this->getCart()) ? $this->getCart()->toArray() : null),
103103
'replyData' => ($this->getReplyData()) ? $this->getReplyData()->toArray() : null,
104104
];
105105
}

0 commit comments

Comments
 (0)