false]); $response = $client->request('GET', $url . '?api-key=510acd13d8d24375cf038ad626c282565451461a9c2399357e0b65365300787e&filters={"bill_no":' . $bill_no . '}'); $body = $response->getBody(); $data = json_decode($body, true); dd($data); $payload = $data['payload']; $transactions2 = $payload['data']; dd($transactions2); return $transactions2; } catch (\Exception $exception) { Log::error($exception); dd($exception); preg_match('/\{.*\}/s', $exception->getMessage(), $matches); $jsonError = json_decode($matches[0]); // Retrieved Transactions failed throw new MalformedRequestException($jsonError->title); } } if ($system_reference == 'exchange') { $transaction = Transaction::where('bill_no', $bill_no)->first(); if ($transaction) { return $transaction; } } // if not found throw new MalformedRequestException('Bill Number Not Found.'); } }