false]); $response = $client->request('GET', $url . '?api-key=510acd13d8d24375cf038ad626c282565451461a9c2399357e0b65365300787e&filters={"bill_no":"' . $bill_no . '"}'); $body = $response->getBody(); $data = json_decode($body, true); $payload = $data['payload']; return $payload['data']; } catch (\Exception $exception) { throw new MalformedRequestException($exception->getMessage()); } } 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.'); } }