@param int $whitelistId
@param int $whitelistResultId
@param int $noteAttachmentWhitelistResultId
@param int|null $monetaryAccountId
@param string[] $customHeaders

@return BunqResponseNoteAttachmentWhitelistResult
540834
public static function get(
        int $whitelistId,
        int $whitelistResultId,
        int $noteAttachmentWhitelistResultId,
        int $monetaryAccountId = null,
        array $customHeaders = []
    ): BunqResponseNoteAttachmentWhitelistResult {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [
                    static::determineUserId(),
                    static::determineMonetaryAccountId($monetaryAccountId),
                    $whitelistId,
                    $whitelistResultId,
                    $noteAttachmentWhitelistResultId,
                ]
            ),
            [],
            $customHeaders
        );

        return BunqResponseNoteAttachmentWhitelistResult::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
228920
public function stripTags($whiteList = '')
    {
        if (!$this->isString($whiteList)) {
            throw new StringObjectException(StringObjectException::MSG_INVALID_ARG, [
                '$whiteList',
                'integer'
            ]);
        }

        $this->val(strip_tags($this->val(), $whiteList));

        return $this;
    }
138729
public static function get(
        int $paymentServiceProviderCredentialId,
        array $customHeaders = []
    ): BunqResponsePaymentServiceProviderCredential {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [$paymentServiceProviderCredentialId]
            ),
            [],
            $customHeaders
        );

        return BunqResponsePaymentServiceProviderCredential::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
1355330
public static function create(array $cards, array $customHeaders = []): BunqResponseCardBatch
    {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->post(
            vsprintf(
                self::ENDPOINT_URL_CREATE,
                [static::determineUserId()]
            ),
            [self::FIELD_CARDS => $cards],
            $customHeaders
        );

        return BunqResponseCardBatch::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_POST)
        );
    }
184217
public static function get(
        int $bunqMeFundraiserProfileUserId,
        array $customHeaders = []
    ): BunqResponseBunqMeFundraiserProfileUser {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [static::determineUserId(), $bunqMeFundraiserProfileUserId]
            ),
            [],
            $customHeaders
        );

        return BunqResponseBunqMeFundraiserProfileUser::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
74800
public function RemoveFromNoticeList($aArticleIdsToMove = null, $sMessageHandler = null, $bIsInteralCall = false, $bIsAjaxCall = false)
    {
        $oGlobal = TGlobal::instance();
        $aRequestData = $oGlobal->GetUserData(self::URL_REQUEST_PARAMETER);
        if (is_null($aArticleIdsToMove) && array_key_exists(self::URL_ITEM_ID_NAME, $aRequestData)) {
            $aArticleIdsToMove = $aRequestData[self::URL_ITEM_ID_NAME];
            if (!is_array($aArticleIdsToMove)) {
                $aArticleIdsToMove = array($aArticleIdsToMove);
            }
        }

        if (is_null($sMessageHandler) && array_key_exists(self::URL_MESSAGE_CONSUMER_NAME, $aRequestData)) {
            $sMessageHandler = $aRequestData[self::URL_MESSAGE_CONSUMER_NAME];
            if (empty($sMessageHandler)) {
                $sMessageHandler = null;
            }
        }
        if (is_null($sMessageHandler)) {
            $sMessageHandler = self::MSG_CONSUMER_NAME;
        }
        $oMessageManager = TCMSMessageManager::GetInstance();
        $oUser = TdbDataExtranetUser::GetInstance();
        foreach ($aArticleIdsToMove as $iArticleId) {
            $oUser->RemoveArticleFromNoticeList($iArticleId);
            $oArticle = TdbShopArticle::GetNewInstance();
            /** @var $oArticle TdbShopArticle */
            $oArticle->Load($iArticleId);
            $aMessageData = array('sArticleLinkStart' => '<a href="'.TGlobal::OutHTML($oArticle->GetDetailLink()).'">', 'sArticleLinkEnd' => '</a>', 'sArticleName' => $oArticle->GetName());
            if (!$bIsAjaxCall) {
                $oMessageManager->AddMessage($sMessageHandler, 'NOTICE-LIST-REMOVED-ITEM', $aMessageData);
            }
        }

        $iRedirectNodeId = null;
        if (array_key_exists(self::URL_REDIRECT_NODE_ID_NAME, $aRequestData)) {
            $iRedirectNodeId = $aRequestData[self::URL_REDIRECT_NODE_ID_NAME];
            if (empty($iRedirectNodeId)) {
                $iRedirectNodeId = null;
            }
        }

        if (!$bIsInteralCall) {
            if ($bIsAjaxCall) {
                return array('message' => '');
            } else {
                $this->RedirectAfterEvent($iRedirectNodeId);
            }
        }
    }
