@@ -29,18 +29,18 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * {@inheritdoc} |
| 31 | 31 | */ |
| 32 | - public function __construct( RequestInterface $request, $data ) |
|
| 32 | + public function __construct(RequestInterface $request, $data) |
|
| 33 | 33 | { |
| 34 | - parent::__construct( $request, $data ); |
|
| 34 | + parent::__construct($request, $data); |
|
| 35 | 35 | |
| 36 | 36 | $signKey = $this->request->getTestMode( ) ? $this->request->getTestKey( ) : $this->request->getSignKey( ); |
| 37 | - $signExpected = $this->request->calculateSign( $this->data, $signKey ); |
|
| 37 | + $signExpected = $this->request->calculateSign($this->data, $signKey); |
|
| 38 | 38 | |
| 39 | - if( $this->getCheckoutId( ) !== $this->request->getCheckoutId( ) ) |
|
| 39 | + if ($this->getCheckoutId( ) !== $this->request->getCheckoutId( )) |
|
| 40 | 40 | { |
| 41 | 41 | $this->errorMessage = 'Wrong checkout ID'; |
| 42 | 42 | } |
| 43 | - else if( $this->getSign( ) !== $signExpected ) |
|
| 43 | + else if ($this->getSign( ) !== $signExpected) |
|
| 44 | 44 | { |
| 45 | 45 | $this->errorMessage = 'Failed to validate signature'; |
| 46 | 46 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function isSuccessful( ) |
| 55 | 55 | { |
| 56 | - if( !empty( $this->errorMessage ) ) |
|
| 56 | + if (!empty($this->errorMessage)) |
|
| 57 | 57 | { |
| 58 | 58 | return false; |
| 59 | 59 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function getSign( ) |
| 70 | 70 | { |
| 71 | - return isset( $this->data[ 'ik_sign' ] ) ? $this->data[ 'ik_sign' ] : null; |
|
| 71 | + return isset($this->data[ 'ik_sign' ]) ? $this->data[ 'ik_sign' ] : null; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -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 | } |
@@ -48,11 +48,11 @@ |
||
| 48 | 48 | /** |
| 49 | 49 | * {@inheritdoc} |
| 50 | 50 | */ |
| 51 | - public function __construct( RequestInterface $request, $data ) |
|
| 51 | + public function __construct(RequestInterface $request, $data) |
|
| 52 | 52 | { |
| 53 | - parent::__construct( $request, $data ); |
|
| 53 | + parent::__construct($request, $data); |
|
| 54 | 54 | |
| 55 | - if( $this->getCheckoutId( ) !== $this->request->getCheckoutId( ) ) |
|
| 55 | + if ($this->getCheckoutId( ) !== $this->request->getCheckoutId( )) |
|
| 56 | 56 | { |
| 57 | 57 | $this->errorMessage = 'Wrong checkout ID'; |
| 58 | 58 | } |