芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/reginaeigbe.com/folder/admin/tmp/app/Services/PaymentGateway/FlutterWave.php
secretKey = Setting::pull('flutterwave_secret_key'); } /** * Post request * * @param $body * @param $url * @return \GuzzleHttp\Promise\PromiseInterface|\Illuminate\Http\Client\Response */ private function postRequest($body, $url): Response { $response = Http::withHeaders([ 'Authorization' => "Bearer {$this->secretKey}" ])->post($this->baseUrl . $url, $body); return $response; } /** * Get request * * @param $url * @return \GuzzleHttp\Promise\PromiseInterface|Response */ private function getRequest($url) { $response = Http::withHeaders([ 'Authorization' => "Bearer {$this->secretKey}" ])->get($this->baseUrl . $url); return $response; } /** * Initialize payment * * @param $data * @return \GuzzleHttp\Promise\PromiseInterface|Response */ public function initializePayment($data) { return $this->postRequest($data, '/payments'); } /** * Verify payment * * @param $transactionId * @return \GuzzleHttp\Promise\PromiseInterface|Response */ public function verifyPayment($transactionId) { $response = $this->getRequest("/transactions/{$transactionId}/verify"); return $response; } }