592338
function listSenderSignatures($count = 100, $offset = 0) {

		$query = array();
		$query['count'] = $count;
		$query['offset'] = $offset;

		return new DynamicResponseModel($this->processRestRequest('GET', '/senders/', $query));
	}
1156030
public static function create(
        SchedulePaymentEntry $payment,
        Schedule $schedule,
        int $monetaryAccountId = null,
        array $customHeaders = []
    ): BunqResponseInt {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->post(
            vsprintf(
                self::ENDPOINT_URL_CREATE,
                [static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId)]
            ),
            [
                self::FIELD_PAYMENT => $payment,
                self::FIELD_SCHEDULE => $schedule,
            ],
            $customHeaders
        );

        return BunqResponseInt::castFromBunqResponse(
            static::processForId($responseRaw)
        );
    }
244262
public static function update(
        int $bunqmeFundraiserResultId,
        int $noteTextBunqMeFundraiserResultId,
        int $monetaryAccountId = null,
        string $content = null,
        array $customHeaders = []
    ): BunqResponseInt {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->put(
            vsprintf(
                self::ENDPOINT_URL_UPDATE,
                [
                    static::determineUserId(),
                    static::determineMonetaryAccountId($monetaryAccountId),
                    $bunqmeFundraiserResultId,
                    $noteTextBunqMeFundraiserResultId,
                ]
            ),
            [self::FIELD_CONTENT => $content],
            $customHeaders
        );

        return BunqResponseInt::castFromBunqResponse(
            static::processForId($responseRaw)
        );
    }
855016
def add_whitelist_entry(self, address, netmask, note=None):
        
        result = self._client.post("{}/whitelist".format(Profile.api_endpoint),
                data={
                    "address": address,
                    "netmask": netmask,
                    "note": note,
        })

        if not 'id' in result:
            raise UnexpectedResponseError("Unexpected response creating whitelist entry!")

        return WhitelistEntry(result['id'], self._client, json=result)
265674
public static function get(int $oauthClientId, array $customHeaders = []): BunqResponseOauthClient
    {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [static::determineUserId(), $oauthClientId]
            ),
            [],
            $customHeaders
        );

        return BunqResponseOauthClient::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
