Оплатить найденный счёт

@param $billId

@return bool
426809
public static function doPay($billId)
	{
		$isUpdate = self::whereBillId($billId)
			->whereStatus(self::C_STATUS_WAITING)
			->update(
				array('status' => self::C_STATUS_PAID)
			);
		if ($isUpdate) {
			return true;
		}

		return false;
	}
848485
public function delete($sOXID = null)
    {
        if (!$sOXID) {
            $sOXID = $this->getId();
        }

        $blDelete = false;
        if ($sOXID && ($blDelete = parent::delete($sOXID))) {
            // cleaning up related data
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $sQ = "delete from oxuserbasketitems where oxbasketid = " . $oDb->quote($sOXID);
            $oDb->execute($sQ);
            $this->_aBasketItems = null;
        }

        return $blDelete;
    }
472950
public static function doCancel($bill_id)
	{
		$isUpdate = Bill::whereBillId($bill_id)
			->whereStatus(self::C_STATUS_WAITING)
			->update(
				array('status' => self::C_STATUS_REJECTED)
			);

		if ($isUpdate) {
			return true;
		}

		return false;
	}
556073
function getBillState($billId, $multicall = false)
    {
        if (!is_int($billId)) {
            throw new InvalidArgumentException('billId = ' . print_r($billId, true));
        }

        if ($multicall) {
            return $this->execute(ucfirst(__FUNCTION__), array($billId), $this->structHandler('Bill'));
        }
        return Structures\Bill::fromArray($this->execute(ucfirst(__FUNCTION__), array($billId)));
    }
48338
protected function _checkAccess($categoryId)
	{
		//jeśli nie ma klucza, to brak ograniczeń dostępu
		if (!array_key_exists($categoryId, $this->_acl)) {
			return true;
		}
		//czy jest część wspólna
		return [] !== array_intersect($this->_roles, $this->_acl[$categoryId]);
	}
874572
public function isUserInRoleById(int $userId): bool
    {
        if (isset($this->users[$userId])) {
            return true;
        }

        return false;
    }
795213
public function doVoid($authorization_id, $data = [])
    {
        $this->setRequestData(
            array_merge($data, [
                'AUTHORIZATIONID' => $authorization_id,
            ])
        );

        return $this->doPayPalRequest('DoVoid');
    }
874721
public function containsById($modelId)
    {
        /** @var ModelInterface $localModel */
        foreach ($this as $localModel) {
            if ($modelId === $localModel->getId()) {
                return true;
            }
        }

        return false;
    }
88891
public function subscribed($subscription = 'default', $planId = null)
    {
        $subscription = $this->subscription($subscription);

        if (is_null($subscription)) {
            return false;
        }

        if (is_null($planId)) {
            return $subscription->isActive();
        }

        if ($planId == $subscription->plan_id and $subscription->isActive()) {
            return true;
        }

        return false;
    }
586568
public function delete($sOxId = null)
    {
        if (!$sOxId) {
            $sOxId = $this->getId();
        }
        if (!$sOxId) {
            return false;
        }

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $sOxIdQuoted = $oDb->quote($sOxId);
        $oDb->execute('delete from oxobject2payment where oxobjectid = ' . $sOxIdQuoted);
        $oDb->execute('delete from oxobject2delivery where oxdeliveryid = ' . $sOxIdQuoted);
        $oDb->execute('delete from oxdel2delset where oxdelsetid = ' . $sOxIdQuoted);

        return parent::delete($sOxId);
    }
561020
public function closeOrder($orderId)
    {
        $result = $this->httpRaw(self::WECHAT_SHOP_ORDER_CLOSE_URL . 'access_token=' . $this->getAccessToken(), [
            'order_id' => $orderId,
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
611489
public function exists(string $taskID, string $listID = ''): bool
    {
        $list = $this->getListData($listID);
        if (isset($list[$taskID])) {
            $app = App::get();
            return $app->data->exists($this->getTaskDataKey($taskID, $listID));
        }
        return false;
    }
1110357
public function isValidCurrencyId($id) {
        $this->sError = FALSE;

        if (!$this->getCurrencyId2Code($id)) {
            $this->sError = 'Incorect currency id: ' . $id;
            return FALSE;
        }

        return TRUE;
    }
726200
public function makeSeen($messageId)
    {
        $seen = $this->message->update($messageId, ['is_seen' => 1]);
        if ($seen) {
            return true;
        }

        return false;
    }
1056350
public static function getBill($bill_id, $provider_id)
	{
		$bill = Bill::whereBillId($bill_id)
			->whereMerchantId($provider_id)
			->first();

		return $bill;
	}
598976
public function setBillid($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->billid !== $v) {
            $this->billid = $v;
            $this->modifiedColumns[GamecurrencyTableMap::COL_BILLID] = true;
        }

        return $this;
    }
1243879
public static function select($cardId) {
    $card = self::load($cardId);

    $available = array_keys($card['usable']);
    $selected  = Rand::int(0, count($available)-1);

    return $available[$selected];
  }