Skip to content

Commit

Permalink
v1.3.1
Browse files Browse the repository at this point in the history
- improving exception handling
- minor fixes
  • Loading branch information
wpawel committed Sep 2, 2021
1 parent 43a24f5 commit cb9edc1
Show file tree
Hide file tree
Showing 57 changed files with 260 additions and 28 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>dotpay</name>
<displayName><![CDATA[Dotpay Payments]]></displayName>
<version><![CDATA[1.3.0]]></version>
<version><![CDATA[1.3.1]]></version>
<description><![CDATA[This module allows to pay via Dotpay]]></description>
<author><![CDATA[Dotpay]]></author>
<tab><![CDATA[payments_gateways]]></tab>
Expand Down
2 changes: 1 addition & 1 deletion config_pl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>dotpay</name>
<displayName><![CDATA[Płatności Dotpay]]></displayName>
<version><![CDATA[1.3.0]]></version>
<version><![CDATA[1.3.1]]></version>
<description><![CDATA[Ten moduł pozwala dokonywać płatności przy pomocy bramki płatności Dotpay]]></description>
<author><![CDATA[Dotpay]]></author>
<tab><![CDATA[payments_gateways]]></tab>
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function (Operation $operation) use ($config, $loader) {
} catch (ConfirmationInfoException $ex) {
die($ex->getMessage());
} catch (RuntimeException $ex) {
die('EXCEPTION! '.get_class($ex).' '.$ex->getMessage());
die('EXCEPTION! '.get_class($ex).' : '.$ex->getMessage());
}
}

Expand Down
2 changes: 1 addition & 1 deletion dotpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function __construct()
{
$this->name = 'dotpay';
$this->tab = 'payments_gateways';
$this->version = '1.3.0';
$this->version = '1.3.1';
$this->author = 'Dotpay';
$this->need_instance = 1;
$this->is_eu_compatible = 1;
Expand Down
5 changes: 5 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/AmountException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@
*/
class AmountException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect amount: %1';

}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/ApiVersionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class ApiVersionException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect api version: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/BNumberException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class BNumberException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect building number: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/BankNumberException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class BankNumberException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect bank account number: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/BlikCodeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@
*/
class BlikCodeException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect Blik code: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/CardMaskException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class CardMaskException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect card mask: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/ChannelIdException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class ChannelIdException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect channel id: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/CityException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class CityException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect city name: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/CountryException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class CountryException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect country name: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/CurrencyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class CurrencyException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect currency: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/EmailException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class EmailException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect email address: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/FirstnameException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class FirstnameException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect first name: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/IdException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class IdException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect seller id: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/LanguageException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class LanguageException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect language: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/LastnameException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class LastnameException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect last name: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/MccException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class MccException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect MCC number: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/MethodException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class MethodException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect method: %1';
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class OperationNumberException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect operation number: %1';
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class OperationStatusException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect operation status: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/OperationTypeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class OperationTypeException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect operation type: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/PasswordException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class PasswordException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect Dotpay password';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/PhoneException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class PhoneException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect phone number: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/PinException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class PinException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect seller pin';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/PostCodeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class PostCodeException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect post code: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/StreetException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class StreetException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect street: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/UrlException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class UrlException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect url address: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadParameter/UsernameException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class UsernameException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Incorrect Dotpay username: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/BadReturn/TypeNotCompatibleException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class TypeNotCompatibleException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Returned type is not compatible with an expected type. Details: %1';
}
17 changes: 17 additions & 0 deletions sdk/Dotpay/Exception/DotpayException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,21 @@
*/
class DotpayException extends \RuntimeException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'An error with Dotpay translations has been occured. Details: %1';

/**
* Initialize locale exception.
*
* @param string $message Details of exception
* @param int $code Code of exception
* @param \Exception $previous The previous exception used for the exception chaining
*/
public function __construct($message = '', $code = 0, $previous = null)
{
parent::__construct(str_replace('%1', $message, static::MESSAGE), $code, $previous);
}

}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/FileNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class FileNotFoundException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = "File '%1' is not found";
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/IncompleteDataException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class IncompleteDataException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Given data is incompleted';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/Loader/EmptyObjectNameException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class EmptyObjectNameException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception
*/
const MESSAGE = "Name of the object '%1' is empty";
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/Loader/ObjectNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class ObjectNotFoundException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception
*/
const MESSAGE = "Object '%1' is not found";
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/Loader/ParamNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class ParamNotFoundException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception
*/
const MESSAGE = "Param '%1' is not found";
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/Loader/XmlNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
*/
class XmlNotFoundException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = "XML file '%1' is not found";
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/Processor/ConfirmationDataException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class ConfirmationDataException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Error with confirmation data from Dotpay server: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/Processor/ConfirmationInfoException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class ConfirmationInfoException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Access denied: %1';
}
4 changes: 4 additions & 0 deletions sdk/Dotpay/Exception/Processor/IncorrectRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
*/
class IncorrectRequestException extends \Dotpay\Exception\DotpayException
{
/**
* Message of error thrown by the exception.
*/
const MESSAGE = 'Error with confirmation data from Dotpay server: %1';
}
Loading

0 comments on commit cb9edc1

Please sign in to comment.