736129
public function parseInline($text, $whiteList = '', $clearHolders = true, $enableAutoLink = true)
    {
        $self = $this;
        $text = $this->call('beforeParseInline', $text);
        // code
        $text = preg_replace_callback(
            "/(^|[^\\\])(`+)(.+?)\\2/",
            function ($matches) use ($self) {
                return  $matches[1] . $self->makeHolder(
                    '<code>' . htmlspecialchars($matches[3]) . '</code>'
                    );
            },
            $text
            );
        // mathjax
        $text = preg_replace_callback(
            "/(^|[^\\\])(\\$+)(.+?)\\2/",
            function ($matches) use ($self) {
                return  $matches[1] . $self->makeHolder(
                    $matches[2] . htmlspecialchars($matches[3]) . $matches[2]
                    );
            },
            $text
            );
        // escape
        $text = preg_replace_callback(
            "/\\\(.)/u",
            function ($matches) use ($self) {
                $escaped = htmlspecialchars($matches[1]);
                $escaped = str_replace('$', '&dollar;', $escaped);
                return  $self->makeHolder($escaped);
            },
            $text
            );
        // link
        $text = preg_replace_callback(
            "/<(https?:\/\/.+)>/i",
            function ($matches) use ($self) {
                $url = $self->cleanUrl($matches[1]);
                $link = $self->call('parseLink', $matches[1]);
                return $self->makeHolder(
                    "<a href=\"{$url}\">{$link}</a>"
                );
            },
            $text
            );
        // encode unsafe tags
        $text = preg_replace_callback(
            "/<(\/?)([a-z0-9-]+)(\s+[^>]*)?>/i",
            function ($matches) use ($self, $whiteList) {
                if ($self->_html || false !== stripos(
                    '|' . $self->_commonWhiteList . '|' . $whiteList . '|', '|' . $matches[2] . '|'
                    )) {
                        return $self->makeHolder($matches[0]);
                    } else {
                        return htmlspecialchars($matches[0]);
                    }
            },
            $text
            );
        if ($this->_html) {
            $text = preg_replace_callback("/<!\-\-(.*?)\-\->/", function ($matches) use ($self) {
                return $self->makeHolder($matches[0]);
            }, $text);
        }
        $text = str_replace(array('<', '>'),  array('&lt;', '&gt;'),  $text);
        // footnote
        $text = preg_replace_callback(
            "/\[\^((?:[^\]]|\\\\\]|\\\\\[)+?)\]/",
            function ($matches) use ($self) {
                $id = array_search($matches[1], $self->_footnotes);
                if (false === $id) {
                    $id = count($self->_footnotes) + 1;
                    $self->_footnotes[$id] = $self->parseInline($matches[1], '', false);
                }
                return $self->makeHolder(
                    "<sup id=\"fnref-{$id}\"><a href=\"#fn-{$id}\" class=\"footnote-ref\">{$id}</a></sup>"
                );
            },
            $text
            );
        // image
        $text = preg_replace_callback(
            "/!\[((?:[^\]]|\\\\\]|\\\\\[)*?)\]\(((?:[^\)]|\\\\\)|\\\\\()+?)\)/",
            function ($matches) use ($self) {
                $escaped = htmlspecialchars($self->escapeBracket($matches[1]));
                $url = $self->escapeBracket($matches[2]);
                $url = $self->cleanUrl($url);
                return $self->makeHolder(
                    "<img src=\"{$url}\" alt=\"{$escaped}\" title=\"{$escaped}\">"
                );
            },
            $text
            );
        $text = preg_replace_callback(
            "/!\[((?:[^\]]|\\\\\]|\\\\\[)*?)\]\[((?:[^\]]|\\\\\]|\\\\\[)+?)\]/",
            function ($matches) use ($self) {
                $escaped = htmlspecialchars($self->escapeBracket($matches[1]));
                $result = isset( $self->_definitions[$matches[2]] ) ?
                "<img src=\"{$self->_definitions[$matches[2]]}\" alt=\"{$escaped}\" title=\"{$escaped}\">"
                : $escaped;
                return $self->makeHolder($result);
            },
            $text
            );
        // link
        $text = preg_replace_callback(
            "/\[((?:[^\]]|\\\\\]|\\\\\[)+?)\]\(((?:[^\)]|\\\\\)|\\\\\()+?)\)/",
            function ($matches) use ($self) {
                $escaped = $self->parseInline(
                    $self->escapeBracket($matches[1]),  '',  false, false
                    );
                $url = $self->escapeBracket($matches[2]);
                $url = $self->cleanUrl($url);
                return $self->makeHolder("<a href=\"{$url}\">{$escaped}</a>");
            },
            $text
            );
        $text = preg_replace_callback(
            "/\[((?:[^\]]|\\\\\]|\\\\\[)+?)\]\[((?:[^\]]|\\\\\]|\\\\\[)+?)\]/",
            function ($matches) use ($self) {
                $escaped = $self->parseInline(
                    $self->escapeBracket($matches[1]),  '',  false
                    );
                $result = isset( $self->_definitions[$matches[2]] ) ?
                "<a href=\"{$self->_definitions[$matches[2]]}\">{$escaped}</a>"
                : $escaped;
                return $self->makeHolder($result);
            },
            $text
            );
        // strong and em and some fuck
        $text = $this->parseInlineCallback($text);
        $text = preg_replace(
            "/<([_a-z0-9-\.\+]+@[^@]+\.[a-z]{2,})>/i",
            "<a href=\"mailto:\\1\">\\1</a>",
            $text
            );
        // autolink url
        if ($enableAutoLink) {
            $text = preg_replace_callback(
                "/(^|[^\"])((https?):[\p{L}_0-9-\.\/%#!@\?\+=~\|\,&\(\)]+)($|[^\"])/iu",
                function ($matches) use ($self) {
                    $link = $self->call('parseLink', $matches[2]);
                    return "{$matches[1]}<a href=\"{$matches[2]}\">{$link}</a>{$matches[4]}";
                },
                $text
                );
        }
        $text = $this->call('afterParseInlineBeforeRelease', $text);
        $text = $this->releaseHolder($text, $clearHolders);
        $text = $this->call('afterParseInline', $text);
        return $text;
    }
