@@ -30,15 +30,15 @@ |
||
| 30 | 30 | return false; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Is the response successful? |
|
| 35 | - * |
|
| 36 | - * @return boolean |
|
| 37 | - */ |
|
| 38 | - public function isPending( ) |
|
| 39 | - { |
|
| 40 | - return true; |
|
| 41 | - } |
|
| 33 | + /** |
|
| 34 | + * Is the response successful? |
|
| 35 | + * |
|
| 36 | + * @return boolean |
|
| 37 | + */ |
|
| 38 | + public function isPending( ) |
|
| 39 | + { |
|
| 40 | + return true; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * {@inheritdoc} |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest |
| 18 | 18 | { |
| 19 | - /** |
|
| 19 | + /** |
|
| 20 | 20 | * {@inheritdoc} |
| 21 | 21 | */ |
| 22 | 22 | protected $zeroAmountAllowed = false; |
@@ -199,13 +199,13 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
| 202 | - * Calculates sign for the $data. |
|
| 203 | - * |
|
| 204 | - * @param array $data |
|
| 205 | - * @param string $signKey |
|
| 206 | - * @return string |
|
| 207 | - */ |
|
| 208 | - public function calculateSign( $data, $signKey ) |
|
| 202 | + * Calculates sign for the $data. |
|
| 203 | + * |
|
| 204 | + * @param array $data |
|
| 205 | + * @param string $signKey |
|
| 206 | + * @return string |
|
| 207 | + */ |
|
| 208 | + public function calculateSign( $data, $signKey ) |
|
| 209 | 209 | { |
| 210 | 210 | unset( $data[ 'ik_sign' ] ); |
| 211 | 211 | ksort( $data, SORT_STRING ); |
@@ -226,8 +226,7 @@ |
||
| 226 | 226 | if( $this->getTestMode( ) ) |
| 227 | 227 | { |
| 228 | 228 | $this->validate( 'testKey' ); |
| 229 | - } |
|
| 230 | - else |
|
| 229 | + } else |
|
| 231 | 230 | { |
| 232 | 231 | $this->validate( 'signKey' ); |
| 233 | 232 | } |
@@ -18,51 +18,51 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class PurchaseResponse extends \Omnipay\Common\Message\AbstractResponse implements RedirectResponseInterface |
| 20 | 20 | { |
| 21 | - /** |
|
| 22 | - * @var string URL to redirect client to payment system. Used when [[isRedirect]] |
|
| 23 | - */ |
|
| 24 | - protected $_redirect = 'https://sci.interkassa.com/'; |
|
| 21 | + /** |
|
| 22 | + * @var string URL to redirect client to payment system. Used when [[isRedirect]] |
|
| 23 | + */ |
|
| 24 | + protected $_redirect = 'https://sci.interkassa.com/'; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Always returns `false`, because InterKassa always needs redirect |
|
| 28 | - * {@inheritdoc} |
|
| 29 | - */ |
|
| 30 | - public function isSuccessful( ) |
|
| 31 | - { |
|
| 32 | - return false; |
|
| 33 | - } |
|
| 26 | + /** |
|
| 27 | + * Always returns `false`, because InterKassa always needs redirect |
|
| 28 | + * {@inheritdoc} |
|
| 29 | + */ |
|
| 30 | + public function isSuccessful( ) |
|
| 31 | + { |
|
| 32 | + return false; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Always returns `true`, because InterKassa always needs redirect |
|
| 37 | - * {@inheritdoc} |
|
| 38 | - */ |
|
| 39 | - public function isRedirect( ) |
|
| 40 | - { |
|
| 41 | - return true; |
|
| 42 | - } |
|
| 35 | + /** |
|
| 36 | + * Always returns `true`, because InterKassa always needs redirect |
|
| 37 | + * {@inheritdoc} |
|
| 38 | + */ |
|
| 39 | + public function isRedirect( ) |
|
| 40 | + { |
|
| 41 | + return true; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * {@inheritdoc} |
|
| 46 | - */ |
|
| 47 | - public function getRedirectUrl( ) |
|
| 48 | - { |
|
| 49 | - return $this->_redirect; |
|
| 50 | - } |
|
| 44 | + /** |
|
| 45 | + * {@inheritdoc} |
|
| 46 | + */ |
|
| 47 | + public function getRedirectUrl( ) |
|
| 48 | + { |
|
| 49 | + return $this->_redirect; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Always `POST` for InterKassa |
|
| 54 | - * {@inheritdoc} |
|
| 55 | - */ |
|
| 56 | - public function getRedirectMethod( ) |
|
| 57 | - { |
|
| 58 | - return 'POST'; |
|
| 59 | - } |
|
| 52 | + /** |
|
| 53 | + * Always `POST` for InterKassa |
|
| 54 | + * {@inheritdoc} |
|
| 55 | + */ |
|
| 56 | + public function getRedirectMethod( ) |
|
| 57 | + { |
|
| 58 | + return 'POST'; |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * {@inheritdoc} |
|
| 63 | - */ |
|
| 64 | - public function getRedirectData( ) |
|
| 65 | - { |
|
| 66 | - return $this->data; |
|
| 67 | - } |
|
| 61 | + /** |
|
| 62 | + * {@inheritdoc} |
|
| 63 | + */ |
|
| 64 | + public function getRedirectData( ) |
|
| 65 | + { |
|
| 66 | + return $this->data; |
|
| 67 | + } |
|
| 68 | 68 | } |
@@ -39,8 +39,7 @@ discard block |
||
| 39 | 39 | if( $this->getCheckoutId( ) !== $this->request->getCheckoutId( ) ) |
| 40 | 40 | { |
| 41 | 41 | $this->errorMessage = 'Wrong checkout ID'; |
| 42 | - } |
|
| 43 | - else if( $this->getSign( ) !== $signExpected ) |
|
| 42 | + } else if( $this->getSign( ) !== $signExpected ) |
|
| 44 | 43 | { |
| 45 | 44 | $this->errorMessage = 'Failed to validate signature'; |
| 46 | 45 | } |
@@ -56,8 +55,7 @@ discard block |
||
| 56 | 55 | if( !empty( $this->errorMessage ) ) |
| 57 | 56 | { |
| 58 | 57 | return false; |
| 59 | - } |
|
| 60 | - else |
|
| 58 | + } else |
|
| 61 | 59 | { |
| 62 | 60 | return $this->getTransactionStatus( ) === 'success'; |
| 63 | 61 | } |