public function getAckValue($accountId) { $result = array('status' => false, 'sessionkey' => '', 'msg' => ''); if (empty($accountId)) { $result['msg'] = "参数不正确"; return $result; } $count = 0; while (true) { if ($count >= 3) { break; } // 调用api,开始扣钱 $params = array('account' => $accountId, "action" => "getkey"); $configPayment = Const_PaymentApp::CUSTOMER; $apiResult = Bll_Service_Payment::ack($configPayment, $params); if ($apiResult->isSucceeded()) { if ($apiResult['sessionkey']) { $result['status'] = true; $result['sessionkey'] = $apiResult['sessionkey']; break; } else { $count++; } $result['msg'] = '链接失败'; $count++; } } return $result; }