Verification
The Verification resource allows you to perform KYC (Know Your Customer) processes, such as confirming account numbers and validating customer details. This is crucial for ensuring you are sending money to the correct person and preventing fraud.
Resolve Account Number
Confirm that an account number belongs to the expected customer. This feature is available to businesses in Nigeria and Ghana.
Method Signature
paystack()->verification()->resolveAccount(string $accountNumber, string $bankCode): arrayParameters
| Parameter | Type | Description |
|---|---|---|
accountNumber | string | The account number to resolve. |
bankCode | string | The bank code (use paystack()->miscellaneous()->listBanks() to get codes). |
Example
// Resolve a GTBank account number
$details = paystack()->verification()->resolveAccount('0123456789', '058');
// Accessing the account name
echo $details['data']['account_name']; // e.g., "Stephen Asare"Validate Account (South Africa)
Confirm the authenticity of a customer's account details. This is a more rigorous check used primarily in South Africa for KYC compliance.
Method Signature
paystack()->verification()->validateAccount(array $payload): arrayParameters
| Parameter | Type | Description |
|---|---|---|
account_name | string | Customer's registered name. |
account_number | string | Customer's account number. |
account_type | string | personal or business. |
bank_code | string | The bank code. |
country_code | string | ISO code (e.g., ZA). |
document_type | string | identityNumber, passportNumber, or businessRegistrationNumber. |
document_number | string | The ID number corresponding to the document type. |
Example
$validation = paystack()->verification()->validateAccount([
'bank_code' => '632005', // Absa Bank
'country_code' => 'ZA',
'account_number' => '0123456789',
'account_name' => 'Ann Bron',
'account_type' => 'personal',
'document_type' => 'identityNumber',
'document_number' => '1234567890123'
]);Resolve Card BIN
Get information about a card using its first 6 digits (BIN - Bank Identification Number). This helps identify the card brand, issuing bank, and country.
Method Signature
paystack()->verification()->resolveCardBin(string $bin): arrayParameters
| Parameter | Type | Description |
|---|---|---|
bin | string | First 6 digits of the card number. |
Example
$cardInfo = paystack()->verification()->resolveCardBin('539983');
// Output: Mastercard, Guaranty Trust Bank, NigeriaUse Cases
1. Verifying Beneficiaries Before Transfer
Before adding a transfer recipient, it is best practice to resolve the account number to ensure the name matches what the user provided.
$accountNumber = '0001234567';
$bankCode = '058';
$providedName = 'Stephen Asare';
try {
$resolved = paystack()->verification()->resolveAccount($accountNumber, $bankCode);
$bankAccountName = $resolved['data']['account_name'];
// Simple fuzzy match or direct comparison
if (strtoupper($bankAccountName) === strtoupper($providedName)) {
// Proceed to create recipient
paystack()->transferRecipient()->create([
'type' => 'nuban',
'name' => $bankAccountName,
'account_number' => $accountNumber,
'bank_code' => $bankCode,
'currency' => 'NGN'
]);
} else {
throw new Exception("Account name mismatch: $bankAccountName vs $providedName");
}
} catch (\Exception $e) {
// Handle invalid account
}2. Fraud Detection with Card BIN
You can use the BIN resolution to block cards from specific countries or to verify if a card is prepaid vs debit.
$bin = substr($cardNumber, 0, 6);
$details = paystack()->verification()->resolveCardBin($bin);
if ($details['data']['country_code'] !== 'NG') {
// Flag transaction for manual review if you only expect local cards
}