Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #9 from comicrelief/getTransactionId-fix
Browse files Browse the repository at this point in the history
Fix `getTransactionId()` so it really returns a string as advertised
  • Loading branch information
ayanozturk authored Aug 23, 2017
2 parents 3df5ab1 + 3f99b18 commit c530ede
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Omnipay/WorldpayCGHosted/Message/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getTransactionId()
$attributes = $this->getOrder()->attributes();

if (isset($attributes['orderCode'])) {
return $attributes['orderCode'];
return (string) $attributes['orderCode'];
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function testAuthorisedValid()
$this->assertFalse($notification->isPending());
$this->assertFalse($notification->isCancelled());
$this->assertEquals('AUTHORISED', $notification->getStatus());
$this->assertInternalType('string', $notification->getTransactionId());
$this->assertEquals('11001100-0000-0000-0000-000011110101', $notification->getTransactionId());

$this->assertEquals('[OK]', $notification->getResponseBody());
Expand Down
1 change: 1 addition & 0 deletions tests/Omnipay/WorldpayCGHosted/Message/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function testPurchaseSuccessRedirect()

$this->assertTrue($response->isRedirect());
$this->assertFalse($response->isSuccessful());
$this->assertInternalType('string', $response->getTransactionId());
$this->assertEquals('11001100-0000-0000-0000-000011110101', $response->getTransactionId());
$this->assertEquals('PENDING', $response->getMessage());
}
Expand Down

0 comments on commit c530ede

Please sign in to comment.