717977
public function isWhitelisted($uri, array $whitelistUrls = null)
    {
        if (is_null($whitelistUrls)) {
            $whitelistUrls = $this->whitelistedUrls;
        }
        foreach ($whitelistUrls as $whitelistUrl) {
            $match = preg_match('`'.$whitelistUrl.'`i', $uri);

            if ($match > 0) {
                return true;
            }
        }

        return false;
    }
199843
public function GetValidShippingTypesForBasketArticleListAndCountry($oBasketArticleList, $sDataCountryId)
    {
        $oValidShippingTypes = new TIterator();
        /** @var $oValidShippingTypes TIterator* */
        $oShippingTypes = $this->GetFieldShopShippingTypeList('position');
        while ($oShippingType = $oShippingTypes->Next()) {
            $bIsValid = $oShippingType->IsActive();
            $bIsValid = $bIsValid && $oShippingType->isValidForCurrentPortal();
            $bIsValid = $bIsValid && $oShippingType->IsValidForCurrentUser(false);
            $bIsValid = $bIsValid && $oShippingType->IsValidForCountry($sDataCountryId);
            if ($bIsValid) {
                $oAffectedArticles = $oBasketArticleList->GetArticlesAffectedByShippingType($oShippingType);
                $bIsValid = ($oAffectedArticles->Length() > 0);
            }
            if ($bIsValid) {
                $oValidShippingTypes->AddItem($oShippingType);
            }
        }

        return $oValidShippingTypes;
    }
731221
public function enabledStdModules(Array $whiteList)
  {
    foreach ($this->stdModules as $moduleName) {
      if (!in_array($moduleName, $whiteList)) {
        vc_remove_element($moduleName);
      }
    }
  }
1172394
public static function get(
        int $cashRegisterId,
        int $monetaryAccountId = null,
        array $customHeaders = []
    ): BunqResponseCashRegister {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId), $cashRegisterId]
            ),
            [],
            $customHeaders
        );

        return BunqResponseCashRegister::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
