本文整理匯總了PHP中api::validatePIN方法的典型用法代碼示例。如果您正苦於以下問題:PHP api::validatePIN方法的具體用法?PHP api::validatePIN怎麽用?PHP api::validatePIN使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類api
的用法示例。
在下文中一共展示了api::validatePIN方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$feedback = array('code' => 0, 'msg' => "Welcome to eCab \n\r Invalid request \n\r");
}
//if not create session
}
//print_r($code);
} else {
$call = new api();
$stage = $call->checkSession($string->cell);
if ($stage === false) {
$feedback = array('code' => 0, 'msg' => "Welcome to eCab \n\r Invalid request \n\r");
} else {
//check pin
switch ($stage) {
case 0:
//validate pin
$pin = $call->validatePIN($code);
// echo '<br/>'. md5((int)trim($code))."<<<";
if ($pin === false) {
$attempts = $call->loginAttempts($string->cell);
if ($attempts > 3) {
$feedback = array('code' => 1, 'msg' => "Invalid Pin Please Try Again! \n\r" . ($attempts - 3) . " Attempts left.");
} else {
$feedback = array('code' => 0, 'msg' => "Too many invalid attempt \n\r Account blocked");
}
} else {
$info = $call->getSession($string->cell);
$feedback = array('code' => 1, 'msg' => "Please confirm you want to pay \n N\$ {$info['amount']} \n To Taxi#: {$info['taxi_id']}? \n\r 1. Yes \n\r 2. No");
// update session
$call->updateSession($string->cell);
}
break;