@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | return $slack_message |
| 49 | 49 | ->content('UnitPay payment message from '.config('app.url')) |
| 50 | - ->attachment(function (SlackAttachment $attachment) { |
|
| 50 | + ->attachment(function(SlackAttachment $attachment) { |
|
| 51 | 51 | $attachment->fields([ |
| 52 | 52 | 'Title' => $this->event->title, |
| 53 | 53 | 'IP' => $this->event->ip, |
@@ -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(UnitPayEvent::class, function ($event) { |
|
| 17 | + $events->listen(UnitPayEvent::class, function($event) { |
|
| 18 | 18 | $event->type = str_replace('unitpay.', '', $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('unitpay.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('unitpay.notificationFilter'); |
| 55 | 55 | |
| 56 | - if (! is_callable($callable)) { |
|
| 56 | + if (!is_callable($callable)) { |
|
| 57 | 57 | return true; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /* |
| 16 | 16 | * locale for payment form |
| 17 | 17 | */ |
| 18 | - 'locale' => 'ru', // ru || en |
|
| 18 | + 'locale' => 'ru', // ru || en |
|
| 19 | 19 | |
| 20 | 20 | /* |
| 21 | 21 | * Hide other payment methods |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | 'channels' => ['mail', 'slack'], |
| 82 | 82 | |
| 83 | 83 | 'mail' => [ |
| 84 | - 'to' => '', // your email |
|
| 84 | + 'to' => '', // your email |
|
| 85 | 85 | ], |
| 86 | 86 | |
| 87 | 87 | 'slack' => [ |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | ]; |
| 145 | 145 | |
| 146 | 146 | foreach ($required_fields as $key => $value) { |
| 147 | - if (! array_key_exists($value, $order) || empty($order[$value])) { |
|
| 147 | + if (!array_key_exists($value, $order) || empty($order[$value])) { |
|
| 148 | 148 | throw InvalidConfiguration::generatePaymentFormOrderParamsNotSet($value); |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | 'USD', |
| 158 | 158 | ]; |
| 159 | 159 | |
| 160 | - if (! in_array($order['CURRENCY'], $currency_arr)) { |
|
| 160 | + if (!in_array($order['CURRENCY'], $currency_arr)) { |
|
| 161 | 161 | throw InvalidConfiguration::generatePaymentFormOrderInvalidCurrency($order['CURRENCY']); |
| 162 | 162 | } |
| 163 | 163 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | public function validateOrderRequestFromGate(Request $request) |
| 243 | 243 | { |
| 244 | - if (! $this->AllowIP($request->ip()) || ! $this->validate($request) || ! $this->validateSignature($request)) { |
|
| 244 | + if (!$this->AllowIP($request->ip()) || !$this->validate($request) || !$this->validateSignature($request)) { |
|
| 245 | 245 | $this->eventFillAndSend('unitpay.error', 'validateOrderRequestFromGate', $request); |
| 246 | 246 | |
| 247 | 247 | return false; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | { |
| 261 | 261 | $callable = config('unitpay.SearchOrderFilter'); |
| 262 | 262 | |
| 263 | - if (! is_callable($callable)) { |
|
| 263 | + if (!is_callable($callable)) { |
|
| 264 | 264 | throw InvalidConfiguration::searchOrderFilterInvalid(); |
| 265 | 265 | } |
| 266 | 266 | |
@@ -276,25 +276,25 @@ discard block |
||
| 276 | 276 | |
| 277 | 277 | $order = $callable($request, $request->input('params.account')); |
| 278 | 278 | |
| 279 | - if (! $order) { |
|
| 279 | + if (!$order) { |
|
| 280 | 280 | $this->eventFillAndSend('unitpay.error', 'orderNotFound', $request); |
| 281 | 281 | |
| 282 | 282 | return false; |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | - if (! array_key_exists('orderStatus', $order)) { |
|
| 285 | + if (!array_key_exists('orderStatus', $order)) { |
|
| 286 | 286 | $this->eventFillAndSend('unitpay.error', 'orderStatusInvalid', $request); |
| 287 | 287 | |
| 288 | 288 | return false; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - if (! array_key_exists('orderSum', $order) && $request->input('params.orderSum') != $order['orderSum']) { |
|
| 291 | + if (!array_key_exists('orderSum', $order) && $request->input('params.orderSum') != $order['orderSum']) { |
|
| 292 | 292 | $this->eventFillAndSend('unitpay.error', 'orderSumInvalid', $request); |
| 293 | 293 | |
| 294 | 294 | return false; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | - if (! array_key_exists('orderCurrency', $order) && $request->input('params.orderCurrency') != $order['orderCurrency']) { |
|
| 297 | + if (!array_key_exists('orderCurrency', $order) && $request->input('params.orderCurrency') != $order['orderCurrency']) { |
|
| 298 | 298 | $this->eventFillAndSend('unitpay.error', 'orderCurrencyInvalid', $request); |
| 299 | 299 | |
| 300 | 300 | return false; |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | { |
| 315 | 315 | $callable = config('unitpay.PaidOrderFilter'); |
| 316 | 316 | |
| 317 | - if (! is_callable($callable)) { |
|
| 317 | + if (!is_callable($callable)) { |
|
| 318 | 318 | throw InvalidConfiguration::orderPaidFilterInvalid(); |
| 319 | 319 | } |
| 320 | 320 | |
@@ -330,14 +330,14 @@ discard block |
||
| 330 | 330 | public function payOrderFromGate(Request $request) |
| 331 | 331 | { |
| 332 | 332 | // Validate request params from UnitPay server. |
| 333 | - if (! $this->validateOrderRequestFromGate($request)) { |
|
| 333 | + if (!$this->validateOrderRequestFromGate($request)) { |
|
| 334 | 334 | return $this->responseError('validateOrderRequestFromGate'); |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | // Search and return order |
| 338 | 338 | $order = $this->callFilterSearchOrder($request); |
| 339 | 339 | |
| 340 | - if (! $order) { |
|
| 340 | + if (!$order) { |
|
| 341 | 341 | return $this->responseError('searchOrderFilter'); |
| 342 | 342 | } |
| 343 | 343 | |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | |
| 368 | 368 | // PaidOrderFilter - update order into DB as paid & other actions |
| 369 | 369 | // if return false then error |
| 370 | - if (! $this->callFilterPaidOrder($request, $order)) { |
|
| 370 | + if (!$this->callFilterPaidOrder($request, $order)) { |
|
| 371 | 371 | $this->eventFillAndSend('unitpay.error', 'callFilterPaidOrder', $request); |
| 372 | 372 | |
| 373 | 373 | return $this->responseError('callFilterPaidOrder'); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $this->app['events']->subscribe(UnitPayNotifier::class); |
| 37 | 37 | |
| 38 | - $this->app->singleton('unitpay', function () { |
|
| 38 | + $this->app->singleton('unitpay', function() { |
|
| 39 | 39 | return $this->app->make('ActionM\UnitPay\UnitPay'); |
| 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('unitpay.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('unitpay.paidOrderFilter'); |
| 61 | 61 | |
| 62 | - if (! is_callable($callable)) { |
|
| 62 | + if (!is_callable($callable)) { |
|
| 63 | 63 | throw InvalidConfiguration::orderPaidFilterInvalid(); |
| 64 | 64 | } |
| 65 | 65 | } |