@@ -34,17 +34,17 @@ discard block |
||
| 34 | 34 | $this->base_url = $this->settings->base_url; |
| 35 | 35 | $this->shop_slug = $this->settings->shop_slug; |
| 36 | 36 | $this->auth_code = $this->settings->auth_code; |
| 37 | - $this->code = $this->shop_slug . ':' . $this->auth_code; |
|
| 38 | - $this->auth_token = base64_encode($this->code); |
|
| 37 | + $this->code = $this->shop_slug.':'.$this->auth_code; |
|
| 38 | + $this->auth_token = base64_encode($this->code); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | // Purchase the invoice, save its transactionId and finaly return it. |
| 42 | 42 | public function purchase() |
| 43 | 43 | { |
| 44 | - $url = $this->base_url . "/users/me/shops/" . $this->shop_slug . "/deals"; |
|
| 44 | + $url = $this->base_url."/users/me/shops/".$this->shop_slug."/deals"; |
|
| 45 | 45 | $data = $this->settings->data; |
| 46 | 46 | |
| 47 | - $response = Http::withHeaders([ |
|
| 47 | + $response = Http::withHeaders([ |
|
| 48 | 48 | 'Authorization' => "Basic {$this->auth_token}", |
| 49 | 49 | "Content-Type" => 'application/json' |
| 50 | 50 | ])->post($url, $data); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | |
| 66 | 66 | $transactionId = $this->invoice->getTransactionId(); |
| 67 | - $redirect_url = $this->base_url . '/deals/' . $transactionId . '/redirect'; |
|
| 67 | + $redirect_url = $this->base_url.'/deals/'.$transactionId.'/redirect'; |
|
| 68 | 68 | |
| 69 | 69 | return $this->redirectWithForm($redirect_url, [], 'GET'); |
| 70 | 70 | } |
@@ -75,10 +75,10 @@ discard block |
||
| 75 | 75 | $inputs = request()->all(); |
| 76 | 76 | |
| 77 | 77 | $transactionId = $this->invoice->getTransactionId(); |
| 78 | - $verifyUrl = $this->base_url . "/users/me/shops/" . $this->shop_slug . "/deals/" . $transactionId . "/verify"; |
|
| 78 | + $verifyUrl = $this->base_url."/users/me/shops/".$this->shop_slug."/deals/".$transactionId."/verify"; |
|
| 79 | 79 | |
| 80 | 80 | if ($inputs['state'] == 'funded') { |
| 81 | - $result = Http::withHeaders([ |
|
| 81 | + $result = Http::withHeaders([ |
|
| 82 | 82 | 'Authorization' => "Basic {$this->auth_token}", |
| 83 | 83 | "Content-Type" => 'application/json' |
| 84 | 84 | ])->patch($verifyUrl); |