@@ -124,13 +124,13 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | $this->setInvoice($invoice); |
| 126 | 126 | $this->driverInstance = $this->getFreshDriverInstance(); |
| 127 | - if(!empty($initializeCallback)) { |
|
| 127 | + if (!empty($initializeCallback)) { |
|
| 128 | 128 | call_user_func($initializeCallback, $this->driverInstance); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | //purchase the invoice |
| 132 | 132 | $body = $this->driverInstance->purchase(); |
| 133 | - if($finalizeCallback) { |
|
| 133 | + if ($finalizeCallback) { |
|
| 134 | 134 | call_user_func_array($finalizeCallback, [$this->driverInstance, $body]); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | public function pay($initializeCallback = null) |
| 148 | 148 | { |
| 149 | 149 | $this->driverInstance = $this->getDriverInstance(); |
| 150 | - if($initializeCallback) { |
|
| 150 | + if ($initializeCallback) { |
|
| 151 | 151 | call_user_func($initializeCallback, $this->driverInstance); |
| 152 | 152 | } |
| 153 | 153 | $this->validateInvoice(); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | public function verify($initializeCallback = null) |
| 166 | 166 | { |
| 167 | 167 | $this->driverInstance = $this->getDriverInstance(); |
| 168 | - if(!empty($initializeCallback)) { |
|
| 168 | + if (!empty($initializeCallback)) { |
|
| 169 | 169 | call_user_func($initializeCallback, $this->driverInstance); |
| 170 | 170 | } |
| 171 | 171 | $this->validateInvoice(); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | protected function getDriverInstance() |
| 194 | 194 | { |
| 195 | - if(!empty($this->driverInstance)) { |
|
| 195 | + if (!empty($this->driverInstance)) { |
|
| 196 | 196 | return $this->driverInstance; |
| 197 | 197 | } |
| 198 | 198 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $this->validateDriver(); |
| 210 | 210 | $class = $this->config['map'][$this->driver]; |
| 211 | 211 | |
| 212 | - return new $class($this->invoice,$this->settings); |
|
| 212 | + return new $class($this->invoice, $this->settings); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | * @throws InvoiceNotFoundException |
| 219 | 219 | */ |
| 220 | 220 | protected function validateInvoice() { |
| 221 | - if(empty($this->invoice)) { |
|
| 221 | + if (empty($this->invoice)) { |
|
| 222 | 222 | throw new InvoiceNotFoundException('Invoice not selected or does not exist.'); |
| 223 | 223 | } |
| 224 | 224 | } |
@@ -238,13 +238,13 @@ discard block |
||
| 238 | 238 | throw new DriverNotFoundException('Driver not found in config file. Try updating the package.'); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - if (! class_exists($this->config['map'][$this->driver])) { |
|
| 241 | + if (!class_exists($this->config['map'][$this->driver])) { |
|
| 242 | 242 | throw new DriverNotFoundException('Driver source not found. Please update the package.'); |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | $reflect = new \ReflectionClass($this->config['map'][$this->driver]); |
| 246 | 246 | |
| 247 | - if (! $reflect->implementsInterface(Contracts\DriverInterface::class)) { |
|
| 247 | + if (!$reflect->implementsInterface(Contracts\DriverInterface::class)) { |
|
| 248 | 248 | throw new \Exception("Driver must be an instance of Contracts\DriverInterface."); |
| 249 | 249 | } |
| 250 | 250 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function uuid($uuid = null) |
| 54 | 54 | { |
| 55 | - if(empty($uuid)) { |
|
| 55 | + if (empty($uuid)) { |
|
| 56 | 56 | $uuid = Uuid::uuid4()->toString(); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function amount($amount) |
| 105 | 105 | { |
| 106 | - if (! is_int($amount)) { |
|
| 106 | + if (!is_int($amount)) { |
|
| 107 | 107 | throw new \Exception('Amount value should be an integer.'); |
| 108 | 108 | } |
| 109 | 109 | $this->amount = $amount; |