protected function polling()
{
$currentAttempt = 0;
while ($currentAttempt++ < $this->pollingAttempts) {
/**
* Query Order Trade Status
*/
$this->query();
if ($this->response->getCode() >= 40000) {
break;
} elseif ($this->response->isPaid()) {
break;
} elseif ($this->response->isClosed()) {
break;
}
sleep($this->pollingWait);
}
/**
* Close Order
*/
if ($this->response->isWaitPay()) {
$this->cancel();
}
}