Skip to content

Commit

Permalink
Merge pull request #19 from Qballinternet/feature/response-transactionid
Browse files Browse the repository at this point in the history
Added getTransactionId to CompletePurchaseResponse
  • Loading branch information
delatbabel authored Aug 10, 2016
2 parents 1f01f99 + beb091f commit 7fccd43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Message/CompletePurchaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,11 @@ public function getTransactionReference()
return $this->data['BRQ_PAYMENT'];
}
}

public function getTransactionId()
{
if (isset($this->data['BRQ_INVOICENUMBER'])) {
return $this->data['BRQ_INVOICENUMBER'];
}
}
}
2 changes: 2 additions & 0 deletions tests/Message/CompletePurchaseResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public function testSuccess()
'BRQ_STATUSCODE' => '190',
'BRQ_STATUSMESSAGE' => 'hi!',
'BRQ_PAYMENT' => '5',
'BRQ_INVOICENUMBER' => 'website-reference',
);

$response = new CompletePurchaseResponse($this->getMockRequest(), $data);
Expand All @@ -20,6 +21,7 @@ public function testSuccess()
$this->assertSame('190', $response->getCode());
$this->assertSame('hi!', $response->getMessage());
$this->assertSame('5', $response->getTransactionReference());
$this->assertSame('website-reference', $response->getTransactionId());
}

public function testEmpty()
Expand Down

0 comments on commit 7fccd43

Please sign in to comment.