Skip to content

Commit 6e840be

Browse files
committed
Fixed TransactionStatusRequest and TransactionStatusResponse for retreiving the statusCode of the transaction.
1 parent 1cde4ff commit 6e840be

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/Message/TransactionStatusRequest.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,16 @@ public function sendData($data): ResponseInterface
3636
$data
3737
);
3838

39+
$response = array_merge(
40+
$this->getResponseBody(),
41+
[
42+
'statusCode' => $this->getResponse()->getStatusCode(),
43+
]
44+
);
45+
3946
return new TransactionStatusResponse(
4047
$this,
41-
$this->getResponseBody()
48+
$response
4249
);
4350
}
4451
}

src/Message/TransactionStatusResponse.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ class TransactionStatusResponse extends AbstractResponse
1212
*/
1313
public function isSuccessful(): bool
1414
{
15-
return parent::isSuccessful()
16-
&& in_array($this->data['statusCode'], [
17-
self::RESPONSE_STATUS_COMPLETED,
18-
self::RESPONSE_STATUS_SETTLED,
19-
]);
15+
return isset($this->data['statusCode']) && $this->data['statusCode'] === 200;
2016
}
2117

2218
/**

0 commit comments

Comments
 (0)