Skip to content

What's the complete proper way to check if BVN is valid or not  #23

@olakunlevpn

Description

@olakunlevpn

What's the complete proper way to check if BVN is valid or not because i have play around with the code and it seems not working

$paystack = new Yabacon\Paystack(Config::get('app.paystack_secret_key'));

try
{
$responseObj = $paystack->bank->resolveBvn([
'bvn' => '22395920708', // in kobo
]);

} catch (\Yabacon\Paystack\Exception\ApiException $e) {
print_r($e->getResponseObject());
die($e->getMessage());
}

if (http_response_code(200)) {
var_dump($responseObj);
}

the above code respond on the browser with the following error

stdClass Object ( [status] => [message] => Unable to resolve BVN ) Paystack Request failed with response: 'Unable to resolve BVN'

But we need to check if its valid or not and display some certain error to the user after inserting wrong BVN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions