diff --git a/composer.json b/composer.json index c675925..13d18d6 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "require-dev": { "omnipay/tests": "~2.0", - "satooshi/php-coveralls": "dev-master" + "satooshi/php-coveralls": "1.0.0" }, "extra": { "branch-alias": { diff --git a/src/Message/CompletePurchaseResponse.php b/src/Message/CompletePurchaseResponse.php index 0e0bf4e..6d54a90 100644 --- a/src/Message/CompletePurchaseResponse.php +++ b/src/Message/CompletePurchaseResponse.php @@ -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(); diff --git a/tests/Message/CompletePurchaseResponseTest.php b/tests/Message/CompletePurchaseResponseTest.php index 75b0f8b..7360f29 100644 --- a/tests/Message/CompletePurchaseResponseTest.php +++ b/tests/Message/CompletePurchaseResponseTest.php @@ -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()); @@ -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()); @@ -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());