@@ -25,9 +25,9 @@ |
||
25 | 25 | * |
26 | 26 | * @return NotificationResponse |
27 | 27 | */ |
28 | - public function sendData( $data ) |
|
28 | + public function sendData($data) |
|
29 | 29 | { |
30 | - return $this->response = new NotificationResponse( $this, $data ); |
|
30 | + return $this->response = new NotificationResponse($this, $data); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | } |
@@ -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} |
@@ -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 | } |
@@ -26,9 +26,9 @@ |
||
26 | 26 | * |
27 | 27 | * @return CompletePurchaseResponse |
28 | 28 | */ |
29 | - public function sendData( $data ) |
|
29 | + public function sendData($data) |
|
30 | 30 | { |
31 | - return $this->response = new CompletePurchaseResponse( $this, $data ); |
|
31 | + return $this->response = new CompletePurchaseResponse($this, $data); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function getCheckoutId( ) |
31 | 31 | { |
32 | - return isset( $this->data[ 'ik_co_id' ] ) ? $this->data[ 'ik_co_id' ] : null; |
|
32 | + return isset($this->data[ 'ik_co_id' ]) ? $this->data[ 'ik_co_id' ] : null; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function getTransactionId( ) |
41 | 41 | { |
42 | - return isset( $this->data[ 'ik_pm_no' ] ) ? $this->data[ 'ik_pm_no' ] : null; |
|
42 | + return isset($this->data[ 'ik_pm_no' ]) ? $this->data[ 'ik_pm_no' ] : null; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function getTransactionStatus( ) |
59 | 59 | { |
60 | - return isset( $this->data[ 'ik_inv_st' ] ) ? $this->data[ 'ik_inv_st' ] : null; |
|
60 | + return isset($this->data[ 'ik_inv_st' ]) ? $this->data[ 'ik_inv_st' ] : null; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function getTransactionReference( ) |
67 | 67 | { |
68 | - return isset( $this->data[ 'ik_inv_id' ] ) ? $this->data[ 'ik_inv_id' ] : null; |
|
68 | + return isset($this->data[ 'ik_inv_id' ]) ? $this->data[ 'ik_inv_id' ] : null; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function getAmount( ) |
77 | 77 | { |
78 | - return isset( $this->data[ 'ik_am' ] ) ? $this->data[ 'ik_am' ] : null; |
|
78 | + return isset($this->data[ 'ik_am' ]) ? $this->data[ 'ik_am' ] : null; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function getCurrency( ) |
86 | 86 | { |
87 | - return isset( $this->data[ 'ik_cur' ] ) ? $this->data[ 'ik_cur' ] : null; |
|
87 | + return isset($this->data[ 'ik_cur' ]) ? $this->data[ 'ik_cur' ] : null; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function getTime( ) |
96 | 96 | { |
97 | - $requestDate = isset( $this->data[ 'ik_inv_prc' ] ) ? $this->data[ 'ik_inv_prc' ] : null; |
|
97 | + $requestDate = isset($this->data[ 'ik_inv_prc' ]) ? $this->data[ 'ik_inv_prc' ] : null; |
|
98 | 98 | |
99 | - return ( new \DateTime( $requestDate, new \DateTimeZone( 'Europe/Moscow' ) ) )->format( 'c' ); |
|
99 | + return (new \DateTime($requestDate, new \DateTimeZone('Europe/Moscow')))->format('c'); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -104,6 +104,6 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function getPayer( ) |
106 | 106 | { |
107 | - return isset( $this->data[ 'ik_pw_via' ] ) ? $this->data[ 'ik_pw_via' ] : null; |
|
107 | + return isset($this->data[ 'ik_pw_via' ]) ? $this->data[ 'ik_pw_via' ] : null; |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | \ No newline at end of file |
@@ -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 ); |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | * @param $value |
43 | 43 | * @return self |
44 | 44 | */ |
45 | - public function setPurse( $value ) |
|
45 | + public function setPurse($value) |
|
46 | 46 | { |
47 | - return $this->setCheckoutId( $value ); |
|
47 | + return $this->setCheckoutId($value); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getCheckoutId( ) |
56 | 56 | { |
57 | - return $this->getParameter( 'checkoutId' ); |
|
57 | + return $this->getParameter('checkoutId'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return self |
66 | 66 | */ |
67 | - public function setCheckoutId( $purse ) |
|
67 | + public function setCheckoutId($purse) |
|
68 | 68 | { |
69 | - return $this->setParameter( 'checkoutId', $purse ); |
|
69 | + return $this->setParameter('checkoutId', $purse); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function getSignAlgorithm( ) |
78 | 78 | { |
79 | - return strtolower( $this->getParameter( 'signAlgorithm' ) ); |
|
79 | + return strtolower($this->getParameter('signAlgorithm')); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @return self |
88 | 88 | */ |
89 | - public function setSignAlgorithm( $value ) |
|
89 | + public function setSignAlgorithm($value) |
|
90 | 90 | { |
91 | - return $this->setParameter( 'signAlgorithm', $value ); |
|
91 | + return $this->setParameter('signAlgorithm', $value); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function getSignKey( ) |
100 | 100 | { |
101 | - return $this->getParameter( 'signKey' ); |
|
101 | + return $this->getParameter('signKey'); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | * |
109 | 109 | * @return self |
110 | 110 | */ |
111 | - public function setSignKey( $value ) |
|
111 | + public function setSignKey($value) |
|
112 | 112 | { |
113 | - return $this->setParameter( 'signKey', $value ); |
|
113 | + return $this->setParameter('signKey', $value); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function getTestKey( ) |
122 | 122 | { |
123 | - return $this->getParameter( 'testKey' ); |
|
123 | + return $this->getParameter('testKey'); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @return self |
132 | 132 | */ |
133 | - public function setTestKey( $value ) |
|
133 | + public function setTestKey($value) |
|
134 | 134 | { |
135 | - return $this->setParameter( 'testKey', $value ); |
|
135 | + return $this->setParameter('testKey', $value); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function getReturnMethod( ) |
144 | 144 | { |
145 | - return $this->getParameter( 'returnMethod' ); |
|
145 | + return $this->getParameter('returnMethod'); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | * @param $returnMethod |
152 | 152 | * @return \Omnipay\Common\Message\AbstractRequest |
153 | 153 | */ |
154 | - public function setReturnMethod( $returnMethod ) |
|
154 | + public function setReturnMethod($returnMethod) |
|
155 | 155 | { |
156 | - return $this->setParameter( 'returnMethod', $returnMethod ); |
|
156 | + return $this->setParameter('returnMethod', $returnMethod); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function getCancelMethod( ) |
165 | 165 | { |
166 | - return $this->getParameter( 'cancelMethod' ); |
|
166 | + return $this->getParameter('cancelMethod'); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -172,9 +172,9 @@ discard block |
||
172 | 172 | * @param $cancelMethod |
173 | 173 | * @return \Omnipay\Common\Message\AbstractRequest |
174 | 174 | */ |
175 | - public function setCancelMethod( $cancelMethod ) |
|
175 | + public function setCancelMethod($cancelMethod) |
|
176 | 176 | { |
177 | - return $this->setParameter( 'cancelMethod', $cancelMethod ); |
|
177 | + return $this->setParameter('cancelMethod', $cancelMethod); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function getNotifyMethod() |
186 | 186 | { |
187 | - return $this->getParameter( 'notifyMethod' ); |
|
187 | + return $this->getParameter('notifyMethod'); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -193,9 +193,9 @@ discard block |
||
193 | 193 | * @param $notifyMethod |
194 | 194 | * @return \Omnipay\Common\Message\AbstractRequest |
195 | 195 | */ |
196 | - public function setNotifyMethod( $notifyMethod ) |
|
196 | + public function setNotifyMethod($notifyMethod) |
|
197 | 197 | { |
198 | - return $this->setParameter( 'notifyMethod', $notifyMethod ); |
|
198 | + return $this->setParameter('notifyMethod', $notifyMethod); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -205,14 +205,14 @@ discard block |
||
205 | 205 | * @param string $signKey |
206 | 206 | * @return string |
207 | 207 | */ |
208 | - public function calculateSign( $data, $signKey ) |
|
208 | + public function calculateSign($data, $signKey) |
|
209 | 209 | { |
210 | - unset( $data[ 'ik_sign' ] ); |
|
211 | - ksort( $data, SORT_STRING ); |
|
212 | - array_push( $data, $signKey ); |
|
210 | + unset($data[ 'ik_sign' ]); |
|
211 | + ksort($data, SORT_STRING); |
|
212 | + array_push($data, $signKey); |
|
213 | 213 | $signAlgorithm = $this->getSignAlgorithm( ); |
214 | - $signString = implode( ':', $data ); |
|
215 | - return base64_encode( hash( $signAlgorithm, $signString, true ) ); |
|
214 | + $signString = implode(':', $data); |
|
215 | + return base64_encode(hash($signAlgorithm, $signString, true)); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -223,20 +223,20 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function getData( ) |
225 | 225 | { |
226 | - if( $this->getTestMode( ) ) |
|
226 | + if ($this->getTestMode( )) |
|
227 | 227 | { |
228 | - $this->validate( 'testKey' ); |
|
228 | + $this->validate('testKey'); |
|
229 | 229 | } |
230 | 230 | else |
231 | 231 | { |
232 | - $this->validate( 'signKey' ); |
|
232 | + $this->validate('signKey'); |
|
233 | 233 | } |
234 | 234 | |
235 | - $result = []; |
|
236 | - $vars = array_merge( $this->httpRequest->query->all( ), $this->httpRequest->request->all( ) ); |
|
237 | - foreach( $vars as $key => $parameter ) |
|
235 | + $result = [ ]; |
|
236 | + $vars = array_merge($this->httpRequest->query->all( ), $this->httpRequest->request->all( )); |
|
237 | + foreach ($vars as $key => $parameter) |
|
238 | 238 | { |
239 | - if( strpos( $key, 'ik_' ) === 0 ) |
|
239 | + if (strpos($key, 'ik_') === 0) |
|
240 | 240 | { |
241 | 241 | $result[ $key ] = $parameter; |
242 | 242 | } |
@@ -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 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function getData( ) |
24 | 24 | { |
25 | - $this->validate( 'checkoutId', 'amount', 'currency', 'description', 'transactionId' ); |
|
25 | + $this->validate('checkoutId', 'amount', 'currency', 'description', 'transactionId'); |
|
26 | 26 | |
27 | 27 | $return = [ |
28 | 28 | 'ik_co_id' => $this->getCheckoutId( ), |
@@ -32,49 +32,49 @@ discard block |
||
32 | 32 | 'ik_cur' => $this->getCurrency( ), |
33 | 33 | ]; |
34 | 34 | |
35 | - if( $ik_pnd_u = $this->getReturnUrl( ) ) |
|
35 | + if ($ik_pnd_u = $this->getReturnUrl( )) |
|
36 | 36 | { |
37 | 37 | $return[ 'ik_pnd_u' ] = $ik_pnd_u; |
38 | 38 | |
39 | - if( $ik_pnd_m = $this->getReturnMethod( ) ) |
|
39 | + if ($ik_pnd_m = $this->getReturnMethod( )) |
|
40 | 40 | { |
41 | 41 | $return[ 'ik_pnd_m' ] = $ik_pnd_m; |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | - if( $ik_suc_u = $this->getReturnUrl( ) ) |
|
45 | + if ($ik_suc_u = $this->getReturnUrl( )) |
|
46 | 46 | { |
47 | 47 | $return[ 'ik_suc_u' ] = $ik_suc_u; |
48 | 48 | |
49 | - if( $ik_suc_m = $this->getReturnMethod( ) ) |
|
49 | + if ($ik_suc_m = $this->getReturnMethod( )) |
|
50 | 50 | { |
51 | 51 | $return[ 'ik_suc_m' ] = $ik_suc_m; |
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | - if( $ik_fal_u = $this->getCancelUrl( ) ) |
|
55 | + if ($ik_fal_u = $this->getCancelUrl( )) |
|
56 | 56 | { |
57 | 57 | $return[ 'ik_fal_u' ] = $ik_fal_u; |
58 | 58 | |
59 | - if( $ik_fal_m = $this->getCancelMethod( ) ) |
|
59 | + if ($ik_fal_m = $this->getCancelMethod( )) |
|
60 | 60 | { |
61 | 61 | $return[ 'ik_fal_m' ] = $ik_fal_m; |
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
65 | - if( $ik_ia_u = $this->getNotifyUrl( ) ) |
|
65 | + if ($ik_ia_u = $this->getNotifyUrl( )) |
|
66 | 66 | { |
67 | 67 | $return[ 'ik_ia_u' ] = $ik_ia_u; |
68 | 68 | |
69 | - if( $ik_ia_m = $this->getNotifyMethod( ) ) |
|
69 | + if ($ik_ia_m = $this->getNotifyMethod( )) |
|
70 | 70 | { |
71 | 71 | $return[ 'ik_ia_m' ] = $ik_ia_m; |
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | - if( $signKey = $this->getSignKey( ) ) |
|
75 | + if ($signKey = $this->getSignKey( )) |
|
76 | 76 | { |
77 | - $return[ 'ik_sign' ] = $this->calculateSign( $return, $signKey ); |
|
77 | + $return[ 'ik_sign' ] = $this->calculateSign($return, $signKey); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | return $return; |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | * @param mixed $data |
86 | 86 | * @return PurchaseResponse |
87 | 87 | */ |
88 | - public function sendData( $data ) |
|
88 | + public function sendData($data) |
|
89 | 89 | { |
90 | - return $this->response = new PurchaseResponse( $this, $data ); |
|
90 | + return $this->response = new PurchaseResponse($this, $data); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | * @param $value |
59 | 59 | * @return self |
60 | 60 | */ |
61 | - public function setPurse( $value ) |
|
61 | + public function setPurse($value) |
|
62 | 62 | { |
63 | - return $this->setCheckoutId( $value ); |
|
63 | + return $this->setCheckoutId($value); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | * @param string $value merchant secret - sign key |
78 | 78 | * @return self |
79 | 79 | */ |
80 | - public function setSecret( $value ) |
|
80 | + public function setSecret($value) |
|
81 | 81 | { |
82 | - return $this->setSignKey( $value ); |
|
82 | + return $this->setSignKey($value); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function getCheckoutId( ) |
91 | 91 | { |
92 | - return $this->getParameter( 'checkoutId' ); |
|
92 | + return $this->getParameter('checkoutId'); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | * |
100 | 100 | * @return self |
101 | 101 | */ |
102 | - public function setCheckoutId( $value ) |
|
102 | + public function setCheckoutId($value) |
|
103 | 103 | { |
104 | - return $this->setParameter( 'checkoutId', $value ); |
|
104 | + return $this->setParameter('checkoutId', $value); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function getSignAlgorithm( ) |
113 | 113 | { |
114 | - return $this->getParameter( 'signAlgorithm' ); |
|
114 | + return $this->getParameter('signAlgorithm'); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @return self |
123 | 123 | */ |
124 | - public function setSignAlgorithm( $value ) |
|
124 | + public function setSignAlgorithm($value) |
|
125 | 125 | { |
126 | - return $this->setParameter( 'signAlgorithm', $value ); |
|
126 | + return $this->setParameter('signAlgorithm', $value); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function getSignKey( ) |
135 | 135 | { |
136 | - return $this->getParameter( 'signKey' ); |
|
136 | + return $this->getParameter('signKey'); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | * |
144 | 144 | * @return self |
145 | 145 | */ |
146 | - public function setSignKey( $value ) |
|
146 | + public function setSignKey($value) |
|
147 | 147 | { |
148 | - return $this->setParameter( 'signKey', $value ); |
|
148 | + return $this->setParameter('signKey', $value); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function getTestKey( ) |
157 | 157 | { |
158 | - return $this->getParameter( 'testKey' ); |
|
158 | + return $this->getParameter('testKey'); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | * |
166 | 166 | * @return self |
167 | 167 | */ |
168 | - public function setTestKey( $value ) |
|
168 | + public function setTestKey($value) |
|
169 | 169 | { |
170 | - return $this->setParameter( 'testKey', $value ); |
|
170 | + return $this->setParameter('testKey', $value); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | * |
176 | 176 | * @return \Omnipay\InterKassa\Message\PurchaseReques |
177 | 177 | */ |
178 | - public function purchase( array $parameters = [] ) |
|
178 | + public function purchase(array $parameters = [ ]) |
|
179 | 179 | { |
180 | 180 | $requestClass = '\Omnipay\InterKassa\Message\PurchaseRequest'; |
181 | 181 | |
182 | - return $this->createRequest( $requestClass, $parameters ); |
|
182 | + return $this->createRequest($requestClass, $parameters); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | * |
188 | 188 | * @return \Omnipay\InterKassa\Message\CompletePurchaseRequest |
189 | 189 | */ |
190 | - public function completePurchase( array $parameters = [] ) |
|
190 | + public function completePurchase(array $parameters = [ ]) |
|
191 | 191 | { |
192 | 192 | $requestClass = '\Omnipay\InterKassa\Message\CompletePurchaseRequest'; |
193 | 193 | |
194 | - return $this->createRequest( $requestClass, $parameters ); |
|
194 | + return $this->createRequest($requestClass, $parameters); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -199,11 +199,11 @@ discard block |
||
199 | 199 | * |
200 | 200 | * @return \Omnipay\InterKassa\Message\NotificationRequest |
201 | 201 | */ |
202 | - public function acceptNotification( array $parameters = [] ) |
|
202 | + public function acceptNotification(array $parameters = [ ]) |
|
203 | 203 | { |
204 | 204 | $requestClass = '\Omnipay\InterKassa\Message\NotificationRequest'; |
205 | 205 | |
206 | - return $this->createRequest( $requestClass, $parameters ); |
|
206 | + return $this->createRequest($requestClass, $parameters); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | } |
@@ -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 | } |
@@ -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 | } |