Skip to content

Commit 9d3d310

Browse files
Check pending status on response
1 parent c95f6e8 commit 9d3d310

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/Message/AbstractResponse.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ public function isSuccessful()
2121
// get response code
2222
$code = $this->getHttpResponseCode();
2323

24-
if ($code === 200) { // OK
25-
return true;
26-
}
27-
28-
if ($code === 202) { // Accepted
29-
return true;
30-
}
24+
return ($code === 200 || $code === 201);
25+
}
3126

32-
return false;
27+
/**
28+
* Is the transaction still processing? We will need to fetch it again
29+
* @return bool
30+
*/
31+
public function isPending()
32+
{
33+
return $this->getHttpResponseCode() === 202;
3334
}
3435

3536
/**

0 commit comments

Comments
 (0)