@@ -114,14 +114,14 @@ discard block |
||
| 114 | 114 | ->client |
| 115 | 115 | ->request( |
| 116 | 116 | 'POST', |
| 117 | - $this->settings->apiPaymentUrl . self::PURCHASE_URL, |
|
| 117 | + $this->settings->apiPaymentUrl.self::PURCHASE_URL, |
|
| 118 | 118 | [ |
| 119 | 119 | RequestOptions::BODY => json_encode($data), |
| 120 | 120 | RequestOptions::QUERY => ['type' => $digipayType], |
| 121 | 121 | RequestOptions::HEADERS => [ |
| 122 | 122 | 'Agent' => $this->invoice->getDetail('agent') ?? 'WEB', |
| 123 | 123 | 'Content-Type' => 'application/json', |
| 124 | - 'Authorization' => 'Bearer ' . $this->oauthToken, |
|
| 124 | + 'Authorization' => 'Bearer '.$this->oauthToken, |
|
| 125 | 125 | 'Digipay-Version' => self::VERSION, |
| 126 | 126 | ], |
| 127 | 127 | RequestOptions::HTTP_ERRORS => false, |
@@ -161,12 +161,12 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | $response = $this->client->request( |
| 163 | 163 | 'POST', |
| 164 | - $this->settings->apiPaymentUrl . self::VERIFY_URL . $tracingId, |
|
| 164 | + $this->settings->apiPaymentUrl.self::VERIFY_URL.$tracingId, |
|
| 165 | 165 | [ |
| 166 | 166 | RequestOptions::QUERY => ['type' => $digipayTicketType], |
| 167 | 167 | RequestOptions::HEADERS => [ |
| 168 | 168 | "Accept" => "application/json", |
| 169 | - "Authorization" => "Bearer " . $this->oauthToken, |
|
| 169 | + "Authorization" => "Bearer ".$this->oauthToken, |
|
| 170 | 170 | ], |
| 171 | 171 | RequestOptions::HTTP_ERRORS => false, |
| 172 | 172 | ] |
@@ -191,10 +191,10 @@ discard block |
||
| 191 | 191 | ->client |
| 192 | 192 | ->request( |
| 193 | 193 | 'POST', |
| 194 | - $this->settings->apiPaymentUrl . self::OAUTH_URL, |
|
| 194 | + $this->settings->apiPaymentUrl.self::OAUTH_URL, |
|
| 195 | 195 | [ |
| 196 | 196 | RequestOptions::HEADERS => [ |
| 197 | - 'Authorization' => 'Basic ' . base64_encode("{$this->settings->client_id}:{$this->settings->client_secret}"), |
|
| 197 | + 'Authorization' => 'Basic '.base64_encode("{$this->settings->client_id}:{$this->settings->client_secret}"), |
|
| 198 | 198 | ], |
| 199 | 199 | RequestOptions::MULTIPART => [ |
| 200 | 200 | [ |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | throw new PurchaseFailedException('"type" is required for this method.'); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - if (is_null($trackingCode = $this->invoice->getDetail('trackingCode'))){ |
|
| 241 | + if (is_null($trackingCode = $this->invoice->getDetail('trackingCode'))) { |
|
| 242 | 242 | throw new PurchaseFailedException('"trackingCode" is required for this method.'); |
| 243 | 243 | } |
| 244 | 244 | |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | ->client |
| 252 | 252 | ->request( |
| 253 | 253 | 'POST', |
| 254 | - $this->settings->apiPaymentUrl . self::REVERSE_URL , |
|
| 254 | + $this->settings->apiPaymentUrl.self::REVERSE_URL, |
|
| 255 | 255 | [ |
| 256 | 256 | RequestOptions::BODY => json_encode($data), |
| 257 | 257 | RequestOptions::QUERY => ['type' => $digipayTicketType], |
| 258 | 258 | RequestOptions::HEADERS => [ |
| 259 | 259 | 'Content-Type' => 'application/json;charset=UTF-8', |
| 260 | - 'Authorization' => 'Bearer ' . $this->oauthToken, |
|
| 260 | + 'Authorization' => 'Bearer '.$this->oauthToken, |
|
| 261 | 261 | ], |
| 262 | 262 | RequestOptions::HTTP_ERRORS => FALSE, |
| 263 | 263 | ] |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | // define variable with the same name as the value of $detail |
| 288 | 288 | $$detail = $value; |
| 289 | 289 | |
| 290 | - if ($detail != 'type'){ |
|
| 290 | + if ($detail != 'type') { |
|
| 291 | 291 | $data[$detail] = $value; |
| 292 | 292 | } |
| 293 | 293 | } |
@@ -295,15 +295,15 @@ discard block |
||
| 295 | 295 | /** |
| 296 | 296 | * This api call only need when has a type [5,13] in pay response |
| 297 | 297 | */ |
| 298 | - if (!in_array($type , [5,13])){ |
|
| 298 | + if (!in_array($type, [5, 13])) { |
|
| 299 | 299 | throw new PurchaseFailedException('This method is not supported for this type.'); |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | - if (! is_array($products)){ |
|
| 302 | + if (!is_array($products)) { |
|
| 303 | 303 | throw new PurchaseFailedException('products must be an array.'); |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | - if (! DateTime::createFromFormat('Y-m-d', $deliveryDate) ){ |
|
| 306 | + if (!DateTime::createFromFormat('Y-m-d', $deliveryDate)) { |
|
| 307 | 307 | throw new PurchaseFailedException('deliveryDate must be a valid date with format Y-m-d.'); |
| 308 | 308 | } |
| 309 | 309 | |
@@ -311,13 +311,13 @@ discard block |
||
| 311 | 311 | ->client |
| 312 | 312 | ->request( |
| 313 | 313 | 'POST', |
| 314 | - $this->settings->apiPaymentUrl . self::DELIVER_URL , |
|
| 314 | + $this->settings->apiPaymentUrl.self::DELIVER_URL, |
|
| 315 | 315 | [ |
| 316 | 316 | RequestOptions::BODY => json_encode($data), |
| 317 | 317 | RequestOptions::QUERY => ['type' => $type], |
| 318 | 318 | RequestOptions::HEADERS => [ |
| 319 | 319 | 'Content-Type' => 'application/json;charset=UTF-8', |
| 320 | - 'Authorization' => 'Bearer ' . $this->oauthToken, |
|
| 320 | + 'Authorization' => 'Bearer '.$this->oauthToken, |
|
| 321 | 321 | ], |
| 322 | 322 | RequestOptions::HTTP_ERRORS => FALSE, |
| 323 | 323 | ] |