@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Allow access, if the ip address is in the whitelist. |
| 18 | - * @param $ip |
|
| 18 | + * @param string $ip |
|
| 19 | 19 | * @return bool |
| 20 | 20 | */ |
| 21 | 21 | public function allowIP($ip) |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Return 403 error code. |
| 33 | - * @param $message |
|
| 33 | + * @param string $message |
|
| 34 | 34 | * @return mixed |
| 35 | 35 | */ |
| 36 | 36 | public function responseError($message) |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Return YES success message. |
| 43 | - * @return mixed |
|
| 43 | + * @return string |
|
| 44 | 44 | */ |
| 45 | 45 | public function responseOK() |
| 46 | 46 | { |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Fill event details to pass the title and request params as array. |
| 52 | - * @param $event_type |
|
| 53 | - * @param $event_title |
|
| 52 | + * @param string $event_type |
|
| 53 | + * @param string $event_title |
|
| 54 | 54 | * @param Request $request |
| 55 | 55 | */ |
| 56 | 56 | public function eventFillAndSend($event_type, $event_title, Request $request) |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | /** |
| 318 | 318 | * Call PaidOrderFilter if order not paid. |
| 319 | 319 | * @param Request $request |
| 320 | - * @param $order |
|
| 320 | + * @param boolean $order |
|
| 321 | 321 | * @return mixed |
| 322 | 322 | * @throws InvalidConfiguration |
| 323 | 323 | */ |
@@ -135,13 +135,13 @@ discard block |
||
| 135 | 135 | ]; |
| 136 | 136 | |
| 137 | 137 | foreach ($required_fields as $key => $value) { |
| 138 | - if (! array_key_exists($value, $order) || empty($order[$value])) { |
|
| 138 | + if (!array_key_exists($value, $order) || empty($order[$value])) { |
|
| 139 | 139 | throw InvalidConfiguration::generatePaymentFormOrderParamsNotSet($value); |
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | // check if PAYMENT_NO is numeric |
| 144 | - if (! is_numeric($order['PAYMENT_NO'])) { |
|
| 144 | + if (!is_numeric($order['PAYMENT_NO'])) { |
|
| 145 | 145 | throw InvalidConfiguration::generatePaymentFormOrderInvalidPaymentNo('PAYMENT_NO'); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | public function validateOrderRequestFromGate(Request $request) |
| 240 | 240 | { |
| 241 | - if (! $this->AllowIP($request->ip()) || ! $this->validate($request) || ! $this->validatePayeePurse($request) || ! $this->validateSignature($request)) { |
|
| 241 | + if (!$this->AllowIP($request->ip()) || !$this->validate($request) || !$this->validatePayeePurse($request) || !$this->validateSignature($request)) { |
|
| 242 | 242 | $this->eventFillAndSend('webmoneymerchant.error', 'validateOrderRequestFromGate', $request); |
| 243 | 243 | |
| 244 | 244 | return false; |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | public function validateSearchOrderRequiredAttributes(Request $request, $order) |
| 257 | 257 | { |
| 258 | - if (! $order) { |
|
| 258 | + if (!$order) { |
|
| 259 | 259 | $this->eventFillAndSend('webmoneymerchant.error', 'orderNotFound', $request); |
| 260 | 260 | |
| 261 | 261 | return false; |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $attr = ['WEBMONEY_orderStatus', 'WEBMONEY_orderSum']; |
| 266 | 266 | |
| 267 | 267 | foreach ($attr as $k => $value) { |
| 268 | - if (! $order->getAttribute($value)) { |
|
| 268 | + if (!$order->getAttribute($value)) { |
|
| 269 | 269 | $this->eventFillAndSend('webmoneymerchant.error', $value.'Invalid', $request); |
| 270 | 270 | |
| 271 | 271 | return false; |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | { |
| 293 | 293 | $callable = config('webmoney-merchant.searchOrderFilter'); |
| 294 | 294 | |
| 295 | - if (! is_callable($callable)) { |
|
| 295 | + if (!is_callable($callable)) { |
|
| 296 | 296 | throw InvalidConfiguration::searchOrderFilterInvalid(); |
| 297 | 297 | } |
| 298 | 298 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | $order = $callable($request, $request->input('LMI_PAYMENT_NO')); |
| 309 | 309 | |
| 310 | - if (! $this->validateSearchOrderRequiredAttributes($request, $order)) { |
|
| 310 | + if (!$this->validateSearchOrderRequiredAttributes($request, $order)) { |
|
| 311 | 311 | return false; |
| 312 | 312 | } |
| 313 | 313 | |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | { |
| 326 | 326 | $callable = config('webmoney-merchant.paidOrderFilter'); |
| 327 | 327 | |
| 328 | - if (! is_callable($callable)) { |
|
| 328 | + if (!is_callable($callable)) { |
|
| 329 | 329 | throw InvalidConfiguration::orderPaidFilterInvalid(); |
| 330 | 330 | } |
| 331 | 331 | |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | */ |
| 344 | 344 | public function payOrderFromGate(Request $request) |
| 345 | 345 | { |
| 346 | - if (! $request->has('LMI_HASH')) { |
|
| 346 | + if (!$request->has('LMI_HASH')) { |
|
| 347 | 347 | return $this->responseError('LMI_HASH not set'); |
| 348 | 348 | } |
| 349 | 349 | |
@@ -352,14 +352,14 @@ discard block |
||
| 352 | 352 | } |
| 353 | 353 | |
| 354 | 354 | // Validate request params from WebMoney Merchant server. |
| 355 | - if (! $this->validateOrderRequestFromGate($request)) { |
|
| 355 | + if (!$this->validateOrderRequestFromGate($request)) { |
|
| 356 | 356 | return $this->responseError('validateOrderRequestFromGate'); |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | // Search and return order |
| 360 | 360 | $order = $this->callFilterSearchOrder($request); |
| 361 | 361 | |
| 362 | - if (! $order) { |
|
| 362 | + if (!$order) { |
|
| 363 | 363 | return $this->responseError('searchOrderFilter'); |
| 364 | 364 | } |
| 365 | 365 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | |
| 378 | 378 | // PaidOrderFilter - update order into DB as paid & other actions |
| 379 | 379 | // if return false then error |
| 380 | - if (! $this->callFilterPaidOrder($request, $order)) { |
|
| 380 | + if (!$this->callFilterPaidOrder($request, $order)) { |
|
| 381 | 381 | $this->eventFillAndSend('webmoneymerchant.error', 'callFilterPaidOrder', $request); |
| 382 | 382 | |
| 383 | 383 | return $this->responseError('callFilterPaidOrder'); |
@@ -14,10 +14,10 @@ discard block |
||
| 14 | 14 | public function subscribe(Dispatcher $events) |
| 15 | 15 | { |
| 16 | 16 | // Listen events and send notification |
| 17 | - $events->listen(WebMoneyMerchantEvent::class, function ($event) { |
|
| 17 | + $events->listen(WebMoneyMerchantEvent::class, function($event) { |
|
| 18 | 18 | $event->type = str_replace('webmoneymerchant.', '', $event->type); |
| 19 | 19 | |
| 20 | - if (! in_array($event->type, ['info', 'success', 'error'])) { |
|
| 20 | + if (!in_array($event->type, ['info', 'success', 'error'])) { |
|
| 21 | 21 | $event->type = 'error'; |
| 22 | 22 | } |
| 23 | 23 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $notification = app(config('webmoney-merchant.notification')); |
| 27 | 27 | $notification->setEvent($event); |
| 28 | 28 | |
| 29 | - if (! $this->isValidNotificationClass($notification)) { |
|
| 29 | + if (!$this->isValidNotificationClass($notification)) { |
|
| 30 | 30 | throw InvalidConfiguration::notificationClassInvalid(get_class($notification)); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $callable = config('webmoney-merchant.notificationFilter'); |
| 55 | 55 | |
| 56 | - if (! is_callable($callable)) { |
|
| 56 | + if (!is_callable($callable)) { |
|
| 57 | 57 | return true; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | |
| 52 | 52 | return $slack_message |
| 53 | 53 | ->content('WebMoneyMerchant payment message from '.config('app.url')) |
| 54 | - ->attachment(function (SlackAttachment $attachment) { |
|
| 54 | + ->attachment(function(SlackAttachment $attachment) { |
|
| 55 | 55 | $attachment->fields([ |
| 56 | 56 | 'Title' => $this->event->title, |
| 57 | 57 | 'IP' => $this->event->ip, |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $this->app['events']->subscribe(WebMoneyMerchantNotifier::class); |
| 37 | 37 | |
| 38 | - $this->app->singleton('webmoneymerchant', function () { |
|
| 38 | + $this->app->singleton('webmoneymerchant', function() { |
|
| 39 | 39 | return $this->app->make('ActionM\WebMoneyMerchant\WebMoneyMerchant'); |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -50,16 +50,16 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function testingEnv() |
| 52 | 52 | { |
| 53 | - if (! App::environment('testing')) { |
|
| 53 | + if (!App::environment('testing')) { |
|
| 54 | 54 | $callable = config('webmoney-merchant.searchOrderFilter'); |
| 55 | 55 | |
| 56 | - if (! is_callable($callable)) { |
|
| 56 | + if (!is_callable($callable)) { |
|
| 57 | 57 | throw InvalidConfiguration::searchOrderFilterInvalid(); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | $callable = config('webmoney-merchant.paidOrderFilter'); |
| 61 | 61 | |
| 62 | - if (! is_callable($callable)) { |
|
| 62 | + if (!is_callable($callable)) { |
|
| 63 | 63 | throw InvalidConfiguration::orderPaidFilterInvalid(); |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | /* |
| 25 | 25 | * locale for payment form |
| 26 | 26 | */ |
| 27 | - 'locale' => 'ru-RU', // ru-RU || en-US |
|
| 27 | + 'locale' => 'ru-RU', // ru-RU || en-US |
|
| 28 | 28 | |
| 29 | 29 | /* |
| 30 | 30 | * SearchOrderFilter |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | 'channels' => ['mail', 'slack'], |
| 83 | 83 | |
| 84 | 84 | 'mail' => [ |
| 85 | - 'to' => '', // your email |
|
| 85 | + 'to' => '', // your email |
|
| 86 | 86 | ], |
| 87 | 87 | |
| 88 | 88 | 'slack' => [ |