Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/Paystack.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,4 +694,32 @@ public function updateSubAccount($subaccount_code)
$this->setRequestOptions();
return $this->setHttpResponse("/subaccount/{$subaccount_code}", "PUT", array_filter($data))->getResponse();
}


/**
* Get a list of all supported banks and their properties
* @param $country - The country from which to obtain the list of supported banks, $per_page - Specifies how many records to retrieve per page ,
* $use_cursor - Flag to enable cursor pagination on the endpoint
* @return array
*/
public function getBanks(?string $country, int $per_page = 50, bool $use_cursor = false)
{
if (!$country)
$country = request()->country ?? 'nigeria';

$this->setRequestOptions();
return $this->setHttpResponse("/bank/?country=" . $country . "&use_cursor=" . $use_cursor . "&perPage=" . (int) $per_page, "GET")->getResponse();
}

/**
* Confirm an account belongs to the right customer
* @param $account_number - Account Number, $bank_code - You can get the list of bank codes by calling the List Banks endpoint
* @return array
*/
public function confirmAccount(string $account_number, string $bank_code)
{

$this->setRequestOptions();
return $this->setHttpResponse("/bank/resolve/?account_number=" . $account_number . "&bank_code=" . $bank_code, "GET")->getResponse();
}
}