Skip to content

Commit

Permalink
Merge pull request #3 from hiqsol/master
Browse files Browse the repository at this point in the history
Added CompletePurchaseResponse::getCurrency
  • Loading branch information
dercoder committed Feb 9, 2016
2 parents a5719e2 + 67b7b20 commit 4097622
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"require-dev": {
"omnipay/tests": "~2.0",
"satooshi/php-coveralls": "dev-master"
"satooshi/php-coveralls": "1.0.0"
},
"extra": {
"branch-alias": {
Expand Down
5 changes: 5 additions & 0 deletions src/Message/CompletePurchaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public function getAmount()
return $this->data['LMI_PAYMENT_AMOUNT'];
}

public function getCurrency()
{
return $this->request->getCurrencyByPurse($this->data['LMI_PAYEE_PURSE']);
}

public function getTestMode()
{
return (bool) $this->getMode();
Expand Down
3 changes: 3 additions & 0 deletions tests/Message/CompletePurchaseResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public function testSuccess()
$this->assertSame('892', $response->getTransactionReference());
$this->assertSame('Z123428476799', $response->getMerchantPurse());
$this->assertSame('14.65', $response->getAmount());
$this->assertSame('USD', $response->getCurrency());
$this->assertTrue($response->getTestMode());
$this->assertSame('1', $response->getMode());
$this->assertSame('0B12E75431284D6FCC05D8AF02B90AC28A0788FB95C9FF6B655344022F0746E5', $response->getHash());
Expand Down Expand Up @@ -122,6 +123,7 @@ public function testSha256Hash()
$this->assertSame('892', $response->getTransactionReference());
$this->assertSame('Z123428476799', $response->getMerchantPurse());
$this->assertSame('14.65', $response->getAmount());
$this->assertSame('USD', $response->getCurrency());
$this->assertTrue($response->getTestMode());
$this->assertSame('1', $response->getMode());
$this->assertSame('sha256', $response->getHashType());
Expand Down Expand Up @@ -155,6 +157,7 @@ public function testMd5Hash()
$this->assertSame('892', $response->getTransactionReference());
$this->assertSame('Z123428476799', $response->getMerchantPurse());
$this->assertSame('14.65', $response->getAmount());
$this->assertSame('USD', $response->getCurrency());
$this->assertTrue($response->getTestMode());
$this->assertSame('1', $response->getMode());
$this->assertSame('md5', $response->getHashType());
Expand Down

0 comments on commit 4097622

Please sign in to comment.