Omnipay\Alipay\Responses\AopTradeQueryResponse::isPaid PHP Метод

isPaid() публичный Метод

public isPaid ( )
    public function isPaid()
    {
        if ($this->getTradeStatus() == 'TRADE_SUCCESS') {
            return true;
        } elseif ($this->getTradeStatus() == 'TRADE_FINISHED') {
            return true;
        } else {
            return false;
        }
    }

Usage Example

 /**
  * @link https://img.alicdn.com/top/i1/LB14VRALXXXXXcnXXXXXXXXXXXX
  */
 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();
     }
 }