Skip to content

Commit

Permalink
add exception message to custom exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
alibo committed Aug 14, 2015
1 parent f9024ca commit 6289d93
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/Nikapps/NikPay/PaymentProviders/Saman/SamanSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function it_should_throw_an_exception_when_verifying_is_failed($soap, $samanConf
$soap->call('verifyTransaction', $params)->willReturn(-3);

$this->shouldThrow(
new NotVerifiedException('Payment is not verified', -3)
new NotVerifiedException('Payment is not verified by bank', -3)
)->duringVerify('ref-123-123');
}

Expand Down
1 change: 1 addition & 0 deletions src/Exceptions/BankNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
class BankNotFoundException extends PaymentException
{

protected $message = "The given bank doesn't exist";
}
2 changes: 2 additions & 0 deletions src/Exceptions/DuplicateReferenceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
class DuplicateReferenceException extends PaymentException
{

protected $message = "The reference number already exists";

/**
* @var string
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Exceptions/FailedPaymentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
class FailedPaymentException extends PaymentException
{

protected $message = "Transaction was not successful";

/**
* Payment state
*
Expand Down
1 change: 1 addition & 0 deletions src/Exceptions/InvalidPostDataException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
class InvalidPostDataException extends PaymentException
{

protected $message = "Post data is invalid";
}
1 change: 1 addition & 0 deletions src/Exceptions/NotEqualAmountException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
class NotEqualAmountException extends PaymentException
{

protected $message = "Given amount form bank is not equal to provided amount";
/**
* @var string
*/
Expand Down
1 change: 1 addition & 0 deletions src/Exceptions/NotFoundConfigurationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
class NotFoundConfigurationException extends PaymentException
{

protected $message = "Configuration is not found for given bank";
}
2 changes: 1 addition & 1 deletion src/Exceptions/NotVerifiedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class NotVerifiedException extends PaymentException
{

protected $message = 'Payment is not verified';
protected $message = 'Payment is not verified by bank';

/**
* @var integer
Expand Down
2 changes: 2 additions & 0 deletions src/Exceptions/SoapException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
class SoapException extends PaymentException
{

protected $message = "SoapClient is failed";

/**
* SoapFault exception
*
Expand Down

0 comments on commit 6289d93

Please sign in to comment.