Skip to content

Commit

Permalink
Merge pull request #4 from henryejemuta/readme-update-discoenum-bug-fix
Browse files Browse the repository at this point in the history
Updated README.md to reflect Electricity implementation
  • Loading branch information
henryejemuta authored Jun 21, 2021
2 parents 76e7c4a + c2c0516 commit f53b25a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ Find an overview of all method with comment on what they do and expected argumen
*/
public function purchaseDataBundle(NetworkEnum $network, string $plan, string $phoneNumber, $requestID, $callbackUrl): ClubKonnectResponse


/**
* Electricity Bills payment handler to access:
* Electricity()->getDiscosAndMinMax();
* Electricity()->verifyMeterNumber(DiscoEnum $disco, $meterNumber): ClubKonnectResponse
* Electricity()->buyElectricity(DiscoEnum $disco, $meterNumber, $amount, MeterTypeEnum $meterType, $requestID, $callbackUrl = null): ClubKonnectResponse
*
* @return Electricity
*/
public function Electricity(): Electricity

```

### Testing
Expand All @@ -170,7 +181,7 @@ If you discover any security related issues, please email [email protected]
## Credits

- [Henry Ejemuta](https://github.com/henryejemuta)
- [All Contributors](../../contributors)
- [All Contributors](https://github.com/henryejemuta/graphs/contributors)

## License

Expand Down
6 changes: 3 additions & 3 deletions src/Enums/DiscoEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function toArray(): array
* @return DiscoEnum|null
* @throws ClubKonnectErrorException
*/
public static function getByCode($uid): ?DiscoEnum
public static function getByUID($uid): ?DiscoEnum
{
$uid = trim("$uid");
if (!key_exists($uid, self::$discos))
Expand All @@ -82,13 +82,13 @@ public static function getByCode($uid): ?DiscoEnum
* @return DiscoEnum|null
* @throws ClubKonnectErrorException
*/
public static function getByStatus($code): ?DiscoEnum
public static function getByCode($code): ?DiscoEnum
{
$code = trim($code);
if (!key_exists($code, self::$cache)) {
$found = false;
foreach (self::$discos as $idx => $disco) {
if ($disco->getCode() == $code) {
if ($disco['code'] == $code) {
self::$cache[$code] = new DiscoEnum($idx, $disco);
$found = true;
}
Expand Down

0 comments on commit f53b25a

Please sign in to comment.