From e9acca1d48cfd3d9e2027e0752d81d65dcc2a96a Mon Sep 17 00:00:00 2001 From: Nur Ratna Sari Date: Mon, 18 Sep 2023 11:32:44 +0700 Subject: [PATCH] Add | check status user --- src/ESignBsre.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ESignBsre.php b/src/ESignBsre.php index 505dc91..380a1e3 100644 --- a/src/ESignBsre.php +++ b/src/ESignBsre.php @@ -3,6 +3,7 @@ namespace DiskominfotikBandaAceh\ESignBsrePhp; use GuzzleHttp\Client as GuzzleClient; +use PhpParser\Node\Stmt\TryCatch; class ESignBsre { @@ -81,6 +82,18 @@ public function verification() return new ESignBsreResponse($response); } + public function statusUser($nik) { + try { + $response = $this->http->request('GET', "{$this->getBaseUrl()}/api/user/status/$nik", [ + 'auth' => $this->getAuth() + ]); + } catch (\Exception $e) { + $response = $e->getResponse(); + } + + return new ESignBsreResponse($response); + } + private function getAuth(){ return [$this->username, $this->password]; }