Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit 96a2dec

Browse files
author
Hosanna Developers
committed
Union is not supported by PHP 7.4 adapt the code for PHP7.4
1 parent 21e93cc commit 96a2dec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function send(Message $message): bool
8484
}
8585
}
8686

87-
public function getBalance(): string|false
87+
public function getBalance(): string
8888
{
8989
try {
9090
$response = $this->httpClient->request('GET', '/public/v1/vendors/balance');
@@ -94,18 +94,18 @@ public function getBalance(): string|false
9494

9595
if ($code != 200) {
9696
$this->error = "Code: {$code} - Reason: {$reason}";
97-
return false;
97+
return '';
9898
}
9999
$body = (string)$response->getBody();
100100
$json = json_decode($body, true);
101101
if (!isset($json['data']['credit_balance'])) {
102102
$this->error = "Invalid response";
103-
return false;
103+
return '';
104104
}
105105
return $json['data']['credit_balance'];
106106
} catch (Exception $e) {
107107
$this->error = $e->getMessage();
108-
return false;
108+
return '';
109109
}
110110
}
111111
}

0 commit comments

Comments
 (0)