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