client = new BillplzClient($http, $apiKey, $baseUrl); } public function testGetBill(string $billId) { try { // Minta details bill berdasarkan ID $response = $this->client->bill()->get($billId); // Pastikan respons berjaya if ($response->isSuccessful()) { return $response->toArray(); // Kembalikan hasil dalam bentuk array } return ['error' => 'Request failed', 'details' => $response->toArray()]; } catch (NotFoundException $e) { return ['error' => 'Bill not found', 'details' => $e->getMessage()]; } catch (\Throwable $e) { return ['error' => 'Unexpected error', 'details' => $e->getMessage()]; } } }