Permalink
Browse files

fix exception in amount method

  • Loading branch information...
1 parent 552eede commit fa957de5612b3abba120a93ae6cfedbc78be6c51 @akDeveloper committed Feb 26, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/AktiveMerchant/Billing/Gateway.php
View
7 lib/AktiveMerchant/Billing/Gateway.php
@@ -150,8 +150,11 @@ public function isTest()
}
/**
- * @throws AktiveMerchant\Billing\Exception
+ * Accepts the anount of money in base unit and returns cants or base unit
+ * amount according to the @see $money_format propery.
*
+ * @throws \InvalidArgumentException
+ * @param $money The amount of money in base unit, not in cents.
* @access public
* @return integer|float
*/
@@ -162,7 +165,7 @@ public function amount($money)
$cents = $money * 100;
if (!is_numeric($money) || $money < 0) {
- throw new Exception('money amount must be a positive Integer in cents.');
+ throw new \InvalidArgumentException('money amount must be a positive number.');
}
return ($this->money_format() == 'cents')

0 comments on commit fa957de

Please sign in to comment.