@@ -54,7 +54,7 @@ |
||
| 54 | 54 | | These are the fields that are optional for making a payment. |
| 55 | 55 | | |
| 56 | 56 | */ |
| 57 | - 'optional_fields' => array_map(function ($i) { |
|
| 57 | + 'optional_fields' => array_map(function($i) { |
|
| 58 | 58 | return "udf{$i}"; |
| 59 | 59 | }, range(1, 10)), |
| 60 | 60 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | protected $config; |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * @param array $transaction_ids |
|
| 21 | + * @param string $transaction_ids |
|
| 22 | 22 | * @param string $account |
| 23 | 23 | */ |
| 24 | 24 | public function __construct($transaction_ids, $account = null) |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function boot() |
| 54 | 54 | { |
| 55 | - if (! $this->account) { |
|
| 55 | + if (!$this->account) { |
|
| 56 | 56 | $this->account = config('payu.default'); |
| 57 | 57 | } |
| 58 | 58 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('payu_payments', function (Blueprint $table) { |
|
| 16 | + Schema::create('payu_payments', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('account'); |
| 19 | 19 | $table->unsignedInteger('payable_id')->nullable(); |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | /** |
| 13 | 13 | * Set Redirect URL. |
| 14 | 14 | * |
| 15 | - * @param $url |
|
| 15 | + * @param string $url |
|
| 16 | 16 | * @param array $parameters |
| 17 | 17 | * @param null $secure |
| 18 | 18 | * @return $this |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * Set Redirect Action. |
| 29 | 29 | * |
| 30 | - * @param $action |
|
| 30 | + * @param string $action |
|
| 31 | 31 | * @param array|null $parameters |
| 32 | 32 | * @param bool $absolute |
| 33 | 33 | * @return $this |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * Set Redirect Action. |
| 44 | 44 | * |
| 45 | - * @param $route |
|
| 45 | + * @param string $route |
|
| 46 | 46 | * @param array|null $parameters |
| 47 | 47 | * @param bool $absolute |
| 48 | 48 | * @return $this |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * @return mixed |
|
| 58 | + * @return string |
|
| 59 | 59 | */ |
| 60 | 60 | public function getUrl() |
| 61 | 61 | { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | protected function fields() |
| 44 | 44 | { |
| 45 | 45 | $txn_string = implode('|', $this->txnIds); |
| 46 | - $hash_str = $this->config->getKey() . '|' . $this->command . '|' . $txn_string . '|' . $this->config->getSalt(); |
|
| 46 | + $hash_str = $this->config->getKey().'|'.$this->command.'|'.$txn_string.'|'.$this->config->getSalt(); |
|
| 47 | 47 | |
| 48 | 48 | return [ |
| 49 | 49 | 'key' => $this->config->getKey(), |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $response = ['status' => true, 'data' => [], 'message' => '']; |
| 77 | 77 | |
| 78 | 78 | foreach ($this->txnIds as $id) { |
| 79 | - if (! empty($data->transaction_details->{$id})) { |
|
| 79 | + if (!empty($data->transaction_details->{$id})) { |
|
| 80 | 80 | $response['data'][$id] = $this->getInstance($data->transaction_details->{$id}); |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $src = "https://www.payumoney.com/{$this->prefix()}payment/op/getPaymentResponse?"; |
| 31 | 31 | |
| 32 | - return $src . http_build_query($this->fields()); |
|
| 32 | + return $src.http_build_query($this->fields()); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -59,14 +59,14 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | protected function makeResponse($data) |
| 61 | 61 | { |
| 62 | - if (! empty($data->errorCode)) { |
|
| 62 | + if (!empty($data->errorCode)) { |
|
| 63 | 63 | return (object) ['status' => false, 'data' => [], 'message' => $data->message]; |
| 64 | 64 | } |
| 65 | 65 | $response = ['status' => true, 'data' => [], 'message' => '']; |
| 66 | 66 | $collection = collect($data->result)->pluck('postBackParam', 'merchantTransactionId'); |
| 67 | 67 | |
| 68 | 68 | foreach ($this->txnIds as $id) { |
| 69 | - if (! empty($collection[$id])) { |
|
| 69 | + if (!empty($collection[$id])) { |
|
| 70 | 70 | $response['data'][$id] = $this->getInstance($collection[$id]); |
| 71 | 71 | } |
| 72 | 72 | } |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | * Routes for payment. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -Route::group(['namespace' => 'Tzsk\Payu\Controllers', 'middleware' => ['web']], function () { |
|
| 6 | +Route::group(['namespace' => 'Tzsk\Payu\Controllers', 'middleware' => ['web']], function() { |
|
| 7 | 7 | /** |
| 8 | 8 | * Make the payment request. |
| 9 | 9 | */ |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $attributes['account'] = $this->storage->getAccount(); |
| 94 | 94 | |
| 95 | 95 | $modelArray = $this->storage->getModel(); |
| 96 | - if (! empty($modelArray)) { |
|
| 96 | + if (!empty($modelArray)) { |
|
| 97 | 97 | $attributes['payable_id'] = $modelArray['id']; |
| 98 | 98 | $attributes['payable_type'] = $modelArray['class']; |
| 99 | 99 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $instance = PayuPayment::firstOrNew(['txnid' => $attributes['txnid']]); |
| 110 | 110 | $instance->fill(array_filter($attributes))->save(); |
| 111 | 111 | |
| 112 | - if (! empty($model)) { |
|
| 112 | + if (!empty($model)) { |
|
| 113 | 113 | $instance->fill([ |
| 114 | 114 | 'payable_id' => $model['id'], |
| 115 | 115 | 'payable_type' => $model['class'] |