860443
static function customerList( $offset, $limit )
    {
        $db = eZDB::instance();

        $db_params = array();
        $db_params["offset"] =(int) $offset;
        $db_params["limit"] =(int) $limit;

        $customEmailResult = $db->arrayQuery( "SELECT DISTINCT email FROM ezorder WHERE is_temporary='0' ORDER BY email", $db_params );
        $customEmailArray = array();

        foreach( $customEmailResult as $customEmailRow )
        {
            $customEmail = $customEmailRow['email'];
            $customEmailArray[] = "'" . $customEmail . "'";
        }

        $emailString = implode( ", ", $customEmailArray );
        if ( !strlen( $emailString ) )
        {
            $emailString = "''";
        }

        $productItemArray = $db->arrayQuery(  "SELECT ezorder.id as order_id, user_id, email, ignore_vat, currency_code, ezproductcollection_item.*
                                                 FROM ezorder, ezproductcollection_item, ezproductcollection
                                                WHERE ezproductcollection_item.productcollection_id=ezorder.productcollection_id
                                                  AND is_temporary='0'
                                                  AND ezproductcollection_item.productcollection_id=ezproductcollection.id
                                                  AND email in ( $emailString )
                                             ORDER BY user_id, email, order_id" );


        $siteIni = eZINI::instance();
        $anonymousUserID = $siteIni->variable( 'UserSettings', 'AnonymousUserID' );

        $currentUserID = 0;
        $currentOrderID = 0;
        $currentUserEmail = "";
        $customArray = array();
        $accountName = null;
        $itemCount = 0;
        $hash = 0;
        $currencyCode = '';
        $ordersInfo = array();

        foreach( $productItemArray as $productItem )
        {
            $itemCount++;
            $currencyCode = $productItem['currency_code'];
            if ( $currencyCode == '' )
            {
                $currencyCode = eZOrder::fetchLocaleCurrencyCode();
            }

            $userID = $productItem['user_id'];
            $orderID = $productItem['order_id'];
            $order = eZOrder::fetch( $orderID );

            if ( $currentUserID != $userID && $itemCount != 1 )
            {
                $customArray[] = array( 'account_name' => $accountName,
                                        'orders_info' => $ordersInfo,
                                        'user_id' => $currentUserID,
                                        'email' => urlencode( $currentUserEmail ) );

                $ordersInfo = array();
                $accountName = $order->attribute( 'account_name' );
                $accountEmail = $order->attribute( 'account_email' );
            }

            $currentUserID = $userID;

            // If the custom is anoymous user
            if ( $currentUserID == $anonymousUserID )
            {
                $accountEmail = $order->attribute( 'email' );
                if ( $currentUserEmail == "" )
                {
                    $accountName = $order->attribute( 'account_name' );
                    $currentUserEmail = $accountEmail;
                }

                if ( $currentUserEmail != $accountEmail )
                {
                    $customArray[] = array( 'account_name' => $accountName,
                                            'orders_info' => $ordersInfo,
                                            'user_id' => $currentUserID,
                                            'email' => urlencode( $currentUserEmail ) );

                    $ordersInfo = array();
                    $accountName = $order->attribute( 'account_name' );
                    $accountEmail = $order->attribute( 'account_email' );
                    $currentUserEmail = $accountEmail;
                }
                $currentUserEmail = $accountEmail;
            }
            else
            {
                $currentUserEmail = 0;
            }

            $accountName = $order->attribute( 'account_name' );

            if ( !isset( $ordersInfo[$currencyCode] ) )
            {
                $ordersInfo[$currencyCode] = array( 'order_count' => 0,
                                                    'sum_ex_vat' => 0,
                                                    'sum_inc_vat' => 0 );
            }

            if (  $currentOrderID != $orderID )
            {
                $ordersInfo[$currencyCode]['order_count']++;
            }
            $currentOrderID = $orderID;

            if ( $productItem['ignore_vat'] == true )
            {
                $vatValue = 0;
            }
            else
            {
                $vatValue = $productItem['vat_value'];
            }

            $price = $productItem['price'];

            if ( $productItem['is_vat_inc'] )
            {
                $priceExVAT = $price / ( 100 + $vatValue ) * 100;
                $priceIncVAT = $price;
            }
            else
            {
                $priceExVAT = $price;
                $priceIncVAT = $price * ( 100 + $vatValue ) / 100;
            }

            $count = $productItem['item_count'];
            $realPricePercent = ( 100 - $productItem['discount'] ) / 100;
            $ordersInfo[$currencyCode]['sum_ex_vat'] += round( $count * $priceExVAT * $realPricePercent, 2 );
            $ordersInfo[$currencyCode]['sum_inc_vat'] += round( $count * $priceIncVAT * $realPricePercent, 2 );
        }
        if ( count( $productItemArray ) != 0 )
            $customArray[] = array( 'account_name' => $accountName,
                                    'orders_info' => $ordersInfo,
                                    'user_id' => $currentUserID,
                                    'email' => urlencode( $currentUserEmail ) );
        return $customArray;
    }