Skip to content

Commit 34e259b

Browse files
author
Mark O'Keeffe
committed
Allow 202 response to be treated as success for create session response
1 parent 9d3d310 commit 34e259b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Message/CreateSessionResponse.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
class CreateSessionResponse extends AbstractResponse
66
{
7+
/**
8+
* Is the transaction successful?
9+
* @return boolean True if successful
10+
*/
11+
public function isSuccessful()
12+
{
13+
// get response code
14+
$code = $this->getHttpResponseCode();
15+
16+
return ($code === 200 || $code === 201 || $code === 202);
17+
}
18+
19+
public function isPending()
20+
{
21+
return false;
22+
}
23+
724
public function getSessionId()
825
{
926
return $this->getData('id');

0 commit comments

Comments
 (0)